{"_id":"56e6f058d66be417007d2364","githubsync":"","parentDoc":null,"__v":4,"editedParams2":true,"user":"56cecbb2e50c9c1b008303eb","version":{"_id":"56cecbdc44c5700b0095c03d","project":"56cecbdb44c5700b0095c03a","__v":10,"createdAt":"2016-02-25T09:39:40.121Z","releaseDate":"2016-02-25T09:39:40.121Z","categories":["56cecbdc44c5700b0095c03e","56d1d2c05ad7ad0b00b7e809","56d1d2fa5ad7ad0b00b7e80a","56d369331660770b00081159","56d3693d1660770b0008115a","56e5361e7990160e002e3fbc","56e5362775eb791700a9c4d2","57a9030947f2f419009188d4","57b4705ee9e4c60e00f6f4c3","5828f5b04774ab0f005179a2"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":true,"codename":"","version_clean":"1.0.0","version":"1.0"},"project":"56cecbdb44c5700b0095c03a","category":{"_id":"56e5362775eb791700a9c4d2","__v":6,"project":"56cecbdb44c5700b0095c03a","pages":["56e590ae69d7890e000ec286","56e590fa3c29b117008dae50","56e6f058d66be417007d2364","56e7eaa8f0fafd36008faf59","56ea8db9ed3ad20e004e5a02","56ea8f3e0252fb17008804ac"],"version":"56cecbdc44c5700b0095c03d","sync":{"url":"","isSync":false},"reference":false,"createdAt":"2016-03-13T09:43:03.596Z","from_sync":false,"order":7,"slug":"remote-api","title":"Server API"},"editedParams":true,"updates":[],"next":{"pages":[],"description":""},"createdAt":"2016-03-14T17:09:44.091Z","link_external":false,"link_url":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[{"status":200,"language":"json","code":"{\n  \"id\" : \"dhfnIKSj\"\n}","name":""},{"language":"json","code":"{\n  \"errors\" : [\"The payload is not a valid JSON or doesn't match the expected structure\"]\n}","name":"Invalid JSON","status":400},{"code":"{\n  \"errors\" : [\"The feature in template number 1 is not valid\"]\n}","language":"json","status":400,"name":"Invalid Feature"}]},"settings":"","examples":{"codes":[{"code":"{\n    \"name\": \"internal content from api\",\n    \"is_default\": false,\n    \"templates\": [\n        {\n            \"layout_id\": \"content_with_two\",\n            \"name\": \"internal content from api\",\n            \"strings\": [\n                {\n                    \"name\": \"recommendations_title\",\n                    \"translations\": {\n                        \"def\": \"You may also like:\"\n                    }\n                },\n                {\n                    \"name\": \"share_prefix\",\n                    \"translations\": {\n                        \"def\": \"I wanted to share this article with you:\"\n                    }\n                },\n                {\n                    \"name\": \"share_subject\",\n                    \"translations\": {\n                        \"def\": \"Interesting article\"\n                    }\n                },\n                {\n                    \"name\": \"ext_prefix\",\n                    \"translations\": {\n                        \"def\": \"From around the web\"\n                    }\n                }\n            ],\n            \"settings\": {\n                \"big_share_button\": true,\n                \"small_view\": true,\n                \"build_without_image\": true,\n                \"small_share_button\": true,\n                \"drag_to_expand\": false\n            },\n            \"features\": [\n                {\n                    \"type\": \"content_feed\",\n                    \"position\": 1,\n                    \"data\": {\n                        \"feeds\": [\n                            {\n                                \"name\": \"PushApps Blog\",\n                                \"url\": \"http://blog.pushapps.mobi/rss\"\n                            }\n                        ],\n                        \"view_ext_on_browser\": false,\n                        \"recommendations_title\": true\n                    }\n                }\n            ]\n        }\n    ]\n}","language":"json","name":"Internal content campaign "},{"name":"External content campaign","language":"json","code":"{\n    \"name\": \"creating campaign from api with templates\",\n    \"is_default\": false,\n    \"templates\": [\n        {\n            \"layout_id\": \"content_with_three\",\n            \"name\": \"external content template from API\",\n            \"strings\": [\n                {\n                    \"name\": \"recommendations_title\",\n                    \"translations\": {\n                        \"def\": \"You may also likr\"\n                    }\n                },\n                {\n                    \"name\": \"share_prefix\",\n                    \"translations\": {\n                        \"def\": \"I wanted to share this article with you:\"\n                    }\n                },\n                {\n                    \"name\": \"share_subject\",\n                    \"translations\": {\n                        \"def\": \"Interesting article\"\n                    }\n                },\n                {\n                    \"name\": \"ext_prefix\",\n                    \"translations\": {\n                        \"def\": \"From around the web\"\n                    }\n                }\n            ],\n            \"settings\": {\n                \"big_share_button\": true,\n                \"small_view\": true,\n                \"recommendations_title\": true,\n                \"build_without_image\": true,\n                \"small_share_button\": true,\n                \"drag_to_expand\": false\n            },\n            \"features\": [\n                {\n                    \"type\": \"external_content\",\n                    \"position\": 1,\n                    \"data\": {\n                        \"type\": \"ob_sdk\",\n                        \"ob_widget_id\": \"sdk_1\",\n                        \"view_ext_on_browser\": true\n                    }\n                }\n            ]\n        }\n    ]\n}"},{"name":"Custom feed campaign","language":"json","code":"{\n    \"name\": \"internal content from api with templates\",\n    \"is_default\": true,\n    \"templates\": [\n        {\n            \"layout_id\": \"content_with_three\",\n            \"name\": \"internal content from api\",\n            \"strings\": [\n                {\n                    \"name\": \"recommendations_title\",\n                    \"translations\": {\n                        \"def\": \"You may also likr\"\n                    }\n                },\n                {\n                    \"name\": \"share_prefix\",\n                    \"translations\": {\n                        \"def\": \"I wanted to share this article with you:\"\n                    }\n                },\n                {\n                    \"name\": \"share_subject\",\n                    \"translations\": {\n                        \"def\": \"Interesting article\"\n                    }\n                },\n                {\n                    \"name\": \"ext_prefix\",\n                    \"translations\": {\n                        \"def\": \"From around the web\"\n                    }\n                }\n            ],\n            \"settings\": {\n                \"big_share_button\": true,\n                \"small_view\": true,\n                \"build_without_image\": true,\n                \"small_share_button\": false,\n                \"drag_to_expand\": true\n            },\n            \"features\": [\n                {\n                    \"type\": \"custom_feed\",\n                    \"position\": 1,\n                    \"data\": {\n                        \"recommendations_title\": false,\n                        \"articles\": [\n                            {\n                                \"title\": \"Painlessly reindexing your Elasticsearch index without any downtime\",\n                                \"url\": \"http://blog.pushapps.mobi/painlessly-reindexing-your-elasticsearch-index/\",\n                                \"thumb_url\": \"http://blog.pushapps.mobi/content/images/2016/03/data-migration805x340.jpg\",\n                                \"ext_browser\": false\n                            },\n                            {\n                                \"title\": \"Installing Elasticsearch 2.2.x And Kibana 4.4.x on Amazon Linux\",\n                                \"url\": \"http://blog.pushapps.mobi/installing-elasticsearch-2-2-and-kibana-4-4-on-amazon-linux/\",\n                                \"thumb_url\": \"http://blog.pushapps.mobi/content/images/2016/03/logo-elastic.png\",\n                                \"ext_browser\": true\n                            },\n                            {\n                                \"title\": \"The Push Notifications Evolution\",\n                                \"url\": \"http://blog.pushapps.mobi/the-push-notifications-evolution/\",\n                                \"thumb_url\": \"http://blog.pushapps.mobi/content/images/2016/03/Picture1.png\",\n                                \"ext_browser\": false\n                            }\n                        ]\n                    }\n                }\n            ]\n        }\n    ]\n}"}]},"method":"post","auth":"required","params":[{"_id":"56e7465b555c030e00a52a9e","ref":"","in":"body","required":true,"desc":"","default":"","type":"string","name":"name"},{"_id":"56e7465b555c030e00a52a9d","ref":"","in":"body","required":false,"desc":"if set to true this will be the app's default campaign","default":"false","type":"boolean","name":"is_default"},{"_id":"56e746f0e7d54f3200c70841","ref":"","in":"body","required":false,"desc":"array of [Template](doc:objects#section-template) that will be generated for this campaign. If empty no templates will be created and you will need to create one using the /templates call with thie campaign id you will receive as a result here. see examples and documentation below","default":"","type":"array_object","name":"templates"}],"url":"/v1/campaigns"},"isReference":false,"order":2,"body":"In order to use our push enrichments you need to create a campaign. A campaign can be set up once and reuse it  for as many notifications as you want. You can also use one campaign per notification.\n\nThere are 3 levels of objects you need to understand in order to build a campaign in PushApps. From the bottom up:\n* **Feature** - defines which feature of enrichment the notification will have\n* **Template** - contains one or more features. controls the settings of the UI for the campaign.\n* **Campaign** - contains one or more templates.Settings more than 1 template to a campaign allows you to perform A/B testing on the same notification -  If you set 2 templates for a campaign, 50% of the user will set template A and 50% will see template B.  You can compare the performance of each template and then keep only your preferred template for the next notifications.","excerpt":"","slug":"campaigns-create-campaign","type":"endpoint","title":"/campaigns - create campaign"}

post/campaigns - create campaign


Definition

{{ api_url }}{{ page_api_url }}

Parameters

Body Params

name:
required
string
is_default:
booleanfalse
if set to true this will be the app's default campaign
templates:
array of objects
array of [Template](doc:objects#section-template) that will be generated for this campaign. If empty no templates will be created and you will need to create one using the /templates call with thie campaign id you will receive as a result here. see examples and documentation below

Examples


Result Format


Documentation

In order to use our push enrichments you need to create a campaign. A campaign can be set up once and reuse it for as many notifications as you want. You can also use one campaign per notification. There are 3 levels of objects you need to understand in order to build a campaign in PushApps. From the bottom up: * **Feature** - defines which feature of enrichment the notification will have * **Template** - contains one or more features. controls the settings of the UI for the campaign. * **Campaign** - contains one or more templates.Settings more than 1 template to a campaign allows you to perform A/B testing on the same notification - If you set 2 templates for a campaign, 50% of the user will set template A and 50% will see template B. You can compare the performance of each template and then keep only your preferred template for the next notifications.