{"__v":24,"_id":"54ed1121a45a441700fd4cfc","api":{"auth":"required","params":[],"results":{"codes":[]},"url":""},"body":"Welcome aboard, Rooster!\n\nYou are probably ready to get started send push notifications to your site's visitors - using the Roost API.  The following overview of the Roost API will help you get started quickly.\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Customize Roost to Work for You\"\n}\n[/block]\nRoost is a push notification platform for websites. This API documentation provides instructions to perform both client-side and server-side integrations, so that you can customize your Roost notifications as needed.\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Client-side Javascript\"\n}\n[/block]\n[Roost client-side APIs](doc:api-basics) are all **javascript**, which are invoked from inside your web pages.  This involves making calls to the Roost servers.  \n\nThe client-side API is typically used to do one of the following:\n\na) *show/hide the roost opt-in registration prompt*\nb) *to modify a particular user’s registration*\n\nBut only a small fraction of the Roost APIs are client-side.\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"<!-- JAVASCRIPT CLIENT-SIDE EXAMPLE\\nHere's an example of a Roost client-side call to segment your users. -->\\n<script>\\n    var _roost = _roost || [];\\n    _roost.push([\\\"segments\\\", \\\"breakingnews\\\", \\\"sports\\\"]);\\n</script>\\n<!-- The user that is active in this session is now assigned to the \\\"breakingnews\\\" and \\\"sports\\\" segements, which can be used to target messages to them later.\\\" -->\",\n      \"language\": \"javascript\"\n    }\n  ],\n  \"sidebar\": true\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Server-Side REST Services\"\n}\n[/block]\n[Roost server-side APIs](doc:rest-api-basics) are **[REST](http://en.wikipedia.org/wiki/Representational_state_transfer)** services which use **[JSON](http://en.wikipedia.org/wiki/JSON)** to transport parameters and return values. All services show **[curl](http://en.wikipedia.org/wiki/CURL)** examples, and examples for specific languages will be added as we have time to do them.\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"// REST API EXAMPLE\\n// This curl call is an example of a simple push.\\n// You would replace [api key] and [api secret]\\n// with the values from your Roost Settings tab\\n\\ncurl -X POST -u \\\"[api key]:[api secret]\\\" \\\\\\n  -H \\\"Content-Type: application/json\\\" \\\\\\n  --data '{\\\"alert\\\":\\\"This Message Title Converts Da Best\\\", \\\"url\\\":\\\"http://myfavoritesite.com/story123\\\"}' \\\\\\n  https://api.goroost.com/api/push \",\n      \"language\": \"text\"\n    }\n  ],\n  \"sidebar\": true\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Getting Started\"\n}\n[/block]\nThere only a couple of requirements for using the Roost APIs.  Basically you need to have a Roost account, and you need the Roost Javascript installed on your site - which is the topic of our next section.","category":"54ed1120a45a441700fd4cfa","createdAt":"2015-02-25T00:02:41.425Z","excerpt":"This page will help you get started with Roost. You'll be up and running in a jiffy!","githubsync":"","hidden":false,"link_external":false,"link_url":"","order":0,"project":"54ed111fa45a441700fd4cf6","slug":"getting-started","sync_unique":"","title":"API Basics","type":"basic","updates":[],"user":"54ed0ffea45a441700fd4cf0","version":"54ed1120a45a441700fd4cf9"}

API Basics

This page will help you get started with Roost. You'll be up and running in a jiffy!

Welcome aboard, Rooster! You are probably ready to get started send push notifications to your site's visitors - using the Roost API. The following overview of the Roost API will help you get started quickly. [block:api-header] { "type": "basic", "title": "Customize Roost to Work for You" } [/block] Roost is a push notification platform for websites. This API documentation provides instructions to perform both client-side and server-side integrations, so that you can customize your Roost notifications as needed. [block:api-header] { "type": "basic", "title": "Client-side Javascript" } [/block] [Roost client-side APIs](doc:api-basics) are all **javascript**, which are invoked from inside your web pages. This involves making calls to the Roost servers. The client-side API is typically used to do one of the following: a) *show/hide the roost opt-in registration prompt* b) *to modify a particular user’s registration* But only a small fraction of the Roost APIs are client-side. [block:code] { "codes": [ { "code": "<!-- JAVASCRIPT CLIENT-SIDE EXAMPLE\nHere's an example of a Roost client-side call to segment your users. -->\n<script>\n var _roost = _roost || [];\n _roost.push([\"segments\", \"breakingnews\", \"sports\"]);\n</script>\n<!-- The user that is active in this session is now assigned to the \"breakingnews\" and \"sports\" segements, which can be used to target messages to them later.\" -->", "language": "javascript" } ], "sidebar": true } [/block] [block:api-header] { "type": "basic", "title": "Server-Side REST Services" } [/block] [Roost server-side APIs](doc:rest-api-basics) are **[REST](http://en.wikipedia.org/wiki/Representational_state_transfer)** services which use **[JSON](http://en.wikipedia.org/wiki/JSON)** to transport parameters and return values. All services show **[curl](http://en.wikipedia.org/wiki/CURL)** examples, and examples for specific languages will be added as we have time to do them. [block:code] { "codes": [ { "code": "// REST API EXAMPLE\n// This curl call is an example of a simple push.\n// You would replace [api key] and [api secret]\n// with the values from your Roost Settings tab\n\ncurl -X POST -u \"[api key]:[api secret]\" \\\n -H \"Content-Type: application/json\" \\\n --data '{\"alert\":\"This Message Title Converts Da Best\", \"url\":\"http://myfavoritesite.com/story123\"}' \\\n https://api.goroost.com/api/push ", "language": "text" } ], "sidebar": true } [/block] [block:api-header] { "type": "basic", "title": "Getting Started" } [/block] There only a couple of requirements for using the Roost APIs. Basically you need to have a Roost account, and you need the Roost Javascript installed on your site - which is the topic of our next section.
Welcome aboard, Rooster! You are probably ready to get started send push notifications to your site's visitors - using the Roost API. The following overview of the Roost API will help you get started quickly. [block:api-header] { "type": "basic", "title": "Customize Roost to Work for You" } [/block] Roost is a push notification platform for websites. This API documentation provides instructions to perform both client-side and server-side integrations, so that you can customize your Roost notifications as needed. [block:api-header] { "type": "basic", "title": "Client-side Javascript" } [/block] [Roost client-side APIs](doc:api-basics) are all **javascript**, which are invoked from inside your web pages. This involves making calls to the Roost servers. The client-side API is typically used to do one of the following: a) *show/hide the roost opt-in registration prompt* b) *to modify a particular user’s registration* But only a small fraction of the Roost APIs are client-side. [block:code] { "codes": [ { "code": "<!-- JAVASCRIPT CLIENT-SIDE EXAMPLE\nHere's an example of a Roost client-side call to segment your users. -->\n<script>\n var _roost = _roost || [];\n _roost.push([\"segments\", \"breakingnews\", \"sports\"]);\n</script>\n<!-- The user that is active in this session is now assigned to the \"breakingnews\" and \"sports\" segements, which can be used to target messages to them later.\" -->", "language": "javascript" } ], "sidebar": true } [/block] [block:api-header] { "type": "basic", "title": "Server-Side REST Services" } [/block] [Roost server-side APIs](doc:rest-api-basics) are **[REST](http://en.wikipedia.org/wiki/Representational_state_transfer)** services which use **[JSON](http://en.wikipedia.org/wiki/JSON)** to transport parameters and return values. All services show **[curl](http://en.wikipedia.org/wiki/CURL)** examples, and examples for specific languages will be added as we have time to do them. [block:code] { "codes": [ { "code": "// REST API EXAMPLE\n// This curl call is an example of a simple push.\n// You would replace [api key] and [api secret]\n// with the values from your Roost Settings tab\n\ncurl -X POST -u \"[api key]:[api secret]\" \\\n -H \"Content-Type: application/json\" \\\n --data '{\"alert\":\"This Message Title Converts Da Best\", \"url\":\"http://myfavoritesite.com/story123\"}' \\\n https://api.goroost.com/api/push ", "language": "text" } ], "sidebar": true } [/block] [block:api-header] { "type": "basic", "title": "Getting Started" } [/block] There only a couple of requirements for using the Roost APIs. Basically you need to have a Roost account, and you need the Roost Javascript installed on your site - which is the topic of our next section.
{"__v":22,"_id":"54ee407776ced60d00b0a03c","api":{"auth":"required","params":[],"results":{"codes":[{"status":200,"language":"json","code":"{}","name":""},{"status":400,"language":"json","code":"{}","name":""}]},"url":""},"body":"You will need a Roost account and the base Roost javascript on your website before you can send notifications.  You can sign up for a free Roost account on the Roost homepage.\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Basic Installation\"\n}\n[/block]\nThe following basic installation steps will get Roost on your site.  The Roost setup wizard should have gotten you through this already, but in case you skipped over it...\n[block:html]\n{\n  \"html\": \"<div>\\n<ol>\\n  <li>Go to the Roost dashboard, and open Settings->Roost Javascript.  Copy the script shown, which will include your API Key.<br/><br/>\\n    <pre>&lt;script src='//cdn.goroost.com/roostjs/[YOUR ROOST APP KEY]' async>&lt;/script&gt;</pre><br/>\\n    </li>\\n  <li>Using your website's dashboard paste this code just above the closing <b>&lt;/head&gt;</b> tag.</li>\\n</ol>\\n</div>\\n\\n<style></style>\"\n}\n[/block]\n  * And that's it.  Your site now supports Roost web push notifications.  All that remains is for at least one person to visit your site in a [Roost-supported browser](doc:roost-supported-browsers) - and opt-in for notifications  (On test sites this is often you).\n\nNote that you can also install [Roost via Wordpress](https://wordpress.org/plugins/roost-for-bloggers/), or manually on Squarespace, Tumblr, Blogger, and Typepad.  The Roost install wizard will walk you through these options.  Checkout the [Roost Integrations Page](https://goroost.com/browser-push) for more info.","category":"54ed1120a45a441700fd4cfa","createdAt":"2015-02-25T21:36:55.251Z","excerpt":"","githubsync":"","hidden":false,"link_external":false,"link_url":"","order":1,"project":"54ed111fa45a441700fd4cf6","slug":"basic-roost-installation","sync_unique":"","title":"Installing Roost","type":"basic","updates":[],"user":"54ed0ffea45a441700fd4cf0","version":"54ed1120a45a441700fd4cf9"}

Installing Roost


You will need a Roost account and the base Roost javascript on your website before you can send notifications. You can sign up for a free Roost account on the Roost homepage. [block:api-header] { "type": "basic", "title": "Basic Installation" } [/block] The following basic installation steps will get Roost on your site. The Roost setup wizard should have gotten you through this already, but in case you skipped over it... [block:html] { "html": "<div>\n<ol>\n <li>Go to the Roost dashboard, and open Settings->Roost Javascript. Copy the script shown, which will include your API Key.<br/><br/>\n <pre>&lt;script src='//cdn.goroost.com/roostjs/[YOUR ROOST APP KEY]' async>&lt;/script&gt;</pre><br/>\n </li>\n <li>Using your website's dashboard paste this code just above the closing <b>&lt;/head&gt;</b> tag.</li>\n</ol>\n</div>\n\n<style></style>" } [/block] * And that's it. Your site now supports Roost web push notifications. All that remains is for at least one person to visit your site in a [Roost-supported browser](doc:roost-supported-browsers) - and opt-in for notifications (On test sites this is often you). Note that you can also install [Roost via Wordpress](https://wordpress.org/plugins/roost-for-bloggers/), or manually on Squarespace, Tumblr, Blogger, and Typepad. The Roost install wizard will walk you through these options. Checkout the [Roost Integrations Page](https://goroost.com/browser-push) for more info.
You will need a Roost account and the base Roost javascript on your website before you can send notifications. You can sign up for a free Roost account on the Roost homepage. [block:api-header] { "type": "basic", "title": "Basic Installation" } [/block] The following basic installation steps will get Roost on your site. The Roost setup wizard should have gotten you through this already, but in case you skipped over it... [block:html] { "html": "<div>\n<ol>\n <li>Go to the Roost dashboard, and open Settings->Roost Javascript. Copy the script shown, which will include your API Key.<br/><br/>\n <pre>&lt;script src='//cdn.goroost.com/roostjs/[YOUR ROOST APP KEY]' async>&lt;/script&gt;</pre><br/>\n </li>\n <li>Using your website's dashboard paste this code just above the closing <b>&lt;/head&gt;</b> tag.</li>\n</ol>\n</div>\n\n<style></style>" } [/block] * And that's it. Your site now supports Roost web push notifications. All that remains is for at least one person to visit your site in a [Roost-supported browser](doc:roost-supported-browsers) - and opt-in for notifications (On test sites this is often you). Note that you can also install [Roost via Wordpress](https://wordpress.org/plugins/roost-for-bloggers/), or manually on Squarespace, Tumblr, Blogger, and Typepad. The Roost install wizard will walk you through these options. Checkout the [Roost Integrations Page](https://goroost.com/browser-push) for more info.
{"__v":11,"_id":"54ee423f25f3ca0d007867e0","api":{"auth":"required","params":[],"results":{"codes":[{"status":200,"language":"json","code":"{}","name":""},{"status":400,"language":"json","code":"{}","name":""}]},"url":""},"body":"The Roost Javascript API is used to control the opt-in experience and to modify the subscriptions of subscribers on your site.  Let's take a look at some of the details.\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Using roost.js to Register Users\"\n}\n[/block]\nYou must first put Roost onto your site before you can do anything else.  This is covered above, under [Installing Roost](http://roost.readme.io/v1.0/docs/basic-roost-installation).  Let's explain a bit how this works.\n\nThe base roost javascript (sidebar) must appear on any page where you want to prompt users to sign up for Roost, or where you want to make Roost API calls. The first part loads Roost (asynchronously), and the second line makes sure that your API calls can happen, even if Roost is not loaded yet. Be sure that this is declared before any use of roost calls on a page.\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"<!-- BASE ROOST JAVASCRIPT -->\\n\\n<script src=\\\"https://cdn.goroost.com/roostjs/YOUR APP KEY HERE\\\" async></script>\\n<script>\\n    var _roost = _roost || [];\\n</script>\\n\\n<!-- Replace “YOUR APP KEY HERE” with the Roost app key that is available from Settings->Roost Javascript in the Roost dashboard. -->\\n  \",\n      \"language\": \"javascript\"\n    }\n  ],\n  \"sidebar\": true\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Opt-in Prompt\"\n}\n[/block]\nPages with this javascript present will prompt users to register for your notifications.  The default behavior is to default the first time they come to the web page.  One prompt is shown per site, regardless of how many pages have the javascript present.\n\n**Safari**:  The prompt is modal, and will be shown exactly once.  If the user disallows notifications, then they must go into Safari->Preferences->Notifications and change the settings to enable notifications.  Whatever they choose, the user will never be prompted again, unless they remove the subscription from the notification list entirely.\n\n**Chrome**:  The prompt has three choices:  Allow, Disallow, and Dismiss (x).  If the user selects Allow or Disallow, then the choice is permanent, and no further prompts will be shown for that site.  If the permission dialog is dismissed, then you may show it again, but we advise doing this cautiously.  Roost continuously optimizes the default re-prompting behavior, which may change considerably in the future.","category":"54ee3a043749bf0d00c76573","createdAt":"2015-02-25T21:44:31.918Z","excerpt":"","githubsync":"","hidden":false,"link_external":false,"link_url":"","order":0,"project":"54ed111fa45a441700fd4cf6","slug":"api-basics","sync_unique":"","title":"Getting Started","type":"basic","updates":[],"user":"54ed0ffea45a441700fd4cf0","version":"54ed1120a45a441700fd4cf9"}

Getting Started


The Roost Javascript API is used to control the opt-in experience and to modify the subscriptions of subscribers on your site. Let's take a look at some of the details. [block:api-header] { "type": "basic", "title": "Using roost.js to Register Users" } [/block] You must first put Roost onto your site before you can do anything else. This is covered above, under [Installing Roost](http://roost.readme.io/v1.0/docs/basic-roost-installation). Let's explain a bit how this works. The base roost javascript (sidebar) must appear on any page where you want to prompt users to sign up for Roost, or where you want to make Roost API calls. The first part loads Roost (asynchronously), and the second line makes sure that your API calls can happen, even if Roost is not loaded yet. Be sure that this is declared before any use of roost calls on a page. [block:code] { "codes": [ { "code": "<!-- BASE ROOST JAVASCRIPT -->\n\n<script src=\"https://cdn.goroost.com/roostjs/YOUR APP KEY HERE\" async></script>\n<script>\n var _roost = _roost || [];\n</script>\n\n<!-- Replace “YOUR APP KEY HERE” with the Roost app key that is available from Settings->Roost Javascript in the Roost dashboard. -->\n ", "language": "javascript" } ], "sidebar": true } [/block] [block:api-header] { "type": "basic", "title": "Opt-in Prompt" } [/block] Pages with this javascript present will prompt users to register for your notifications. The default behavior is to default the first time they come to the web page. One prompt is shown per site, regardless of how many pages have the javascript present. **Safari**: The prompt is modal, and will be shown exactly once. If the user disallows notifications, then they must go into Safari->Preferences->Notifications and change the settings to enable notifications. Whatever they choose, the user will never be prompted again, unless they remove the subscription from the notification list entirely. **Chrome**: The prompt has three choices: Allow, Disallow, and Dismiss (x). If the user selects Allow or Disallow, then the choice is permanent, and no further prompts will be shown for that site. If the permission dialog is dismissed, then you may show it again, but we advise doing this cautiously. Roost continuously optimizes the default re-prompting behavior, which may change considerably in the future.
The Roost Javascript API is used to control the opt-in experience and to modify the subscriptions of subscribers on your site. Let's take a look at some of the details. [block:api-header] { "type": "basic", "title": "Using roost.js to Register Users" } [/block] You must first put Roost onto your site before you can do anything else. This is covered above, under [Installing Roost](http://roost.readme.io/v1.0/docs/basic-roost-installation). Let's explain a bit how this works. The base roost javascript (sidebar) must appear on any page where you want to prompt users to sign up for Roost, or where you want to make Roost API calls. The first part loads Roost (asynchronously), and the second line makes sure that your API calls can happen, even if Roost is not loaded yet. Be sure that this is declared before any use of roost calls on a page. [block:code] { "codes": [ { "code": "<!-- BASE ROOST JAVASCRIPT -->\n\n<script src=\"https://cdn.goroost.com/roostjs/YOUR APP KEY HERE\" async></script>\n<script>\n var _roost = _roost || [];\n</script>\n\n<!-- Replace “YOUR APP KEY HERE” with the Roost app key that is available from Settings->Roost Javascript in the Roost dashboard. -->\n ", "language": "javascript" } ], "sidebar": true } [/block] [block:api-header] { "type": "basic", "title": "Opt-in Prompt" } [/block] Pages with this javascript present will prompt users to register for your notifications. The default behavior is to default the first time they come to the web page. One prompt is shown per site, regardless of how many pages have the javascript present. **Safari**: The prompt is modal, and will be shown exactly once. If the user disallows notifications, then they must go into Safari->Preferences->Notifications and change the settings to enable notifications. Whatever they choose, the user will never be prompted again, unless they remove the subscription from the notification list entirely. **Chrome**: The prompt has three choices: Allow, Disallow, and Dismiss (x). If the user selects Allow or Disallow, then the choice is permanent, and no further prompts will be shown for that site. If the permission dialog is dismissed, then you may show it again, but we advise doing this cautiously. Roost continuously optimizes the default re-prompting behavior, which may change considerably in the future.
{"__v":20,"_id":"54ef0fbd4b06700d0062d13c","api":{"auth":"required","params":[],"results":{"codes":[{"status":200,"language":"json","code":"{}","name":""},{"status":400,"language":"json","code":"{}","name":""}]},"url":""},"body":"**Auto-prompt** allows you to enable/disable the automatic opt-in prompt for subscribing a site visitor.\n\nThe default opt-in prompt is displayed the first time a user visits a Roost-enabled page.  This behavior can be enabled/disabled by calling the **auto-prompt** command.   This call is typically placed just after the base Roost javascript (as shown in the example).\n[block:html]\n{\n  \"html\": \"<div style=\\\"font-size: 14pt; font-weight: bold;\\\">\\n  _roost.push([\\\"auto-prompt\\\", &lt;boolean&gt;])\\n</div>\"\n}\n[/block]\n\n[block:parameters]\n{\n  \"data\": {\n    \"0-0\": \"auto-prompt\",\n    \"h-0\": \"Parameter\",\n    \"h-1\": \"Description\",\n    \"0-1\": \"Command to modify auto-prompt behavior\",\n    \"1-0\": \"(boolean)\",\n    \"1-1\": \"Boolean value enabling/disabling auto-prompt\"\n  },\n  \"cols\": 2,\n  \"rows\": 2\n}\n[/block]\n\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"<!-- DISABLING AUTO-PROMPT -->\\n  \\n<script src=\\\"https://cdn.goroost.com/roostjs/YOUR APP KEY HERE\\\" async>\\n</script>\\n<script>\\n    var _roost = _roost || [];\\n    _roost.push(['autoprompt', false]);\\n</script>\",\n      \"language\": \"javascript\"\n    }\n  ],\n  \"sidebar\": true\n}\n[/block]\n**Notes**\n  * Other means (described in following sections) will be needed to subscribe users if auto-prompt is disabled. \n  * Most sites use Auto-prompt successfully, and using it will certainly capture more organic visitors.  An alternative to using Auto-prompt on all your pages it to prompt subscribers on particular pages.  Another alternative is to prompt visitors after they have been to several pages on your site - see [Prompt after X Visits](doc:prompt-on--page-loads).","category":"54ee3a043749bf0d00c76573","createdAt":"2015-02-26T12:21:17.851Z","excerpt":"","githubsync":"","hidden":false,"link_external":false,"link_url":"","order":1,"project":"54ed111fa45a441700fd4cf6","slug":"auto-prompt","sync_unique":"","title":"Auto-Prompt","type":"basic","updates":[],"user":"54ed0ffea45a441700fd4cf0","version":"54ed1120a45a441700fd4cf9"}

Auto-Prompt


**Auto-prompt** allows you to enable/disable the automatic opt-in prompt for subscribing a site visitor. The default opt-in prompt is displayed the first time a user visits a Roost-enabled page. This behavior can be enabled/disabled by calling the **auto-prompt** command. This call is typically placed just after the base Roost javascript (as shown in the example). [block:html] { "html": "<div style=\"font-size: 14pt; font-weight: bold;\">\n _roost.push([\"auto-prompt\", &lt;boolean&gt;])\n</div>" } [/block] [block:parameters] { "data": { "0-0": "auto-prompt", "h-0": "Parameter", "h-1": "Description", "0-1": "Command to modify auto-prompt behavior", "1-0": "(boolean)", "1-1": "Boolean value enabling/disabling auto-prompt" }, "cols": 2, "rows": 2 } [/block] [block:code] { "codes": [ { "code": "<!-- DISABLING AUTO-PROMPT -->\n \n<script src=\"https://cdn.goroost.com/roostjs/YOUR APP KEY HERE\" async>\n</script>\n<script>\n var _roost = _roost || [];\n _roost.push(['autoprompt', false]);\n</script>", "language": "javascript" } ], "sidebar": true } [/block] **Notes** * Other means (described in following sections) will be needed to subscribe users if auto-prompt is disabled. * Most sites use Auto-prompt successfully, and using it will certainly capture more organic visitors. An alternative to using Auto-prompt on all your pages it to prompt subscribers on particular pages. Another alternative is to prompt visitors after they have been to several pages on your site - see [Prompt after X Visits](doc:prompt-on--page-loads).
**Auto-prompt** allows you to enable/disable the automatic opt-in prompt for subscribing a site visitor. The default opt-in prompt is displayed the first time a user visits a Roost-enabled page. This behavior can be enabled/disabled by calling the **auto-prompt** command. This call is typically placed just after the base Roost javascript (as shown in the example). [block:html] { "html": "<div style=\"font-size: 14pt; font-weight: bold;\">\n _roost.push([\"auto-prompt\", &lt;boolean&gt;])\n</div>" } [/block] [block:parameters] { "data": { "0-0": "auto-prompt", "h-0": "Parameter", "h-1": "Description", "0-1": "Command to modify auto-prompt behavior", "1-0": "(boolean)", "1-1": "Boolean value enabling/disabling auto-prompt" }, "cols": 2, "rows": 2 } [/block] [block:code] { "codes": [ { "code": "<!-- DISABLING AUTO-PROMPT -->\n \n<script src=\"https://cdn.goroost.com/roostjs/YOUR APP KEY HERE\" async>\n</script>\n<script>\n var _roost = _roost || [];\n _roost.push(['autoprompt', false]);\n</script>", "language": "javascript" } ], "sidebar": true } [/block] **Notes** * Other means (described in following sections) will be needed to subscribe users if auto-prompt is disabled. * Most sites use Auto-prompt successfully, and using it will certainly capture more organic visitors. An alternative to using Auto-prompt on all your pages it to prompt subscribers on particular pages. Another alternative is to prompt visitors after they have been to several pages on your site - see [Prompt after X Visits](doc:prompt-on--page-loads).
{"__v":10,"_id":"54ee40dd76ced60d00b0a041","api":{"auth":"required","params":[],"results":{"codes":[{"status":200,"language":"json","code":"{}","name":""},{"status":400,"language":"json","code":"{}","name":""}]},"url":""},"body":"**Prompt **can be used to explicitly invoke the opt-in prompt for the current subscriber.\n\nUse **prompt** when you want to display the Roost opt-in prompt in reaction to a click or other action.  For example, you may have a button or menu item embedded in a section describing push notifications.\n[block:html]\n{\n  \"html\": \"<div style=\\\"font-size: 14pt; font-weight: bold;\\\">\\n  _roost.prompt()\\n</div>\"\n}\n[/block]\n\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"<!-- ACTION-BASED PROMPT -->\\n\\n<!-- First you have to disable the auto-prompt - somewhere after the base roost javascript -->\\n<script>\\n    var _roost = _roost || [];\\n    _roost.push(['autoprompt', false]);\\n</script>\\n.\\n.\\n.\\n<!-- Then your trigger -->\\n<button onclick=\\\"_roost.prompt();\\\">Subscribe for Push</button>\",\n      \"language\": \"text\"\n    }\n  ],\n  \"sidebar\": true\n}\n[/block]\n**Notes**\n  * Calling _roost.prompt requires that the base Roost javascript must be somewhere on the page.\n  * [Auto-Prompt](doc:auto-prompt) must be disabled for prompt to function correctly.  The reason for this is that once a user selects 'disallow', the opt-in prompt may not be displayed again.","category":"54ee3a043749bf0d00c76573","createdAt":"2015-02-25T21:38:37.252Z","excerpt":"","githubsync":"","hidden":false,"link_external":false,"link_url":"","order":2,"project":"54ed111fa45a441700fd4cf6","slug":"developer-quick-start","sync_unique":"","title":"Prompt on Action","type":"basic","updates":[],"user":"54ed0ffea45a441700fd4cf0","version":"54ed1120a45a441700fd4cf9"}

Prompt on Action


**Prompt **can be used to explicitly invoke the opt-in prompt for the current subscriber. Use **prompt** when you want to display the Roost opt-in prompt in reaction to a click or other action. For example, you may have a button or menu item embedded in a section describing push notifications. [block:html] { "html": "<div style=\"font-size: 14pt; font-weight: bold;\">\n _roost.prompt()\n</div>" } [/block] [block:code] { "codes": [ { "code": "<!-- ACTION-BASED PROMPT -->\n\n<!-- First you have to disable the auto-prompt - somewhere after the base roost javascript -->\n<script>\n var _roost = _roost || [];\n _roost.push(['autoprompt', false]);\n</script>\n.\n.\n.\n<!-- Then your trigger -->\n<button onclick=\"_roost.prompt();\">Subscribe for Push</button>", "language": "text" } ], "sidebar": true } [/block] **Notes** * Calling _roost.prompt requires that the base Roost javascript must be somewhere on the page. * [Auto-Prompt](doc:auto-prompt) must be disabled for prompt to function correctly. The reason for this is that once a user selects 'disallow', the opt-in prompt may not be displayed again.
**Prompt **can be used to explicitly invoke the opt-in prompt for the current subscriber. Use **prompt** when you want to display the Roost opt-in prompt in reaction to a click or other action. For example, you may have a button or menu item embedded in a section describing push notifications. [block:html] { "html": "<div style=\"font-size: 14pt; font-weight: bold;\">\n _roost.prompt()\n</div>" } [/block] [block:code] { "codes": [ { "code": "<!-- ACTION-BASED PROMPT -->\n\n<!-- First you have to disable the auto-prompt - somewhere after the base roost javascript -->\n<script>\n var _roost = _roost || [];\n _roost.push(['autoprompt', false]);\n</script>\n.\n.\n.\n<!-- Then your trigger -->\n<button onclick=\"_roost.prompt();\">Subscribe for Push</button>", "language": "text" } ], "sidebar": true } [/block] **Notes** * Calling _roost.prompt requires that the base Roost javascript must be somewhere on the page. * [Auto-Prompt](doc:auto-prompt) must be disabled for prompt to function correctly. The reason for this is that once a user selects 'disallow', the opt-in prompt may not be displayed again.
{"__v":9,"_id":"54ef10005bf74a0d00ef40b1","api":{"auth":"required","params":[],"results":{"codes":[{"status":200,"language":"json","code":"{}","name":""},{"status":400,"language":"json","code":"{}","name":""}]},"url":""},"body":"Min Visits allows you to delay the automatic opt-in prompt until a visitor has been on several been on several pages of your site.\n[block:html]\n{\n  \"html\": \"<div style=\\\"font-size: 14pt; font-weight: bold;\\\">\\n  _roost.push([\\\"minvisits\\\", &lt;number&gt;])\\n</div>\"\n}\n[/block]\n\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"Parameter\",\n    \"h-1\": \"Description\",\n    \"0-0\": \"minvisits\",\n    \"0-1\": \"Command to delay auto-prompt\",\n    \"1-0\": \"(# of min visits)\",\n    \"1-1\": \"The number is the number of visits or page loads required to show the subscription opt-in prompt.\"\n  },\n  \"cols\": 2,\n  \"rows\": 2\n}\n[/block]\n\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"<!-- PROMPT ON 3rd VISIT TO THIS SITE -->\\n\\n<script>\\n    var _roost = _roost || [];\\n    _roost.push(['autoprompt', false]);\\n    _roost.push([ 'minvisits', 3 ]);\\n</script>\",\n      \"language\": \"text\"\n    }\n  ],\n  \"sidebar\": true\n}\n[/block]\n\nThis approach is useful if your site is largely drive-by traffic, which means you may want to prompt your site's visitors a bit more cautiously.  A good way to do this is to prompt on the Xth page load.  This tracks the number of page loads across all Roost-enabled pages on the entire site.","category":"54ee3a043749bf0d00c76573","createdAt":"2015-02-26T12:22:24.649Z","excerpt":"","githubsync":"","hidden":false,"link_external":false,"link_url":"","order":3,"project":"54ed111fa45a441700fd4cf6","slug":"prompt-on--page-loads","sync_unique":"","title":"Prompt after X Visits","type":"basic","updates":[],"user":"54ed0ffea45a441700fd4cf0","version":"54ed1120a45a441700fd4cf9"}

Prompt after X Visits


Min Visits allows you to delay the automatic opt-in prompt until a visitor has been on several been on several pages of your site. [block:html] { "html": "<div style=\"font-size: 14pt; font-weight: bold;\">\n _roost.push([\"minvisits\", &lt;number&gt;])\n</div>" } [/block] [block:parameters] { "data": { "h-0": "Parameter", "h-1": "Description", "0-0": "minvisits", "0-1": "Command to delay auto-prompt", "1-0": "(# of min visits)", "1-1": "The number is the number of visits or page loads required to show the subscription opt-in prompt." }, "cols": 2, "rows": 2 } [/block] [block:code] { "codes": [ { "code": "<!-- PROMPT ON 3rd VISIT TO THIS SITE -->\n\n<script>\n var _roost = _roost || [];\n _roost.push(['autoprompt', false]);\n _roost.push([ 'minvisits', 3 ]);\n</script>", "language": "text" } ], "sidebar": true } [/block] This approach is useful if your site is largely drive-by traffic, which means you may want to prompt your site's visitors a bit more cautiously. A good way to do this is to prompt on the Xth page load. This tracks the number of page loads across all Roost-enabled pages on the entire site.
Min Visits allows you to delay the automatic opt-in prompt until a visitor has been on several been on several pages of your site. [block:html] { "html": "<div style=\"font-size: 14pt; font-weight: bold;\">\n _roost.push([\"minvisits\", &lt;number&gt;])\n</div>" } [/block] [block:parameters] { "data": { "h-0": "Parameter", "h-1": "Description", "0-0": "minvisits", "0-1": "Command to delay auto-prompt", "1-0": "(# of min visits)", "1-1": "The number is the number of visits or page loads required to show the subscription opt-in prompt." }, "cols": 2, "rows": 2 } [/block] [block:code] { "codes": [ { "code": "<!-- PROMPT ON 3rd VISIT TO THIS SITE -->\n\n<script>\n var _roost = _roost || [];\n _roost.push(['autoprompt', false]);\n _roost.push([ 'minvisits', 3 ]);\n</script>", "language": "text" } ], "sidebar": true } [/block] This approach is useful if your site is largely drive-by traffic, which means you may want to prompt your site's visitors a bit more cautiously. A good way to do this is to prompt on the Xth page load. This tracks the number of page loads across all Roost-enabled pages on the entire site.
{"__v":6,"_id":"54ef100d31a42421007599b3","api":{"auth":"required","params":[],"results":{"codes":[{"status":200,"language":"json","code":"{}","name":""},{"status":400,"language":"json","code":"{}","name":""}]},"url":""},"body":"Targeting your messages better is one of the key approaches to more effective push notifications.  On Roost, **Segments** are the core technology used to do this.\n\nUsing the Javascript API, you can assign Segments to subscribers who are on the current Roost-enabled page.  Once these Segments are assigned, then you can target notifications to subscribers associated with specific Segments.  \n[block:callout]\n{\n  \"type\": \"info\",\n  \"body\": \"On a sports site you might Segment a subscriber with \\\"NFL\\\" or \\\"Seahawks\\\", because they visited pages that are focused on those topics. \\n\\nThis user would then receive notification sent to the the \\\"NFL\\\" and \\\"Seahawks\\\" tags, as well as general broadcast notifications (with no segments specified).\",\n  \"title\": \"Example: Sports Site Segmentation\"\n}\n[/block]\n\n\nAll of segmentation calls require the base Roost javascript on the page.","category":"54ee3a043749bf0d00c76573","createdAt":"2015-02-26T12:22:37.554Z","excerpt":"","githubsync":"","hidden":false,"link_external":false,"link_url":"","order":4,"project":"54ed111fa45a441700fd4cf6","slug":"segmenting-users","sync_unique":"","title":"Segmentation Overview","type":"basic","updates":[],"user":"54ed0ffea45a441700fd4cf0","version":"54ed1120a45a441700fd4cf9"}

Segmentation Overview


Targeting your messages better is one of the key approaches to more effective push notifications. On Roost, **Segments** are the core technology used to do this. Using the Javascript API, you can assign Segments to subscribers who are on the current Roost-enabled page. Once these Segments are assigned, then you can target notifications to subscribers associated with specific Segments. [block:callout] { "type": "info", "body": "On a sports site you might Segment a subscriber with \"NFL\" or \"Seahawks\", because they visited pages that are focused on those topics. \n\nThis user would then receive notification sent to the the \"NFL\" and \"Seahawks\" tags, as well as general broadcast notifications (with no segments specified).", "title": "Example: Sports Site Segmentation" } [/block] All of segmentation calls require the base Roost javascript on the page.
Targeting your messages better is one of the key approaches to more effective push notifications. On Roost, **Segments** are the core technology used to do this. Using the Javascript API, you can assign Segments to subscribers who are on the current Roost-enabled page. Once these Segments are assigned, then you can target notifications to subscribers associated with specific Segments. [block:callout] { "type": "info", "body": "On a sports site you might Segment a subscriber with \"NFL\" or \"Seahawks\", because they visited pages that are focused on those topics. \n\nThis user would then receive notification sent to the the \"NFL\" and \"Seahawks\" tags, as well as general broadcast notifications (with no segments specified).", "title": "Example: Sports Site Segmentation" } [/block] All of segmentation calls require the base Roost javascript on the page.
{"__v":9,"_id":"54f083cb9502520d00d78d81","api":{"auth":"required","params":[],"results":{"codes":[{"status":200,"language":"json","code":"{}","name":""},{"status":400,"language":"json","code":"{}","name":""}]},"url":""},"body":"Assign an Alias to a subscriber using the **alias** command.\n\nParameters are passed as an array.\n[block:html]\n{\n  \"html\": \"<div style=\\\"font-size: 14pt; font-weight: bold;\\\">\\n  _roost.push([\\\"alias\\\", &lt;unique id that you provide&gt;])\\n</div>\"\n}\n[/block]\n\n[block:parameters]\n{\n  \"data\": {\n    \"0-0\": \"alias\",\n    \"0-1\": \"Command for associating an alias with the current subscriber.\",\n    \"1-0\": \"(unique id)\",\n    \"1-1\": \"Unique identifier that you wish to have associated with this subscriber.\",\n    \"h-0\": \"Parameter\",\n    \"h-1\": \"Description\"\n  },\n  \"cols\": 2,\n  \"rows\": 2\n}\n[/block]\n\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"<!-- ASSIGNING AN ALIAS TO THE CURRENT USER -->\\n\\n<script>\\n    var _roost = _roost || [];\\n    _roost.push([\\\"alias\\\", \\\"amanda@xyz123.com\\\"]);\\n</script>\\n\\n<!-- You will typically replace the email address shown above with server-side script that supplies the unique alias string from your server.  For example: -->\\n\\n<script>\\n    var _roost = _roost || [];\\n    _roost.push([\\\"alias\\\", <?php echo $user_id ?>]);\\n</script>\\n\",\n      \"language\": \"javascript\"\n    }\n  ],\n  \"sidebar\": true\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"What is an Alias?\"\n}\n[/block]\nIf you need to mark a particular subscriber, the Roost term for this is **'Alias.' ** You can assign any string as an Alias for a subscriber.  Often this is the subscriber's email, or an internal ID that you use on your servers.  \n\nAliases are most applicable on sites with a login or membership feature.","category":"54ee3a043749bf0d00c76573","createdAt":"2015-02-27T14:48:43.686Z","excerpt":"","githubsync":"","hidden":false,"link_external":false,"link_url":"","order":5,"project":"54ed111fa45a441700fd4cf6","slug":"segmenting-individuals-alias","sync_unique":"","title":"Segmenting Individuals - Alias","type":"basic","updates":[],"user":"54ed0ffea45a441700fd4cf0","version":"54ed1120a45a441700fd4cf9"}

Segmenting Individuals - Alias


Assign an Alias to a subscriber using the **alias** command. Parameters are passed as an array. [block:html] { "html": "<div style=\"font-size: 14pt; font-weight: bold;\">\n _roost.push([\"alias\", &lt;unique id that you provide&gt;])\n</div>" } [/block] [block:parameters] { "data": { "0-0": "alias", "0-1": "Command for associating an alias with the current subscriber.", "1-0": "(unique id)", "1-1": "Unique identifier that you wish to have associated with this subscriber.", "h-0": "Parameter", "h-1": "Description" }, "cols": 2, "rows": 2 } [/block] [block:code] { "codes": [ { "code": "<!-- ASSIGNING AN ALIAS TO THE CURRENT USER -->\n\n<script>\n var _roost = _roost || [];\n _roost.push([\"alias\", \"amanda@xyz123.com\"]);\n</script>\n\n<!-- You will typically replace the email address shown above with server-side script that supplies the unique alias string from your server. For example: -->\n\n<script>\n var _roost = _roost || [];\n _roost.push([\"alias\", <?php echo $user_id ?>]);\n</script>\n", "language": "javascript" } ], "sidebar": true } [/block] [block:api-header] { "type": "basic", "title": "What is an Alias?" } [/block] If you need to mark a particular subscriber, the Roost term for this is **'Alias.' ** You can assign any string as an Alias for a subscriber. Often this is the subscriber's email, or an internal ID that you use on your servers. Aliases are most applicable on sites with a login or membership feature.
Assign an Alias to a subscriber using the **alias** command. Parameters are passed as an array. [block:html] { "html": "<div style=\"font-size: 14pt; font-weight: bold;\">\n _roost.push([\"alias\", &lt;unique id that you provide&gt;])\n</div>" } [/block] [block:parameters] { "data": { "0-0": "alias", "0-1": "Command for associating an alias with the current subscriber.", "1-0": "(unique id)", "1-1": "Unique identifier that you wish to have associated with this subscriber.", "h-0": "Parameter", "h-1": "Description" }, "cols": 2, "rows": 2 } [/block] [block:code] { "codes": [ { "code": "<!-- ASSIGNING AN ALIAS TO THE CURRENT USER -->\n\n<script>\n var _roost = _roost || [];\n _roost.push([\"alias\", \"amanda@xyz123.com\"]);\n</script>\n\n<!-- You will typically replace the email address shown above with server-side script that supplies the unique alias string from your server. For example: -->\n\n<script>\n var _roost = _roost || [];\n _roost.push([\"alias\", <?php echo $user_id ?>]);\n</script>\n", "language": "javascript" } ], "sidebar": true } [/block] [block:api-header] { "type": "basic", "title": "What is an Alias?" } [/block] If you need to mark a particular subscriber, the Roost term for this is **'Alias.' ** You can assign any string as an Alias for a subscriber. Often this is the subscriber's email, or an internal ID that you use on your servers. Aliases are most applicable on sites with a login or membership feature.
{"__v":12,"_id":"54f0e01a7d40be370012d539","api":{"auth":"required","params":[],"results":{"codes":[{"status":200,"language":"json","code":"{}","name":""},{"status":400,"language":"json","code":"{}","name":""}]},"url":""},"body":"Set the Segments for a subscriber using the **segments** command.  \n\nThis call replaces any Segments currently associated with a subscriber - it is not additive.\n\nParameters are passed in an array.\n[block:html]\n{\n  \"html\": \"<div style=\\\"font-size: 14pt; font-weight: bold;\\\">\\n  _roost.push([\\\"segments\\\", &lt;first&gt;, &lt;second&gt;, ..., &lt;last&gt;])\\n</div>\"\n}\n[/block]\n\n[block:parameters]\n{\n  \"data\": {\n    \"0-0\": \"segments\",\n    \"0-1\": \"Command to set the segments for a subscriber\",\n    \"1-0\": \"(remaining parameters)\",\n    \"1-1\": \"Segments to be added (replacing previous segment list)\",\n    \"h-0\": \"Parameter\",\n    \"h-1\": \"Description\"\n  },\n  \"cols\": 2,\n  \"rows\": 2\n}\n[/block]\n\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"<!-- 'Segments' OPERATION WILL SET THE LIST OF SEGMENTS FOR A SUBSCRIBER -->\\n<script>\\n    var _roost = _roost || [];\\n    _roost.push([\\\"segments\\\", \\\"breakingnews\\\", \\\"sports\\\"]);\\n</script>\",\n      \"language\": \"text\"\n    }\n  ],\n  \"sidebar\": true\n}\n[/block]","category":"54ee3a043749bf0d00c76573","createdAt":"2015-02-27T21:22:34.903Z","excerpt":"","githubsync":"","hidden":false,"link_external":false,"link_url":"","order":6,"project":"54ed111fa45a441700fd4cf6","slug":"segmenting-groups-of-users","sync_unique":"","title":"Set Segments","type":"basic","updates":[],"user":"54ed0ffea45a441700fd4cf0","version":"54ed1120a45a441700fd4cf9"}

Set Segments


Set the Segments for a subscriber using the **segments** command. This call replaces any Segments currently associated with a subscriber - it is not additive. Parameters are passed in an array. [block:html] { "html": "<div style=\"font-size: 14pt; font-weight: bold;\">\n _roost.push([\"segments\", &lt;first&gt;, &lt;second&gt;, ..., &lt;last&gt;])\n</div>" } [/block] [block:parameters] { "data": { "0-0": "segments", "0-1": "Command to set the segments for a subscriber", "1-0": "(remaining parameters)", "1-1": "Segments to be added (replacing previous segment list)", "h-0": "Parameter", "h-1": "Description" }, "cols": 2, "rows": 2 } [/block] [block:code] { "codes": [ { "code": "<!-- 'Segments' OPERATION WILL SET THE LIST OF SEGMENTS FOR A SUBSCRIBER -->\n<script>\n var _roost = _roost || [];\n _roost.push([\"segments\", \"breakingnews\", \"sports\"]);\n</script>", "language": "text" } ], "sidebar": true } [/block]
Set the Segments for a subscriber using the **segments** command. This call replaces any Segments currently associated with a subscriber - it is not additive. Parameters are passed in an array. [block:html] { "html": "<div style=\"font-size: 14pt; font-weight: bold;\">\n _roost.push([\"segments\", &lt;first&gt;, &lt;second&gt;, ..., &lt;last&gt;])\n</div>" } [/block] [block:parameters] { "data": { "0-0": "segments", "0-1": "Command to set the segments for a subscriber", "1-0": "(remaining parameters)", "1-1": "Segments to be added (replacing previous segment list)", "h-0": "Parameter", "h-1": "Description" }, "cols": 2, "rows": 2 } [/block] [block:code] { "codes": [ { "code": "<!-- 'Segments' OPERATION WILL SET THE LIST OF SEGMENTS FOR A SUBSCRIBER -->\n<script>\n var _roost = _roost || [];\n _roost.push([\"segments\", \"breakingnews\", \"sports\"]);\n</script>", "language": "text" } ], "sidebar": true } [/block]
{"__v":11,"_id":"54f0e42d7d40be370012d53f","api":{"auth":"required","params":[],"results":{"codes":[{"status":200,"language":"json","code":"{}","name":""},{"status":400,"language":"json","code":"{}","name":""}]},"url":""},"body":"Associate additional Segments with a subscriber with the **segments_add** command.\n\nParameters are passed in an array.\n[block:html]\n{\n  \"html\": \"<div style=\\\"font-size: 14pt; font-weight: bold;\\\">\\n  _roost.push([\\\"segments_add\\\", &lt;first&gt;, &lt;second&gt;, ..., &lt;last&gt;])\\n</div>\"\n}\n[/block]\n\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"<!-- \\\"segments_add\\\" OPERATION WILL ASSOCIATE ADDITIONAL SEGMENTS WITH A SUBSCRIBER -->\\n<script>\\n    var _roost = _roost || [];\\n    _roost.push([\\\"segments_add\\\", \\\"breakingnews\\\", \\\"politics\\\", \\\"sports\\\"]);\\n</script>\",\n      \"language\": \"text\"\n    }\n  ],\n  \"sidebar\": true\n}\n[/block]\n\n[block:parameters]\n{\n  \"data\": {\n    \"0-1\": \"Command to add segments for the current subscriber\",\n    \"0-0\": \"segements_add\",\n    \"1-0\": \"(remaining parameters)\",\n    \"1-1\": \"Segments to be added\",\n    \"h-0\": \"Parameters\",\n    \"h-1\": \"Description\"\n  },\n  \"cols\": 2,\n  \"rows\": 2\n}\n[/block]","category":"54ee3a043749bf0d00c76573","createdAt":"2015-02-27T21:39:57.957Z","excerpt":"","githubsync":"","hidden":false,"link_external":false,"link_url":"","order":7,"project":"54ed111fa45a441700fd4cf6","slug":"add-segments","sync_unique":"","title":"Add Segments","type":"basic","updates":[],"user":"54ed0ffea45a441700fd4cf0","version":"54ed1120a45a441700fd4cf9"}

Add Segments


Associate additional Segments with a subscriber with the **segments_add** command. Parameters are passed in an array. [block:html] { "html": "<div style=\"font-size: 14pt; font-weight: bold;\">\n _roost.push([\"segments_add\", &lt;first&gt;, &lt;second&gt;, ..., &lt;last&gt;])\n</div>" } [/block] [block:code] { "codes": [ { "code": "<!-- \"segments_add\" OPERATION WILL ASSOCIATE ADDITIONAL SEGMENTS WITH A SUBSCRIBER -->\n<script>\n var _roost = _roost || [];\n _roost.push([\"segments_add\", \"breakingnews\", \"politics\", \"sports\"]);\n</script>", "language": "text" } ], "sidebar": true } [/block] [block:parameters] { "data": { "0-1": "Command to add segments for the current subscriber", "0-0": "segements_add", "1-0": "(remaining parameters)", "1-1": "Segments to be added", "h-0": "Parameters", "h-1": "Description" }, "cols": 2, "rows": 2 } [/block]
Associate additional Segments with a subscriber with the **segments_add** command. Parameters are passed in an array. [block:html] { "html": "<div style=\"font-size: 14pt; font-weight: bold;\">\n _roost.push([\"segments_add\", &lt;first&gt;, &lt;second&gt;, ..., &lt;last&gt;])\n</div>" } [/block] [block:code] { "codes": [ { "code": "<!-- \"segments_add\" OPERATION WILL ASSOCIATE ADDITIONAL SEGMENTS WITH A SUBSCRIBER -->\n<script>\n var _roost = _roost || [];\n _roost.push([\"segments_add\", \"breakingnews\", \"politics\", \"sports\"]);\n</script>", "language": "text" } ], "sidebar": true } [/block] [block:parameters] { "data": { "0-1": "Command to add segments for the current subscriber", "0-0": "segements_add", "1-0": "(remaining parameters)", "1-1": "Segments to be added", "h-0": "Parameters", "h-1": "Description" }, "cols": 2, "rows": 2 } [/block]
{"__v":13,"_id":"54f0f48632242e0d00786135","api":{"auth":"required","params":[],"results":{"codes":[{"status":200,"language":"json","code":"{}","name":""},{"status":400,"language":"json","code":"{}","name":""}]},"url":""},"body":"Remove (disassociate) a set of Segments from a subscriber using the **segments_remove** command.  \n[block:html]\n{\n  \"html\": \"<div style=\\\"font-size: 14pt; font-weight: bold;\\\">\\n  _roost.push([\\\"segments_remove\\\", &lt;first&gt;, &lt;second&gt;, ..., &lt;last&gt;])\\n</div>\"\n}\n[/block]\n\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"Parameter\",\n    \"h-1\": \"Description\",\n    \"0-0\": \"segments_remove\",\n    \"0-1\": \"Specifies that the following parameters are segments to be disassociated with the subscriber.\",\n    \"1-0\": \"(remaining parameters)\",\n    \"1-1\": \"Segments to be removed.\"\n  },\n  \"cols\": 2,\n  \"rows\": 2\n}\n[/block]\n\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"<!-- DISASSOCIATES A LIST OF SEGMENTS FROM A SUBSCRIBER -->\\n<script>\\n    var _roost = _roost || [];\\n    _roost.push([\\\"segments_remove\\\", \\\"boringnews\\\"]);\\n</script>\",\n      \"language\": \"text\"\n    }\n  ],\n  \"sidebar\": true\n}\n[/block]","category":"54ee3a043749bf0d00c76573","createdAt":"2015-02-27T22:49:42.489Z","excerpt":"","githubsync":"","hidden":false,"link_external":false,"link_url":"","order":8,"project":"54ed111fa45a441700fd4cf6","slug":"remove-segments","sync_unique":"","title":"Remove Segments","type":"basic","updates":[],"user":"54ed0ffea45a441700fd4cf0","version":"54ed1120a45a441700fd4cf9"}

Remove Segments


Remove (disassociate) a set of Segments from a subscriber using the **segments_remove** command. [block:html] { "html": "<div style=\"font-size: 14pt; font-weight: bold;\">\n _roost.push([\"segments_remove\", &lt;first&gt;, &lt;second&gt;, ..., &lt;last&gt;])\n</div>" } [/block] [block:parameters] { "data": { "h-0": "Parameter", "h-1": "Description", "0-0": "segments_remove", "0-1": "Specifies that the following parameters are segments to be disassociated with the subscriber.", "1-0": "(remaining parameters)", "1-1": "Segments to be removed." }, "cols": 2, "rows": 2 } [/block] [block:code] { "codes": [ { "code": "<!-- DISASSOCIATES A LIST OF SEGMENTS FROM A SUBSCRIBER -->\n<script>\n var _roost = _roost || [];\n _roost.push([\"segments_remove\", \"boringnews\"]);\n</script>", "language": "text" } ], "sidebar": true } [/block]
Remove (disassociate) a set of Segments from a subscriber using the **segments_remove** command. [block:html] { "html": "<div style=\"font-size: 14pt; font-weight: bold;\">\n _roost.push([\"segments_remove\", &lt;first&gt;, &lt;second&gt;, ..., &lt;last&gt;])\n</div>" } [/block] [block:parameters] { "data": { "h-0": "Parameter", "h-1": "Description", "0-0": "segments_remove", "0-1": "Specifies that the following parameters are segments to be disassociated with the subscriber.", "1-0": "(remaining parameters)", "1-1": "Segments to be removed." }, "cols": 2, "rows": 2 } [/block] [block:code] { "codes": [ { "code": "<!-- DISASSOCIATES A LIST OF SEGMENTS FROM A SUBSCRIBER -->\n<script>\n var _roost = _roost || [];\n _roost.push([\"segments_remove\", \"boringnews\"]);\n</script>", "language": "text" } ], "sidebar": true } [/block]
{"__v":7,"_id":"54ee42c08dbdb40d0018fa55","api":{"auth":"required","params":[],"results":{"codes":[{"status":200,"language":"json","code":"{}","name":""},{"status":400,"language":"json","code":"{}","name":""}]},"url":""},"body":"The Roost REST APIs are very easy to use, and you will only need two things to get started:\n  * Your **Roost API Keys**, which are located on the Roost dashboard under **Settings->API Keys**.  You will need both the **API Key** and **API Secret.**\n  * A terminal where you can make **curl** calls. \n\nYou can call Roost REST services from other languages and environments.  We provide some examples alongside the curl examples for each feature.  Wrappers are also in the works for several languages.\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Configuration\"\n}\n[/block]\nRoost API Keys are associated with a particular configuration - not your entire Roost account.\n\nA Roost account may contain several **configurations**.  Typically each configuration is associate with a **particular website**.  Each configuration has a unique logo, title, and subscriber list.  Roost REST Calls are all authenticated and applicable to a particular configuration.\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"JSON\"\n}\n[/block]\nRoost REST calls all use **[JSON](http://en.wikipedia.org/wiki/JSON)** to pass parameters and data to the Roost servers.  \n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Response Code\"\n}\n[/block]\nA JSON structure is returned for each call. \n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"// REST RESPONSE EXAMPLE: SUCCESS\\n{\\n    \\\"success\\\" : true\\n}\",\n      \"language\": \"text\"\n    }\n  ],\n  \"sidebar\": true\n}\n[/block]\n\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"// REST RESPONSE EXAMPLE: FAILURE\\n\\n{\\n    \\\"success\\\" : false,\\n    \\\"error\\\" : \\\"Missing required attribute: alert\\\",\\n    \\\"code\\\" : 1\\n}\",\n      \"language\": \"text\"\n    }\n  ],\n  \"sidebar\": true\n}\n[/block]\nResponse can contain three value: **success**, **error**, and **code**.\n\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"Value\",\n    \"h-1\": \"Type\",\n    \"0-0\": \"success\",\n    \"0-1\": \"boolean\",\n    \"h-2\": \"Description\",\n    \"0-2\": \"'True' indicates the call was successful\",\n    \"1-0\": \"error\",\n    \"1-1\": \"string\",\n    \"1-2\": \"Textual explanation of the error\",\n    \"2-0\": \"code\",\n    \"2-1\": \"integer\",\n    \"2-2\": \"Error code unique to each REST call.  Specific error codes are listed with each call.\"\n  },\n  \"cols\": 3,\n  \"rows\": 3\n}\n[/block]\nSUCCESS: If **success** is true, the call succeeded, and the other values will not be present.\n\nFAILURE: **Success** will be false, error and code may be present.  The values of **error** and **code** will vary depending on the specific call.","category":"54ee4218236c1d0d0028f499","createdAt":"2015-02-25T21:46:40.563Z","excerpt":"","githubsync":"","hidden":false,"link_external":false,"link_url":"","order":0,"project":"54ed111fa45a441700fd4cf6","slug":"rest-api-basics","sync_unique":"","title":"Getting Started","type":"basic","updates":[],"user":"54ed0ffea45a441700fd4cf0","version":"54ed1120a45a441700fd4cf9"}

Getting Started


The Roost REST APIs are very easy to use, and you will only need two things to get started: * Your **Roost API Keys**, which are located on the Roost dashboard under **Settings->API Keys**. You will need both the **API Key** and **API Secret.** * A terminal where you can make **curl** calls. You can call Roost REST services from other languages and environments. We provide some examples alongside the curl examples for each feature. Wrappers are also in the works for several languages. [block:api-header] { "type": "basic", "title": "Configuration" } [/block] Roost API Keys are associated with a particular configuration - not your entire Roost account. A Roost account may contain several **configurations**. Typically each configuration is associate with a **particular website**. Each configuration has a unique logo, title, and subscriber list. Roost REST Calls are all authenticated and applicable to a particular configuration. [block:api-header] { "type": "basic", "title": "JSON" } [/block] Roost REST calls all use **[JSON](http://en.wikipedia.org/wiki/JSON)** to pass parameters and data to the Roost servers. [block:api-header] { "type": "basic", "title": "Response Code" } [/block] A JSON structure is returned for each call. [block:code] { "codes": [ { "code": "// REST RESPONSE EXAMPLE: SUCCESS\n{\n \"success\" : true\n}", "language": "text" } ], "sidebar": true } [/block] [block:code] { "codes": [ { "code": "// REST RESPONSE EXAMPLE: FAILURE\n\n{\n \"success\" : false,\n \"error\" : \"Missing required attribute: alert\",\n \"code\" : 1\n}", "language": "text" } ], "sidebar": true } [/block] Response can contain three value: **success**, **error**, and **code**. [block:parameters] { "data": { "h-0": "Value", "h-1": "Type", "0-0": "success", "0-1": "boolean", "h-2": "Description", "0-2": "'True' indicates the call was successful", "1-0": "error", "1-1": "string", "1-2": "Textual explanation of the error", "2-0": "code", "2-1": "integer", "2-2": "Error code unique to each REST call. Specific error codes are listed with each call." }, "cols": 3, "rows": 3 } [/block] SUCCESS: If **success** is true, the call succeeded, and the other values will not be present. FAILURE: **Success** will be false, error and code may be present. The values of **error** and **code** will vary depending on the specific call.
The Roost REST APIs are very easy to use, and you will only need two things to get started: * Your **Roost API Keys**, which are located on the Roost dashboard under **Settings->API Keys**. You will need both the **API Key** and **API Secret.** * A terminal where you can make **curl** calls. You can call Roost REST services from other languages and environments. We provide some examples alongside the curl examples for each feature. Wrappers are also in the works for several languages. [block:api-header] { "type": "basic", "title": "Configuration" } [/block] Roost API Keys are associated with a particular configuration - not your entire Roost account. A Roost account may contain several **configurations**. Typically each configuration is associate with a **particular website**. Each configuration has a unique logo, title, and subscriber list. Roost REST Calls are all authenticated and applicable to a particular configuration. [block:api-header] { "type": "basic", "title": "JSON" } [/block] Roost REST calls all use **[JSON](http://en.wikipedia.org/wiki/JSON)** to pass parameters and data to the Roost servers. [block:api-header] { "type": "basic", "title": "Response Code" } [/block] A JSON structure is returned for each call. [block:code] { "codes": [ { "code": "// REST RESPONSE EXAMPLE: SUCCESS\n{\n \"success\" : true\n}", "language": "text" } ], "sidebar": true } [/block] [block:code] { "codes": [ { "code": "// REST RESPONSE EXAMPLE: FAILURE\n\n{\n \"success\" : false,\n \"error\" : \"Missing required attribute: alert\",\n \"code\" : 1\n}", "language": "text" } ], "sidebar": true } [/block] Response can contain three value: **success**, **error**, and **code**. [block:parameters] { "data": { "h-0": "Value", "h-1": "Type", "0-0": "success", "0-1": "boolean", "h-2": "Description", "0-2": "'True' indicates the call was successful", "1-0": "error", "1-1": "string", "1-2": "Textual explanation of the error", "2-0": "code", "2-1": "integer", "2-2": "Error code unique to each REST call. Specific error codes are listed with each call." }, "cols": 3, "rows": 3 } [/block] SUCCESS: If **success** is true, the call succeeded, and the other values will not be present. FAILURE: **Success** will be false, error and code may be present. The values of **error** and **code** will vary depending on the specific call.
{"__v":19,"_id":"54ee42daa3811c0d00a154ed","api":{"auth":"required","params":[],"results":{"codes":[{"status":200,"language":"json","code":"{}","name":""},{"status":400,"language":"json","code":"{}","name":""}]},"url":""},"body":"You are probably ready to send a push!  Let's try out the most basic type of push.\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"curl -X POST -u \\\"[api key]:[api secret]\\\" \\\\\\n  -H \\\"Content-Type: application/json\\\" \\\\\\n  --data '{\\\"alert\\\":\\\"I am Testing the Roost API\\\", \\\"url\\\":\\\"[Target Web Page]\\\"}' \\\\\\n  https://api.goroost.com/api/push \\n\",\n      \"language\": \"text\"\n    }\n  ],\n  \"sidebar\": true\n}\n[/block]\nThe example code on the right shows a push with the minimum required data, a title and url.  We'll need to replace three values to make the code work for you.\n[block:html]\n{\n  \"html\": \"<div>\\n  <ol style=\\\"font-size: 12pt;\\\">\\n    <li>Replace the <b>[API Key]</b>, <b>[Secret Key]</b> with the values for the Roost configuration you are using.  You can find these on the <b>Roost dashboard: Settings->API Keys</b>.<br/><br/></li>\\n    <li>Replace <b>[Target Web Page]</b> with a url where you want the recpient of the push to go when they click on the notification.<br/><br/></li>\\n    <li>Paste the whole thing into a terminal.  <em>The square brackets are delimiters for the replacement values, and should NOT appear in the code you execute)</em></li>\\n  </ol>\\n</div>\"\n}\n[/block]\nYou should receive a push in a few seconds!\n\nTo see all the ways you can send a push, continue to the [REST-Push](doc:specification) section of these docs.","category":"54ee4218236c1d0d0028f499","createdAt":"2015-02-25T21:47:06.559Z","excerpt":"","githubsync":"","hidden":false,"link_external":false,"link_url":"","order":1,"project":"54ed111fa45a441700fd4cf6","slug":"rest-api-quickstart","sync_unique":"","title":"Sending Your First Push","type":"basic","updates":[],"user":"54ed0ffea45a441700fd4cf0","version":"54ed1120a45a441700fd4cf9"}

Sending Your First Push


You are probably ready to send a push! Let's try out the most basic type of push. [block:code] { "codes": [ { "code": "curl -X POST -u \"[api key]:[api secret]\" \\\n -H \"Content-Type: application/json\" \\\n --data '{\"alert\":\"I am Testing the Roost API\", \"url\":\"[Target Web Page]\"}' \\\n https://api.goroost.com/api/push \n", "language": "text" } ], "sidebar": true } [/block] The example code on the right shows a push with the minimum required data, a title and url. We'll need to replace three values to make the code work for you. [block:html] { "html": "<div>\n <ol style=\"font-size: 12pt;\">\n <li>Replace the <b>[API Key]</b>, <b>[Secret Key]</b> with the values for the Roost configuration you are using. You can find these on the <b>Roost dashboard: Settings->API Keys</b>.<br/><br/></li>\n <li>Replace <b>[Target Web Page]</b> with a url where you want the recpient of the push to go when they click on the notification.<br/><br/></li>\n <li>Paste the whole thing into a terminal. <em>The square brackets are delimiters for the replacement values, and should NOT appear in the code you execute)</em></li>\n </ol>\n</div>" } [/block] You should receive a push in a few seconds! To see all the ways you can send a push, continue to the [REST-Push](doc:specification) section of these docs.
You are probably ready to send a push! Let's try out the most basic type of push. [block:code] { "codes": [ { "code": "curl -X POST -u \"[api key]:[api secret]\" \\\n -H \"Content-Type: application/json\" \\\n --data '{\"alert\":\"I am Testing the Roost API\", \"url\":\"[Target Web Page]\"}' \\\n https://api.goroost.com/api/push \n", "language": "text" } ], "sidebar": true } [/block] The example code on the right shows a push with the minimum required data, a title and url. We'll need to replace three values to make the code work for you. [block:html] { "html": "<div>\n <ol style=\"font-size: 12pt;\">\n <li>Replace the <b>[API Key]</b>, <b>[Secret Key]</b> with the values for the Roost configuration you are using. You can find these on the <b>Roost dashboard: Settings->API Keys</b>.<br/><br/></li>\n <li>Replace <b>[Target Web Page]</b> with a url where you want the recpient of the push to go when they click on the notification.<br/><br/></li>\n <li>Paste the whole thing into a terminal. <em>The square brackets are delimiters for the replacement values, and should NOT appear in the code you execute)</em></li>\n </ol>\n</div>" } [/block] You should receive a push in a few seconds! To see all the ways you can send a push, continue to the [REST-Push](doc:specification) section of these docs.
{"__v":7,"_id":"54ee428525f3ca0d007867e4","api":{"auth":"required","params":[],"results":{"codes":[{"status":200,"language":"json","code":"{}","name":""},{"status":400,"language":"json","code":"{}","name":""}]},"url":""},"body":"[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Authenticating to the JSON API\"\n}\n[/block]\nThese are the instructions for connecting to authenticated methods in the Roost JSON API.\nAll APIs use HTTP basic-auth with the **API Key** as the username and the **API Secret Key** as the password.\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Keys\"\n}\n[/block]\nThere are two keys automatically assigned to **each configuration** in Roost. Both keys can be accessed on the properties page of the configuration.\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"Key\",\n    \"h-1\": \"Description\",\n    \"0-0\": \"API Key\",\n    \"0-1\": \"The API key can be thought of as the username for a particular configuration. It’s perfectly OK to share this with people, and is used primarily during registration.\\nUse this as the username for HTTP basic-auth.\",\n    \"1-0\": \"API Secret Key\",\n    \"1-1\": \"The secret key can be thought of as the password for a particular configuration. It is used to access API methods that your users are not allowed to access. Do not share it with anyone.\\nUse this as the password for HTTP basic-auth.\"\n  },\n  \"cols\": 2,\n  \"rows\": 2\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Logging In - HTTP Basic Auth\"\n}\n[/block]\nAPI calls that require authentication will require these two keys be used as **HTTP Basic Auth** in the request as the **username / password.**\n\nMake sure you base-64 encode the value if required by your HTTP client.\nEach type of client is different, here’s an example with the command line tool curl:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"curl -X POST -u \\\"[api key]:[api secret]\\\" \\\\\\n  -H \\\"Content-Type: application/json\\\" \\\\\\n  --data '[json payload]' \\\\\\n  https://api.goroost.com/api/[specific api call] \",\n      \"language\": \"text\"\n    }\n  ]\n}\n[/block]\nReplace **[api key]** and **[api secret]** (including the square brackets) with the values from your configuration page and change the URL and json payload to match the call being made.","category":"54ee4218236c1d0d0028f499","createdAt":"2015-02-25T21:45:41.229Z","excerpt":"","githubsync":"","hidden":false,"link_external":false,"link_url":"","order":2,"project":"54ed111fa45a441700fd4cf6","slug":"authentication","sync_unique":"","title":"Authentication","type":"basic","updates":[],"user":"54ed0ffea45a441700fd4cf0","version":"54ed1120a45a441700fd4cf9"}

Authentication


[block:api-header] { "type": "basic", "title": "Authenticating to the JSON API" } [/block] These are the instructions for connecting to authenticated methods in the Roost JSON API. All APIs use HTTP basic-auth with the **API Key** as the username and the **API Secret Key** as the password. [block:api-header] { "type": "basic", "title": "Keys" } [/block] There are two keys automatically assigned to **each configuration** in Roost. Both keys can be accessed on the properties page of the configuration. [block:parameters] { "data": { "h-0": "Key", "h-1": "Description", "0-0": "API Key", "0-1": "The API key can be thought of as the username for a particular configuration. It’s perfectly OK to share this with people, and is used primarily during registration.\nUse this as the username for HTTP basic-auth.", "1-0": "API Secret Key", "1-1": "The secret key can be thought of as the password for a particular configuration. It is used to access API methods that your users are not allowed to access. Do not share it with anyone.\nUse this as the password for HTTP basic-auth." }, "cols": 2, "rows": 2 } [/block] [block:api-header] { "type": "basic", "title": "Logging In - HTTP Basic Auth" } [/block] API calls that require authentication will require these two keys be used as **HTTP Basic Auth** in the request as the **username / password.** Make sure you base-64 encode the value if required by your HTTP client. Each type of client is different, here’s an example with the command line tool curl: [block:code] { "codes": [ { "code": "curl -X POST -u \"[api key]:[api secret]\" \\\n -H \"Content-Type: application/json\" \\\n --data '[json payload]' \\\n https://api.goroost.com/api/[specific api call] ", "language": "text" } ] } [/block] Replace **[api key]** and **[api secret]** (including the square brackets) with the values from your configuration page and change the URL and json payload to match the call being made.
[block:api-header] { "type": "basic", "title": "Authenticating to the JSON API" } [/block] These are the instructions for connecting to authenticated methods in the Roost JSON API. All APIs use HTTP basic-auth with the **API Key** as the username and the **API Secret Key** as the password. [block:api-header] { "type": "basic", "title": "Keys" } [/block] There are two keys automatically assigned to **each configuration** in Roost. Both keys can be accessed on the properties page of the configuration. [block:parameters] { "data": { "h-0": "Key", "h-1": "Description", "0-0": "API Key", "0-1": "The API key can be thought of as the username for a particular configuration. It’s perfectly OK to share this with people, and is used primarily during registration.\nUse this as the username for HTTP basic-auth.", "1-0": "API Secret Key", "1-1": "The secret key can be thought of as the password for a particular configuration. It is used to access API methods that your users are not allowed to access. Do not share it with anyone.\nUse this as the password for HTTP basic-auth." }, "cols": 2, "rows": 2 } [/block] [block:api-header] { "type": "basic", "title": "Logging In - HTTP Basic Auth" } [/block] API calls that require authentication will require these two keys be used as **HTTP Basic Auth** in the request as the **username / password.** Make sure you base-64 encode the value if required by your HTTP client. Each type of client is different, here’s an example with the command line tool curl: [block:code] { "codes": [ { "code": "curl -X POST -u \"[api key]:[api secret]\" \\\n -H \"Content-Type: application/json\" \\\n --data '[json payload]' \\\n https://api.goroost.com/api/[specific api call] ", "language": "text" } ] } [/block] Replace **[api key]** and **[api secret]** (including the square brackets) with the values from your configuration page and change the URL and json payload to match the call being made.
{"__v":1,"_id":"54ee40ff76ced60d00b0a043","api":{"auth":"required","params":[{"_id":"54ee5252c622200d00ac0a17","required":false,"desc":"first param","default":"","type":"string","name":"one"},{"_id":"54ee5252c622200d00ac0a16","required":false,"desc":"second param","default":"","type":"string","name":"two"}],"results":{"codes":[{"status":200,"language":"json","code":"{}","name":""},{"status":400,"language":"json","code":"{}","name":""}]},"url":"/push"},"body":"[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"API Call Limit\"\n}\n[/block]\nRoost API users may call the Roost REST APIs as often as needed. To preserve system performance, a limit of **25 REST calls per second** will be enforced for each Roost account. API usage will be unaffected for the vast majority of Roost users – who are protected by this approach.\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Handling the Limit in Your Code\"\n}\n[/block]\nFor those who exceed the 25 call/second limit, subsequent calls will receive a **429 response code**. Roost recommends an exponential backoff approach for pausing and resuming massive groups of API calls that hit the limit. Google explains this method pretty well here.","category":"54ee4218236c1d0d0028f499","createdAt":"2015-02-25T21:39:11.767Z","excerpt":"","githubsync":"","hidden":false,"link_external":false,"link_url":"","order":3,"project":"54ed111fa45a441700fd4cf6","slug":"quick-start-sending-push-notifications","sync_unique":"","title":"Throttling","type":"basic","updates":[],"user":"54ed0ffea45a441700fd4cf0","version":"54ed1120a45a441700fd4cf9"}

Throttling


[block:api-header] { "type": "basic", "title": "API Call Limit" } [/block] Roost API users may call the Roost REST APIs as often as needed. To preserve system performance, a limit of **25 REST calls per second** will be enforced for each Roost account. API usage will be unaffected for the vast majority of Roost users – who are protected by this approach. [block:api-header] { "type": "basic", "title": "Handling the Limit in Your Code" } [/block] For those who exceed the 25 call/second limit, subsequent calls will receive a **429 response code**. Roost recommends an exponential backoff approach for pausing and resuming massive groups of API calls that hit the limit. Google explains this method pretty well here.
[block:api-header] { "type": "basic", "title": "API Call Limit" } [/block] Roost API users may call the Roost REST APIs as often as needed. To preserve system performance, a limit of **25 REST calls per second** will be enforced for each Roost account. API usage will be unaffected for the vast majority of Roost users – who are protected by this approach. [block:api-header] { "type": "basic", "title": "Handling the Limit in Your Code" } [/block] For those who exceed the 25 call/second limit, subsequent calls will receive a **429 response code**. Roost recommends an exponential backoff approach for pausing and resuming massive groups of API calls that hit the limit. Google explains this method pretty well here.
{"__v":12,"_id":"54ef129f5bf74a0d00ef40b3","api":{"auth":"required","params":[],"results":{"codes":[{"status":200,"language":"json","code":"{}","name":""},{"status":400,"language":"json","code":"{}","name":""}]},"url":""},"body":"[block:html]\n{\n  \"html\": \"<div style=\\\"font-size:12pt;\\\">\\n            Use the Roost <b>push</b> call to send push notifications to Roost subscribers for a particular configuration.\\n</div>\\n\"\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"CALL\"\n}\n[/block]\n\n[block:parameters]\n{\n  \"data\": {\n    \"0-0\": \"URL\",\n    \"0-1\": \"https://api.goroost.com/api/push\",\n    \"1-0\": \"HTTP Auth\",\n    \"1-1\": \"YES [(see Authentication)](doc:authentication)\"\n  },\n  \"cols\": 2,\n  \"rows\": 2\n}\n[/block]\nThe Roost **push** method requires an HTTP POST request with JSON in the body and “application/json” as the Content-Type.\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"JSON Arguments\"\n}\n[/block]\nREQUIRED ARGUMENTS\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"Key Name\",\n    \"h-1\": \"Description\",\n    \"h-2\": \"Required\",\n    \"0-0\": \"alert\",\n    \"0-1\": \"Title of the alert.  Will be displayed when the alert is received by the subscriber.\",\n    \"1-0\": \"url\",\n    \"1-1\": \"Target url to be associated with the notification.  The user\"\n  },\n  \"cols\": 2,\n  \"rows\": 2\n}\n[/block]\nOPTIONAL ARGUMENTS\n[block:parameters]\n{\n  \"data\": {\n    \"0-0\": \"segments\",\n    \"1-0\": \"aliases\",\n    \"2-0\": \"device_tokens\",\n    \"3-0\": \"exclude_tokens\",\n    \"4-0\": \"test_type\",\n    \"5-0\": \"schedule_for\",\n    \"h-0\": \"Key Name\",\n    \"h-1\": \"Description\",\n    \"h-2\": \"\",\n    \"0-1\": \"List of Segments.  If included, notification will be sent **only** to subscribers associated with one or more of the listed Segments.\",\n    \"1-1\": \"List of user [Aliases](doc:segmenting-individuals-alias).  If included, notification will be sent **only** to subscribers listed.\",\n    \"2-1\": \"List of device tokens on which users registered.  If included, notification will be sent **only** to devices listed.\",\n    \"3-1\": \"List of device tokens.  If included, devices listed will be excluded when the notification is sent.\",\n    \"4-1\": \"Specifies that progressive A/B split-testing will be done to optimize delivery.  If included, value must be: \\\"MULTI_ARM_BANDIT\\\".   In this case, **alert** must also be specified as an array with a list of alternate titles (EX: [\\\"A Notification Title\\\", \\\"Alternate Title\\\", \\\"Third Title\\\"]).\",\n    \"5-1\": \"Time when the notification will be scheduled for delivery.  Format: \\\"YYYY-MM-DDTHH:MM:SSZ\\\".  Time is specified in Zulu/GMT.\\n\\nExample: \\n\\\"2015-06-20T08:00:00Z\\\"\"\n  },\n  \"cols\": 2,\n  \"rows\": 6\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Bulk Push API\"\n}\n[/block]\nThis API can be called in bulk by making an arrays of the JSON structures listed above.\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Supplemental Documentation\"\n}\n[/block]\n[API Keys and authentication](doc:authentication)\nBulk version of this API","category":"54ef128c6ce8d81900c1c340","createdAt":"2015-02-26T12:33:35.687Z","excerpt":"","githubsync":"","hidden":false,"link_external":false,"link_url":"","order":0,"project":"54ed111fa45a441700fd4cf6","slug":"specification","sync_unique":"","title":"Specification","type":"basic","updates":[],"user":"54ed0ffea45a441700fd4cf0","version":"54ed1120a45a441700fd4cf9"}

Specification


[block:html] { "html": "<div style=\"font-size:12pt;\">\n Use the Roost <b>push</b> call to send push notifications to Roost subscribers for a particular configuration.\n</div>\n" } [/block] [block:api-header] { "type": "basic", "title": "CALL" } [/block] [block:parameters] { "data": { "0-0": "URL", "0-1": "https://api.goroost.com/api/push", "1-0": "HTTP Auth", "1-1": "YES [(see Authentication)](doc:authentication)" }, "cols": 2, "rows": 2 } [/block] The Roost **push** method requires an HTTP POST request with JSON in the body and “application/json” as the Content-Type. [block:api-header] { "type": "basic", "title": "JSON Arguments" } [/block] REQUIRED ARGUMENTS [block:parameters] { "data": { "h-0": "Key Name", "h-1": "Description", "h-2": "Required", "0-0": "alert", "0-1": "Title of the alert. Will be displayed when the alert is received by the subscriber.", "1-0": "url", "1-1": "Target url to be associated with the notification. The user" }, "cols": 2, "rows": 2 } [/block] OPTIONAL ARGUMENTS [block:parameters] { "data": { "0-0": "segments", "1-0": "aliases", "2-0": "device_tokens", "3-0": "exclude_tokens", "4-0": "test_type", "5-0": "schedule_for", "h-0": "Key Name", "h-1": "Description", "h-2": "", "0-1": "List of Segments. If included, notification will be sent **only** to subscribers associated with one or more of the listed Segments.", "1-1": "List of user [Aliases](doc:segmenting-individuals-alias). If included, notification will be sent **only** to subscribers listed.", "2-1": "List of device tokens on which users registered. If included, notification will be sent **only** to devices listed.", "3-1": "List of device tokens. If included, devices listed will be excluded when the notification is sent.", "4-1": "Specifies that progressive A/B split-testing will be done to optimize delivery. If included, value must be: \"MULTI_ARM_BANDIT\". In this case, **alert** must also be specified as an array with a list of alternate titles (EX: [\"A Notification Title\", \"Alternate Title\", \"Third Title\"]).", "5-1": "Time when the notification will be scheduled for delivery. Format: \"YYYY-MM-DDTHH:MM:SSZ\". Time is specified in Zulu/GMT.\n\nExample: \n\"2015-06-20T08:00:00Z\"" }, "cols": 2, "rows": 6 } [/block] [block:api-header] { "type": "basic", "title": "Bulk Push API" } [/block] This API can be called in bulk by making an arrays of the JSON structures listed above. [block:api-header] { "type": "basic", "title": "Supplemental Documentation" } [/block] [API Keys and authentication](doc:authentication) Bulk version of this API
[block:html] { "html": "<div style=\"font-size:12pt;\">\n Use the Roost <b>push</b> call to send push notifications to Roost subscribers for a particular configuration.\n</div>\n" } [/block] [block:api-header] { "type": "basic", "title": "CALL" } [/block] [block:parameters] { "data": { "0-0": "URL", "0-1": "https://api.goroost.com/api/push", "1-0": "HTTP Auth", "1-1": "YES [(see Authentication)](doc:authentication)" }, "cols": 2, "rows": 2 } [/block] The Roost **push** method requires an HTTP POST request with JSON in the body and “application/json” as the Content-Type. [block:api-header] { "type": "basic", "title": "JSON Arguments" } [/block] REQUIRED ARGUMENTS [block:parameters] { "data": { "h-0": "Key Name", "h-1": "Description", "h-2": "Required", "0-0": "alert", "0-1": "Title of the alert. Will be displayed when the alert is received by the subscriber.", "1-0": "url", "1-1": "Target url to be associated with the notification. The user" }, "cols": 2, "rows": 2 } [/block] OPTIONAL ARGUMENTS [block:parameters] { "data": { "0-0": "segments", "1-0": "aliases", "2-0": "device_tokens", "3-0": "exclude_tokens", "4-0": "test_type", "5-0": "schedule_for", "h-0": "Key Name", "h-1": "Description", "h-2": "", "0-1": "List of Segments. If included, notification will be sent **only** to subscribers associated with one or more of the listed Segments.", "1-1": "List of user [Aliases](doc:segmenting-individuals-alias). If included, notification will be sent **only** to subscribers listed.", "2-1": "List of device tokens on which users registered. If included, notification will be sent **only** to devices listed.", "3-1": "List of device tokens. If included, devices listed will be excluded when the notification is sent.", "4-1": "Specifies that progressive A/B split-testing will be done to optimize delivery. If included, value must be: \"MULTI_ARM_BANDIT\". In this case, **alert** must also be specified as an array with a list of alternate titles (EX: [\"A Notification Title\", \"Alternate Title\", \"Third Title\"]).", "5-1": "Time when the notification will be scheduled for delivery. Format: \"YYYY-MM-DDTHH:MM:SSZ\". Time is specified in Zulu/GMT.\n\nExample: \n\"2015-06-20T08:00:00Z\"" }, "cols": 2, "rows": 6 } [/block] [block:api-header] { "type": "basic", "title": "Bulk Push API" } [/block] This API can be called in bulk by making an arrays of the JSON structures listed above. [block:api-header] { "type": "basic", "title": "Supplemental Documentation" } [/block] [API Keys and authentication](doc:authentication) Bulk version of this API
{"__v":9,"_id":"54ef12af6ce8d81900c1c341","api":{"auth":"required","params":[],"results":{"codes":[{"status":200,"language":"json","code":"{}","name":""},{"status":400,"language":"json","code":"{}","name":""}]},"url":""},"body":"The most basic push notification requires an **alert** title and a target **url**.   \n[block:parameters]\n{\n  \"data\": {\n    \"0-0\": \"alert\",\n    \"1-0\": \"url\",\n    \"h-0\": \"Key Name\",\n    \"h-1\": \"Description\",\n    \"0-1\": \"Title of the alert.  Will be displayed when the alert is received by the subscriber.\",\n    \"1-1\": \"Target url to be associated with the notification.  The user\"\n  },\n  \"cols\": 2,\n  \"rows\": 2\n}\n[/block]\n\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"{\\n    \\\"alert\\\" : \\\"A Notification Title\\\",\\n    \\\"url\\\" : \\\"http://some-target-url\\\"\\n}\\n\",\n      \"language\": \"json\"\n    }\n  ]\n}\n[/block]\n\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"curl -X POST -u \\\"[api key]:[api secret]\\\" \\\\\\n  -H \\\"Content-Type: application/json\\\" \\\\\\n  --data '{\\\"alert\\\":\\\"A Notification Title\\\", \\\"url\\\":\\\"http://some-target-url\\\"}' \\\\\\n  https://api.goroost.com/api/push \\n\",\n      \"language\": \"shell\"\n    }\n  ],\n  \"sidebar\": true\n}\n[/block]\n**Try the example on the right. ** Use your own **[API Key]** and **[API Secret]**, and replace the **alert** and **url** fields with appropriate values.","category":"54ef128c6ce8d81900c1c340","createdAt":"2015-02-26T12:33:51.733Z","excerpt":"","githubsync":"","hidden":false,"link_external":false,"link_url":"","order":1,"project":"54ed111fa45a441700fd4cf6","slug":"basic-push","sync_unique":"","title":"Basic Push","type":"basic","updates":[],"user":"54ed0ffea45a441700fd4cf0","version":"54ed1120a45a441700fd4cf9"}

Basic Push


The most basic push notification requires an **alert** title and a target **url**. [block:parameters] { "data": { "0-0": "alert", "1-0": "url", "h-0": "Key Name", "h-1": "Description", "0-1": "Title of the alert. Will be displayed when the alert is received by the subscriber.", "1-1": "Target url to be associated with the notification. The user" }, "cols": 2, "rows": 2 } [/block] [block:code] { "codes": [ { "code": "{\n \"alert\" : \"A Notification Title\",\n \"url\" : \"http://some-target-url\"\n}\n", "language": "json" } ] } [/block] [block:code] { "codes": [ { "code": "curl -X POST -u \"[api key]:[api secret]\" \\\n -H \"Content-Type: application/json\" \\\n --data '{\"alert\":\"A Notification Title\", \"url\":\"http://some-target-url\"}' \\\n https://api.goroost.com/api/push \n", "language": "shell" } ], "sidebar": true } [/block] **Try the example on the right. ** Use your own **[API Key]** and **[API Secret]**, and replace the **alert** and **url** fields with appropriate values.
The most basic push notification requires an **alert** title and a target **url**. [block:parameters] { "data": { "0-0": "alert", "1-0": "url", "h-0": "Key Name", "h-1": "Description", "0-1": "Title of the alert. Will be displayed when the alert is received by the subscriber.", "1-1": "Target url to be associated with the notification. The user" }, "cols": 2, "rows": 2 } [/block] [block:code] { "codes": [ { "code": "{\n \"alert\" : \"A Notification Title\",\n \"url\" : \"http://some-target-url\"\n}\n", "language": "json" } ] } [/block] [block:code] { "codes": [ { "code": "curl -X POST -u \"[api key]:[api secret]\" \\\n -H \"Content-Type: application/json\" \\\n --data '{\"alert\":\"A Notification Title\", \"url\":\"http://some-target-url\"}' \\\n https://api.goroost.com/api/push \n", "language": "shell" } ], "sidebar": true } [/block] **Try the example on the right. ** Use your own **[API Key]** and **[API Secret]**, and replace the **alert** and **url** fields with appropriate values.
{"__v":6,"_id":"54f4ab1486a4e40d0037575e","api":{"auth":"required","params":[],"results":{"codes":[{"status":200,"language":"json","code":"{}","name":""},{"status":400,"language":"json","code":"{}","name":""}]},"url":""},"body":"Push with a list of [Segments](doc:segmenting-users) if you want to send notifications only to subscribers associated a Segment on the list.\n[block:parameters]\n{\n  \"data\": {\n    \"0-0\": \"alert\",\n    \"1-0\": \"url\",\n    \"h-0\": \"Key Name\",\n    \"h-1\": \"Description\",\n    \"0-1\": \"Title of the alert.  Will be displayed when the alert is received by the subscriber.\",\n    \"1-1\": \"Target url to be associated with the notification.  The user\",\n    \"2-0\": \"segments\",\n    \"2-1\": \"A list of segments.  Only subscribers who are associated with one or more of the listed Segments will receive the notification.\"\n  },\n  \"cols\": 2,\n  \"rows\": 3\n}\n[/block]\n\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"{\\n    \\\"alert\\\" : \\\"A Notification Title\\\",\\n    \\\"url\\\" : \\\"http://some-target-url\\\",\\n    \\\"segments\\\" : [\\\"Celebrity\\\", \\\"Music\\\", \\\"Pop\\\"]\\n}\\n\",\n      \"language\": \"json\"\n    }\n  ]\n}\n[/block]\n\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"curl -X POST -u \\\"[api key]:[api secret]\\\" \\\\\\n  -H \\\"Content-Type: application/json\\\" \\\\\\n  --data '{\\\"alert\\\":\\\"A Notification Title\\\", \\\\\\n  \\\"url\\\":\\\"http://some-target-url\\\", \\\\\\n  \\\"segments\\\" : [\\\"Celebrity\\\", \\\"Music\\\", \\\"Pop\\\"]}' \\\\\\n  https://api.goroost.com/api/push \\n\",\n      \"language\": \"shell\"\n    }\n  ],\n  \"sidebar\": true\n}\n[/block]\n**Try the example on the right. ** Use your own **[API Key]** and **[API Secret]**, and replace the **alert**, **url**, and **segments** fields with appropriate values.","category":"54ef128c6ce8d81900c1c340","createdAt":"2015-03-02T18:25:24.116Z","excerpt":"","githubsync":"","hidden":false,"link_external":false,"link_url":"","order":2,"project":"54ed111fa45a441700fd4cf6","slug":"push-to-tag-1","sync_unique":"","title":"Push To Segment","type":"basic","updates":[],"user":"54ed0ffea45a441700fd4cf0","version":"54ed1120a45a441700fd4cf9"}

Push To Segment


Push with a list of [Segments](doc:segmenting-users) if you want to send notifications only to subscribers associated a Segment on the list. [block:parameters] { "data": { "0-0": "alert", "1-0": "url", "h-0": "Key Name", "h-1": "Description", "0-1": "Title of the alert. Will be displayed when the alert is received by the subscriber.", "1-1": "Target url to be associated with the notification. The user", "2-0": "segments", "2-1": "A list of segments. Only subscribers who are associated with one or more of the listed Segments will receive the notification." }, "cols": 2, "rows": 3 } [/block] [block:code] { "codes": [ { "code": "{\n \"alert\" : \"A Notification Title\",\n \"url\" : \"http://some-target-url\",\n \"segments\" : [\"Celebrity\", \"Music\", \"Pop\"]\n}\n", "language": "json" } ] } [/block] [block:code] { "codes": [ { "code": "curl -X POST -u \"[api key]:[api secret]\" \\\n -H \"Content-Type: application/json\" \\\n --data '{\"alert\":\"A Notification Title\", \\\n \"url\":\"http://some-target-url\", \\\n \"segments\" : [\"Celebrity\", \"Music\", \"Pop\"]}' \\\n https://api.goroost.com/api/push \n", "language": "shell" } ], "sidebar": true } [/block] **Try the example on the right. ** Use your own **[API Key]** and **[API Secret]**, and replace the **alert**, **url**, and **segments** fields with appropriate values.
Push with a list of [Segments](doc:segmenting-users) if you want to send notifications only to subscribers associated a Segment on the list. [block:parameters] { "data": { "0-0": "alert", "1-0": "url", "h-0": "Key Name", "h-1": "Description", "0-1": "Title of the alert. Will be displayed when the alert is received by the subscriber.", "1-1": "Target url to be associated with the notification. The user", "2-0": "segments", "2-1": "A list of segments. Only subscribers who are associated with one or more of the listed Segments will receive the notification." }, "cols": 2, "rows": 3 } [/block] [block:code] { "codes": [ { "code": "{\n \"alert\" : \"A Notification Title\",\n \"url\" : \"http://some-target-url\",\n \"segments\" : [\"Celebrity\", \"Music\", \"Pop\"]\n}\n", "language": "json" } ] } [/block] [block:code] { "codes": [ { "code": "curl -X POST -u \"[api key]:[api secret]\" \\\n -H \"Content-Type: application/json\" \\\n --data '{\"alert\":\"A Notification Title\", \\\n \"url\":\"http://some-target-url\", \\\n \"segments\" : [\"Celebrity\", \"Music\", \"Pop\"]}' \\\n https://api.goroost.com/api/push \n", "language": "shell" } ], "sidebar": true } [/block] **Try the example on the right. ** Use your own **[API Key]** and **[API Secret]**, and replace the **alert**, **url**, and **segments** fields with appropriate values.
{"__v":7,"_id":"54f4b9ee5bc4e91700f9ff5f","api":{"auth":"required","params":[],"results":{"codes":[{"status":200,"language":"json","code":"{}","name":""},{"status":400,"language":"json","code":"{}","name":""}]},"url":""},"body":"Push with a list of [Aliases](doc:segmenting-users) if you want to send notifications to a specific list of subscribers.  [Subscribers must be specifically assigned an alias](doc:segmenting-users) prior to this call.\n[block:parameters]\n{\n  \"data\": {\n    \"0-0\": \"alert\",\n    \"1-0\": \"url\",\n    \"h-0\": \"Key Name\",\n    \"h-1\": \"Description\",\n    \"0-1\": \"Title of the alert.  Will be displayed when the alert is received by the subscriber.\",\n    \"1-1\": \"Target url to be associated with the notification.  The user\",\n    \"2-0\": \"alias\",\n    \"2-1\": \"A list of aliases.  Subscribers who are listed by alias will receive the notification.\"\n  },\n  \"cols\": 2,\n  \"rows\": 3\n}\n[/block]\n\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"{\\n    \\\"alert\\\" : \\\"A Notification Title\\\",\\n    \\\"url\\\" : \\\"http://some-target-url\\\",\\n    \\\"aliases\\\" :[\\\"burton@xyz123.com\\\", \\\"casey@abc456.com\\\", \\\"andy@def789.com\\\"]\\n}\\n\",\n      \"language\": \"json\"\n    }\n  ]\n}\n[/block]\n\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"curl -X POST -u \\\"[api key]:[api secret]\\\" \\\\\\n  -H \\\"Content-Type: application/json\\\" \\\\\\n  --data '{\\\"alert\\\":\\\"A Notification Title\\\", \\\\\\n  \\\"url\\\":\\\"http://some-target-url\\\", \\\\\\n  \\\"aliases\\\" :[\\\"burton@xyz123.com\\\", \\\"casey@abc456.com\\\", \\\"andy@def789.com\\\"]}' \\\\\\n  https://api.goroost.com/api/push \\n\",\n      \"language\": \"shell\"\n    }\n  ],\n  \"sidebar\": true\n}\n[/block]\n**Try the example on the right. ** Use your own **[API Key]** and **[API Secret]**, and replace the **alert**, **url**, and **aliases** fields with appropriate values.","category":"54ef128c6ce8d81900c1c340","createdAt":"2015-03-02T19:28:46.405Z","excerpt":"","githubsync":"","hidden":false,"link_external":false,"link_url":"","order":3,"project":"54ed111fa45a441700fd4cf6","slug":"push-to-alias","sync_unique":"","title":"Push To Alias","type":"basic","updates":[],"user":"54ed0ffea45a441700fd4cf0","version":"54ed1120a45a441700fd4cf9"}

Push To Alias


Push with a list of [Aliases](doc:segmenting-users) if you want to send notifications to a specific list of subscribers. [Subscribers must be specifically assigned an alias](doc:segmenting-users) prior to this call. [block:parameters] { "data": { "0-0": "alert", "1-0": "url", "h-0": "Key Name", "h-1": "Description", "0-1": "Title of the alert. Will be displayed when the alert is received by the subscriber.", "1-1": "Target url to be associated with the notification. The user", "2-0": "alias", "2-1": "A list of aliases. Subscribers who are listed by alias will receive the notification." }, "cols": 2, "rows": 3 } [/block] [block:code] { "codes": [ { "code": "{\n \"alert\" : \"A Notification Title\",\n \"url\" : \"http://some-target-url\",\n \"aliases\" :[\"burton@xyz123.com\", \"casey@abc456.com\", \"andy@def789.com\"]\n}\n", "language": "json" } ] } [/block] [block:code] { "codes": [ { "code": "curl -X POST -u \"[api key]:[api secret]\" \\\n -H \"Content-Type: application/json\" \\\n --data '{\"alert\":\"A Notification Title\", \\\n \"url\":\"http://some-target-url\", \\\n \"aliases\" :[\"burton@xyz123.com\", \"casey@abc456.com\", \"andy@def789.com\"]}' \\\n https://api.goroost.com/api/push \n", "language": "shell" } ], "sidebar": true } [/block] **Try the example on the right. ** Use your own **[API Key]** and **[API Secret]**, and replace the **alert**, **url**, and **aliases** fields with appropriate values.
Push with a list of [Aliases](doc:segmenting-users) if you want to send notifications to a specific list of subscribers. [Subscribers must be specifically assigned an alias](doc:segmenting-users) prior to this call. [block:parameters] { "data": { "0-0": "alert", "1-0": "url", "h-0": "Key Name", "h-1": "Description", "0-1": "Title of the alert. Will be displayed when the alert is received by the subscriber.", "1-1": "Target url to be associated with the notification. The user", "2-0": "alias", "2-1": "A list of aliases. Subscribers who are listed by alias will receive the notification." }, "cols": 2, "rows": 3 } [/block] [block:code] { "codes": [ { "code": "{\n \"alert\" : \"A Notification Title\",\n \"url\" : \"http://some-target-url\",\n \"aliases\" :[\"burton@xyz123.com\", \"casey@abc456.com\", \"andy@def789.com\"]\n}\n", "language": "json" } ] } [/block] [block:code] { "codes": [ { "code": "curl -X POST -u \"[api key]:[api secret]\" \\\n -H \"Content-Type: application/json\" \\\n --data '{\"alert\":\"A Notification Title\", \\\n \"url\":\"http://some-target-url\", \\\n \"aliases\" :[\"burton@xyz123.com\", \"casey@abc456.com\", \"andy@def789.com\"]}' \\\n https://api.goroost.com/api/push \n", "language": "shell" } ], "sidebar": true } [/block] **Try the example on the right. ** Use your own **[API Key]** and **[API Secret]**, and replace the **alert**, **url**, and **aliases** fields with appropriate values.
{"__v":5,"_id":"54f4bbc558e9df0d00917af2","api":{"auth":"required","params":[],"results":{"codes":[{"status":200,"language":"json","code":"{}","name":""},{"status":400,"language":"json","code":"{}","name":""}]},"url":""},"body":"A/B Testing two or more title variants for web push notifications with Roost is very simple. To perform an A/B tested push, you must provide two or more titles to the push call. \n\nRoost will progressively optimize your notifications by sending them out in small batches every few seconds, with the click-through results for each batch modifying the distribution for the next batch.\n[block:parameters]\n{\n  \"data\": {\n    \"0-0\": \"alert\",\n    \"1-0\": \"url\",\n    \"h-0\": \"Key Name\",\n    \"h-1\": \"Description\",\n    \"0-1\": \"Title of the alert.  Will be displayed when the alert is received by the subscriber.\",\n    \"1-1\": \"Target url to be associated with the notification.  The user\",\n    \"2-0\": \"test_type\",\n    \"2-1\": \"\\\"MULTI_ARM_BANDIT\\\"\"\n  },\n  \"cols\": 2,\n  \"rows\": 3\n}\n[/block]\n\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"{\\n    \\\"alert\\\" : [\\\"A Notification Title\\\", \\\"Alternate Title\\\", \\\"Third Title\\\"],\\n    \\\"url\\\" : \\\"http://some-target-url\\\",\\n    \\\"test_type\\\" : \\\"MULTI_ARM_BANDIT\\\"\\n}\\n\",\n      \"language\": \"json\"\n    }\n  ]\n}\n[/block]\n\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"curl -X POST -u \\\"[api key]:[api secret]\\\" \\\\\\n  -H \\\"Content-Type: application/json\\\" \\\\\\n  --data '{\\\"alert\\\" : [\\\"A Notification Title\\\", \\\"Alternate Title\\\", \\\"Third Title\\\"], \\\\\\n  \\\"url\\\":\\\"http://some-target-url\\\", \\\\\\n  \\\"test_type\\\" : \\\"MULTI_ARM_BANDIT\\\"}' \\\\\\n  https://api.goroost.com/api/push \\n\",\n      \"language\": \"shell\"\n    }\n  ],\n  \"sidebar\": true\n}\n[/block]\n**Try the example on the right. ** Use your own **[API Key]** and **[API Secret]**, and replace values for **alert** and **url**.  Be sure to use an array for the **alert** parameter.","category":"54ef128c6ce8d81900c1c340","createdAt":"2015-03-02T19:36:37.584Z","excerpt":"","githubsync":"","hidden":false,"link_external":false,"link_url":"","order":4,"project":"54ed111fa45a441700fd4cf6","slug":"ab-split-testing","sync_unique":"","title":"A/B Split-Testing","type":"basic","updates":[],"user":"54ed0ffea45a441700fd4cf0","version":"54ed1120a45a441700fd4cf9"}

A/B Split-Testing


A/B Testing two or more title variants for web push notifications with Roost is very simple. To perform an A/B tested push, you must provide two or more titles to the push call. Roost will progressively optimize your notifications by sending them out in small batches every few seconds, with the click-through results for each batch modifying the distribution for the next batch. [block:parameters] { "data": { "0-0": "alert", "1-0": "url", "h-0": "Key Name", "h-1": "Description", "0-1": "Title of the alert. Will be displayed when the alert is received by the subscriber.", "1-1": "Target url to be associated with the notification. The user", "2-0": "test_type", "2-1": "\"MULTI_ARM_BANDIT\"" }, "cols": 2, "rows": 3 } [/block] [block:code] { "codes": [ { "code": "{\n \"alert\" : [\"A Notification Title\", \"Alternate Title\", \"Third Title\"],\n \"url\" : \"http://some-target-url\",\n \"test_type\" : \"MULTI_ARM_BANDIT\"\n}\n", "language": "json" } ] } [/block] [block:code] { "codes": [ { "code": "curl -X POST -u \"[api key]:[api secret]\" \\\n -H \"Content-Type: application/json\" \\\n --data '{\"alert\" : [\"A Notification Title\", \"Alternate Title\", \"Third Title\"], \\\n \"url\":\"http://some-target-url\", \\\n \"test_type\" : \"MULTI_ARM_BANDIT\"}' \\\n https://api.goroost.com/api/push \n", "language": "shell" } ], "sidebar": true } [/block] **Try the example on the right. ** Use your own **[API Key]** and **[API Secret]**, and replace values for **alert** and **url**. Be sure to use an array for the **alert** parameter.
A/B Testing two or more title variants for web push notifications with Roost is very simple. To perform an A/B tested push, you must provide two or more titles to the push call. Roost will progressively optimize your notifications by sending them out in small batches every few seconds, with the click-through results for each batch modifying the distribution for the next batch. [block:parameters] { "data": { "0-0": "alert", "1-0": "url", "h-0": "Key Name", "h-1": "Description", "0-1": "Title of the alert. Will be displayed when the alert is received by the subscriber.", "1-1": "Target url to be associated with the notification. The user", "2-0": "test_type", "2-1": "\"MULTI_ARM_BANDIT\"" }, "cols": 2, "rows": 3 } [/block] [block:code] { "codes": [ { "code": "{\n \"alert\" : [\"A Notification Title\", \"Alternate Title\", \"Third Title\"],\n \"url\" : \"http://some-target-url\",\n \"test_type\" : \"MULTI_ARM_BANDIT\"\n}\n", "language": "json" } ] } [/block] [block:code] { "codes": [ { "code": "curl -X POST -u \"[api key]:[api secret]\" \\\n -H \"Content-Type: application/json\" \\\n --data '{\"alert\" : [\"A Notification Title\", \"Alternate Title\", \"Third Title\"], \\\n \"url\":\"http://some-target-url\", \\\n \"test_type\" : \"MULTI_ARM_BANDIT\"}' \\\n https://api.goroost.com/api/push \n", "language": "shell" } ], "sidebar": true } [/block] **Try the example on the right. ** Use your own **[API Key]** and **[API Secret]**, and replace values for **alert** and **url**. Be sure to use an array for the **alert** parameter.
{"__v":5,"_id":"54f4be0786a4e40d0037576b","api":{"auth":"required","params":[],"results":{"codes":[{"status":200,"language":"json","code":"{}","name":""},{"status":400,"language":"json","code":"{}","name":""}]},"url":""},"body":"To schedule a notification for a later time, simply **push** using the **‘schedule_for’** parameter.\n\nThe date value must use the [ISO8601 format](http://en.wikipedia.org/wiki/ISO_8601). Roost recommends using **this exact format**: “YYYY-MM-DDTHH:MM:SSZ”. \n[block:parameters]\n{\n  \"data\": {\n    \"0-0\": \"alert\",\n    \"1-0\": \"url\",\n    \"h-0\": \"Key Name\",\n    \"h-1\": \"Description\",\n    \"0-1\": \"Title of the alert.  Will be displayed when the alert is received by the subscriber.\",\n    \"1-1\": \"Target url to be associated with the notification.  The user\",\n    \"2-0\": \"schedule_for\",\n    \"2-1\": \"Date when the push should be delivered in ISO8601 format: \\n\\n“YYYY-MM-DDTHH:MM:SSZ”. \\n\\nUse either UTC or an offset to specify timezone at the end of the date string. ‘Z’ specifies zero offset, and ‘-05:00′ specifies an offset of -5 hours (US East Coast).\"\n  },\n  \"cols\": 2,\n  \"rows\": 3\n}\n[/block]\n\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"{\\n    \\\"alert\\\" : \\\"A Notification Title\\\",\\n    \\\"url\\\" : \\\"http://some-target-url\\\",\\n    \\\"schedule_for\\\" : \\\"2015-01-14T16:15:00Z\\\"\\n}\\n\",\n      \"language\": \"json\"\n    }\n  ]\n}\n[/block]\n\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"curl -X POST -u \\\"[api key]:[api secret]\\\" \\\\\\n  -H \\\"Content-Type: application/json\\\" \\\\\\n  --data '{\\\"alert\\\" : \\\"A Notification Title\\\", \\\\\\n  \\\"url\\\":\\\"http://some-target-url\\\", \\\\\\n  \\\"schedule_for\\\" : \\\"2015-01-14T16:15:00Z\\\"}' \\\\\\n  https://api.goroost.com/api/push \\n\",\n      \"language\": \"shell\"\n    }\n  ],\n  \"sidebar\": true\n}\n[/block]\n**Try the example on the right. ** Use your own **[API Key]** and **[API Secret]**, and replace values for **alert**, **url**, and **schedule_for** fields.","category":"54ef128c6ce8d81900c1c340","createdAt":"2015-03-02T19:46:15.237Z","excerpt":"","githubsync":"","hidden":false,"link_external":false,"link_url":"","order":5,"project":"54ed111fa45a441700fd4cf6","slug":"push-scheduling","sync_unique":"","title":"Push Scheduling","type":"basic","updates":[],"user":"54ed0ffea45a441700fd4cf0","version":"54ed1120a45a441700fd4cf9"}

Push Scheduling


To schedule a notification for a later time, simply **push** using the **‘schedule_for’** parameter. The date value must use the [ISO8601 format](http://en.wikipedia.org/wiki/ISO_8601). Roost recommends using **this exact format**: “YYYY-MM-DDTHH:MM:SSZ”. [block:parameters] { "data": { "0-0": "alert", "1-0": "url", "h-0": "Key Name", "h-1": "Description", "0-1": "Title of the alert. Will be displayed when the alert is received by the subscriber.", "1-1": "Target url to be associated with the notification. The user", "2-0": "schedule_for", "2-1": "Date when the push should be delivered in ISO8601 format: \n\n“YYYY-MM-DDTHH:MM:SSZ”. \n\nUse either UTC or an offset to specify timezone at the end of the date string. ‘Z’ specifies zero offset, and ‘-05:00′ specifies an offset of -5 hours (US East Coast)." }, "cols": 2, "rows": 3 } [/block] [block:code] { "codes": [ { "code": "{\n \"alert\" : \"A Notification Title\",\n \"url\" : \"http://some-target-url\",\n \"schedule_for\" : \"2015-01-14T16:15:00Z\"\n}\n", "language": "json" } ] } [/block] [block:code] { "codes": [ { "code": "curl -X POST -u \"[api key]:[api secret]\" \\\n -H \"Content-Type: application/json\" \\\n --data '{\"alert\" : \"A Notification Title\", \\\n \"url\":\"http://some-target-url\", \\\n \"schedule_for\" : \"2015-01-14T16:15:00Z\"}' \\\n https://api.goroost.com/api/push \n", "language": "shell" } ], "sidebar": true } [/block] **Try the example on the right. ** Use your own **[API Key]** and **[API Secret]**, and replace values for **alert**, **url**, and **schedule_for** fields.
To schedule a notification for a later time, simply **push** using the **‘schedule_for’** parameter. The date value must use the [ISO8601 format](http://en.wikipedia.org/wiki/ISO_8601). Roost recommends using **this exact format**: “YYYY-MM-DDTHH:MM:SSZ”. [block:parameters] { "data": { "0-0": "alert", "1-0": "url", "h-0": "Key Name", "h-1": "Description", "0-1": "Title of the alert. Will be displayed when the alert is received by the subscriber.", "1-1": "Target url to be associated with the notification. The user", "2-0": "schedule_for", "2-1": "Date when the push should be delivered in ISO8601 format: \n\n“YYYY-MM-DDTHH:MM:SSZ”. \n\nUse either UTC or an offset to specify timezone at the end of the date string. ‘Z’ specifies zero offset, and ‘-05:00′ specifies an offset of -5 hours (US East Coast)." }, "cols": 2, "rows": 3 } [/block] [block:code] { "codes": [ { "code": "{\n \"alert\" : \"A Notification Title\",\n \"url\" : \"http://some-target-url\",\n \"schedule_for\" : \"2015-01-14T16:15:00Z\"\n}\n", "language": "json" } ] } [/block] [block:code] { "codes": [ { "code": "curl -X POST -u \"[api key]:[api secret]\" \\\n -H \"Content-Type: application/json\" \\\n --data '{\"alert\" : \"A Notification Title\", \\\n \"url\":\"http://some-target-url\", \\\n \"schedule_for\" : \"2015-01-14T16:15:00Z\"}' \\\n https://api.goroost.com/api/push \n", "language": "shell" } ], "sidebar": true } [/block] **Try the example on the right. ** Use your own **[API Key]** and **[API Secret]**, and replace values for **alert**, **url**, and **schedule_for** fields.
{"__v":6,"_id":"54f4c00086a4e40d0037576f","api":{"auth":"required","params":[],"results":{"codes":[{"status":200,"language":"json","code":"{}","name":""},{"status":400,"language":"json","code":"{}","name":""}]},"url":""},"body":"You may need to combine some of the many push parameters to reach the desired target subscribers at the right time.\n\n**Example 1**:   Push a notification to a list of Segments at a particular time\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"{\\n    \\\"alert\\\" : [\\\"A Notification Title\\\", \\\"Alternate Title\\\", \\\"Third Title\\\"],\\n    \\\"url\\\" : \\\"http://some-target-url\\\",\\n    \\\"schedule_for\\\" : \\\"2015-01-14T16:15:00Z\\\"\\n}\\n\",\n      \"language\": \"shell\"\n    }\n  ]\n}\n[/block]\n\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"# Example 1\\n\\ncurl -X POST -u \\\"[config key]:[api secret]\\\" \\\\\\n  -H \\\"Content-Type: application/json\\\" \\\\\\n  --data '{\\\"alert\\\" : \\\"A Notification Title\\\", \\\\\\n  \\\"url\\\":\\\"http://some-target-url\\\", \\\\\\n  \\\"schedule_for\\\" : \\\"2015-01-14T16:15:00Z\\\"}' \\\\\\n  https://api.goroost.com/api/push \\n\",\n      \"language\": \"shell\"\n    }\n  ],\n  \"sidebar\": true\n}\n[/block]\n**Example 2**:  Push a notification to everyone, except a list of device tokens (used for testing).  Also perform an A/B split test on with 2 alert titles.\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"{\\n    \\\"alert\\\" : [\\\"A Notification Title\\\", \\\"Alternate Title\\\", \\\"Third Title\\\"],\\n    \\\"url\\\" : \\\"http://some-target-url\\\",\\n    \\\"exclude_tokens\\\" : [\\\"2893sf8d8uurkjsfd8we\\\", \\\"afdkjsdlfjsifhlewdf2\\\", \\\"89489h8fhuefo8eurori2\\\"]\\n}\",\n      \"language\": \"shell\"\n    }\n  ]\n}\n[/block]\n\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"# Example 2\\n\\ncurl -X POST -u \\\"[api key]:[api secret]\\\" \\\\\\n  -H \\\"Content-Type: application/json\\\" \\\\\\n  --data '{\\\"alert\\\" : [\\\"A Notification Title\\\", \\\"Alternate Title\\\", \\\"Third Title\\\"], \\\\\\n  \\\"url\\\":\\\"http://some-target-url\\\", \\\\\\n  \\\"exclude_tokens\\\" : [\\\"2893sf8d8uurkjsfd8we\\\", \\\"afdkjsdlfjsifhlewdf2\\\", \\\"89489h8fhuefo8eurori2\\\"]}' \\\\\\n  https://api.goroost.com/api/push \",\n      \"language\": \"shell\"\n    }\n  ],\n  \"sidebar\": true\n}\n[/block]\n**Example 3**:  This example is not extremely useful, but it demonstrates  how each parameter can be included. It will send the notification to subscribers who have device_token of ‘xyz’ OR tag of ‘Stories’ OR alias of ‘user123′ UNLESS they have a device_token of ‘abc’.  The targeted subscribers will receive one of the two A/B test titles, and they will get the notification at 8:00am (GMT) May 1, 2015.\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"{\\n    \\\"alert\\\" : [\\\"Dog Bites Mailman\\\", \\\"Mail Carrier Bitten By Canine\\\"],\\n    \\\"url\\\" : \\\"http://mailmanstories.com\\\",\\n    \\\"device_tokens\\\" : [\\\"xyz\\\"],\\n    \\\"segments\\\" : [\\\"Stories\\\"],\\n    \\\"aliases\\\" : [\\\"user123\\\"],\\n    \\\"exclude_tokens\\\" : [\\\"abc\\\"],\\n    \\\"schedule_for\\\" :  \\\"2015-05-01T08:00:00Z\\\"\\n}\\n\",\n      \"language\": \"shell\"\n    }\n  ]\n}\n[/block]\n\n[block:textarea]\n{\n  \"text\": \"\",\n  \"sidebar\": true\n}\n[/block]\n\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"# Example 3\\n\\ncurl -X POST -u \\\"[api key]:[api secret]\\\" \\\\\\n  -H \\\"Content-Type: application/json\\\" \\\\\\n  --data '{\\\"alert\\\" : [\\\"Dog Bites Mailman\\\", \\\"Mail Carrier Bitten By Canine\\\"], \\\\\\n  \\\"url\\\":\\\"http://mailmanstories.com\\\", \\\\\\n  \\\"device_tokens\\\" : [\\\"xyz\\\"], \\\\\\n  \\\"segments\\\" : [\\\"Stories\\\"], \\\\\\n  \\\"aliases\\\" : [\\\"user123\\\"], \\\\\\n  \\\"exclude_tokens\\\" : [\\\"abc\\\"], \\\\\\n  \\\"schedule_for\\\" :  \\\"2015-05-01T08:00:00Z\\\"}' \\\\\\n  https://api.goroost.com/api/push \",\n      \"language\": \"shell\"\n    }\n  ],\n  \"sidebar\": true\n}\n[/block]\n**Try the examples on the right. ** Use your own **[API Key]** and **[API Secret]**, and replace values the appropriate fields.","category":"54ef128c6ce8d81900c1c340","createdAt":"2015-03-02T19:54:40.998Z","excerpt":"","githubsync":"","hidden":false,"link_external":false,"link_url":"","order":6,"project":"54ed111fa45a441700fd4cf6","slug":"push-with-multiple-parameters","sync_unique":"","title":"Push with Multiple-Parameters","type":"basic","updates":[],"user":"54ed0ffea45a441700fd4cf0","version":"54ed1120a45a441700fd4cf9"}

Push with Multiple-Parameters


You may need to combine some of the many push parameters to reach the desired target subscribers at the right time. **Example 1**: Push a notification to a list of Segments at a particular time [block:code] { "codes": [ { "code": "{\n \"alert\" : [\"A Notification Title\", \"Alternate Title\", \"Third Title\"],\n \"url\" : \"http://some-target-url\",\n \"schedule_for\" : \"2015-01-14T16:15:00Z\"\n}\n", "language": "shell" } ] } [/block] [block:code] { "codes": [ { "code": "# Example 1\n\ncurl -X POST -u \"[config key]:[api secret]\" \\\n -H \"Content-Type: application/json\" \\\n --data '{\"alert\" : \"A Notification Title\", \\\n \"url\":\"http://some-target-url\", \\\n \"schedule_for\" : \"2015-01-14T16:15:00Z\"}' \\\n https://api.goroost.com/api/push \n", "language": "shell" } ], "sidebar": true } [/block] **Example 2**: Push a notification to everyone, except a list of device tokens (used for testing). Also perform an A/B split test on with 2 alert titles. [block:code] { "codes": [ { "code": "{\n \"alert\" : [\"A Notification Title\", \"Alternate Title\", \"Third Title\"],\n \"url\" : \"http://some-target-url\",\n \"exclude_tokens\" : [\"2893sf8d8uurkjsfd8we\", \"afdkjsdlfjsifhlewdf2\", \"89489h8fhuefo8eurori2\"]\n}", "language": "shell" } ] } [/block] [block:code] { "codes": [ { "code": "# Example 2\n\ncurl -X POST -u \"[api key]:[api secret]\" \\\n -H \"Content-Type: application/json\" \\\n --data '{\"alert\" : [\"A Notification Title\", \"Alternate Title\", \"Third Title\"], \\\n \"url\":\"http://some-target-url\", \\\n \"exclude_tokens\" : [\"2893sf8d8uurkjsfd8we\", \"afdkjsdlfjsifhlewdf2\", \"89489h8fhuefo8eurori2\"]}' \\\n https://api.goroost.com/api/push ", "language": "shell" } ], "sidebar": true } [/block] **Example 3**: This example is not extremely useful, but it demonstrates how each parameter can be included. It will send the notification to subscribers who have device_token of ‘xyz’ OR tag of ‘Stories’ OR alias of ‘user123′ UNLESS they have a device_token of ‘abc’. The targeted subscribers will receive one of the two A/B test titles, and they will get the notification at 8:00am (GMT) May 1, 2015. [block:code] { "codes": [ { "code": "{\n \"alert\" : [\"Dog Bites Mailman\", \"Mail Carrier Bitten By Canine\"],\n \"url\" : \"http://mailmanstories.com\",\n \"device_tokens\" : [\"xyz\"],\n \"segments\" : [\"Stories\"],\n \"aliases\" : [\"user123\"],\n \"exclude_tokens\" : [\"abc\"],\n \"schedule_for\" : \"2015-05-01T08:00:00Z\"\n}\n", "language": "shell" } ] } [/block] [block:textarea] { "text": "", "sidebar": true } [/block] [block:code] { "codes": [ { "code": "# Example 3\n\ncurl -X POST -u \"[api key]:[api secret]\" \\\n -H \"Content-Type: application/json\" \\\n --data '{\"alert\" : [\"Dog Bites Mailman\", \"Mail Carrier Bitten By Canine\"], \\\n \"url\":\"http://mailmanstories.com\", \\\n \"device_tokens\" : [\"xyz\"], \\\n \"segments\" : [\"Stories\"], \\\n \"aliases\" : [\"user123\"], \\\n \"exclude_tokens\" : [\"abc\"], \\\n \"schedule_for\" : \"2015-05-01T08:00:00Z\"}' \\\n https://api.goroost.com/api/push ", "language": "shell" } ], "sidebar": true } [/block] **Try the examples on the right. ** Use your own **[API Key]** and **[API Secret]**, and replace values the appropriate fields.
You may need to combine some of the many push parameters to reach the desired target subscribers at the right time. **Example 1**: Push a notification to a list of Segments at a particular time [block:code] { "codes": [ { "code": "{\n \"alert\" : [\"A Notification Title\", \"Alternate Title\", \"Third Title\"],\n \"url\" : \"http://some-target-url\",\n \"schedule_for\" : \"2015-01-14T16:15:00Z\"\n}\n", "language": "shell" } ] } [/block] [block:code] { "codes": [ { "code": "# Example 1\n\ncurl -X POST -u \"[config key]:[api secret]\" \\\n -H \"Content-Type: application/json\" \\\n --data '{\"alert\" : \"A Notification Title\", \\\n \"url\":\"http://some-target-url\", \\\n \"schedule_for\" : \"2015-01-14T16:15:00Z\"}' \\\n https://api.goroost.com/api/push \n", "language": "shell" } ], "sidebar": true } [/block] **Example 2**: Push a notification to everyone, except a list of device tokens (used for testing). Also perform an A/B split test on with 2 alert titles. [block:code] { "codes": [ { "code": "{\n \"alert\" : [\"A Notification Title\", \"Alternate Title\", \"Third Title\"],\n \"url\" : \"http://some-target-url\",\n \"exclude_tokens\" : [\"2893sf8d8uurkjsfd8we\", \"afdkjsdlfjsifhlewdf2\", \"89489h8fhuefo8eurori2\"]\n}", "language": "shell" } ] } [/block] [block:code] { "codes": [ { "code": "# Example 2\n\ncurl -X POST -u \"[api key]:[api secret]\" \\\n -H \"Content-Type: application/json\" \\\n --data '{\"alert\" : [\"A Notification Title\", \"Alternate Title\", \"Third Title\"], \\\n \"url\":\"http://some-target-url\", \\\n \"exclude_tokens\" : [\"2893sf8d8uurkjsfd8we\", \"afdkjsdlfjsifhlewdf2\", \"89489h8fhuefo8eurori2\"]}' \\\n https://api.goroost.com/api/push ", "language": "shell" } ], "sidebar": true } [/block] **Example 3**: This example is not extremely useful, but it demonstrates how each parameter can be included. It will send the notification to subscribers who have device_token of ‘xyz’ OR tag of ‘Stories’ OR alias of ‘user123′ UNLESS they have a device_token of ‘abc’. The targeted subscribers will receive one of the two A/B test titles, and they will get the notification at 8:00am (GMT) May 1, 2015. [block:code] { "codes": [ { "code": "{\n \"alert\" : [\"Dog Bites Mailman\", \"Mail Carrier Bitten By Canine\"],\n \"url\" : \"http://mailmanstories.com\",\n \"device_tokens\" : [\"xyz\"],\n \"segments\" : [\"Stories\"],\n \"aliases\" : [\"user123\"],\n \"exclude_tokens\" : [\"abc\"],\n \"schedule_for\" : \"2015-05-01T08:00:00Z\"\n}\n", "language": "shell" } ] } [/block] [block:textarea] { "text": "", "sidebar": true } [/block] [block:code] { "codes": [ { "code": "# Example 3\n\ncurl -X POST -u \"[api key]:[api secret]\" \\\n -H \"Content-Type: application/json\" \\\n --data '{\"alert\" : [\"Dog Bites Mailman\", \"Mail Carrier Bitten By Canine\"], \\\n \"url\":\"http://mailmanstories.com\", \\\n \"device_tokens\" : [\"xyz\"], \\\n \"segments\" : [\"Stories\"], \\\n \"aliases\" : [\"user123\"], \\\n \"exclude_tokens\" : [\"abc\"], \\\n \"schedule_for\" : \"2015-05-01T08:00:00Z\"}' \\\n https://api.goroost.com/api/push ", "language": "shell" } ], "sidebar": true } [/block] **Try the examples on the right. ** Use your own **[API Key]** and **[API Secret]**, and replace values the appropriate fields.
{"__v":7,"_id":"54f4c65c5bc4e91700f9ff70","api":{"auth":"required","params":[],"results":{"codes":[{"status":200,"language":"json","code":"{}","name":""},{"status":400,"language":"json","code":"{}","name":""}]},"url":""},"body":"[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"CALL\"\n}\n[/block]\n\n[block:parameters]\n{\n  \"data\": {\n    \"0-0\": \"URL\",\n    \"0-1\": \"https://api.goroost.com/api/stats/config\",\n    \"1-0\": \"HTTP Auth\",\n    \"1-1\": \"YES [(see Authentication)](doc:authentication)\"\n  },\n  \"cols\": 2,\n  \"rows\": 2\n}\n[/block]\nThe Roost **config** method requires an HTTP GET request.\n\n Note that no parameters are needed aside from the authentication, because the **API Key** and **Secret Key** are unique to a **particular configuration**.\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Return Value\"\n}\n[/block]\nOn success, a JSON structure will be returned with the following structure:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"{\\n\\t\\\"name\\\": <string>, # name of your configuration\\n\\t\\\"stats\\\":\\n\\t\\t{\\n\\t\\t\\t\\\"reads\\\": <integer>,         # total notifications read\\n\\t\\t\\t\\\"notifications\\\": <integer>, # total notifications sent\\n\\t\\t\\t\\\"subscribers\\\": <integer>    # total subscribers\\n\\t\\t}\\n}\",\n      \"language\": \"shell\"\n    }\n  ]\n}\n[/block]","category":"54f4c5e95bc4e91700f9ff6f","createdAt":"2015-03-02T20:21:48.312Z","excerpt":"Use the Roost **config** call to retrieve stats on a particular Roost configuration.","githubsync":"","hidden":false,"link_external":false,"link_url":"","order":0,"project":"54ed111fa45a441700fd4cf6","slug":"specification-1","sync_unique":"","title":"Specification","type":"basic","updates":[],"user":"54ed0ffea45a441700fd4cf0","version":"54ed1120a45a441700fd4cf9"}

Specification

Use the Roost **config** call to retrieve stats on a particular Roost configuration.

[block:api-header] { "type": "basic", "title": "CALL" } [/block] [block:parameters] { "data": { "0-0": "URL", "0-1": "https://api.goroost.com/api/stats/config", "1-0": "HTTP Auth", "1-1": "YES [(see Authentication)](doc:authentication)" }, "cols": 2, "rows": 2 } [/block] The Roost **config** method requires an HTTP GET request. Note that no parameters are needed aside from the authentication, because the **API Key** and **Secret Key** are unique to a **particular configuration**. [block:api-header] { "type": "basic", "title": "Return Value" } [/block] On success, a JSON structure will be returned with the following structure: [block:code] { "codes": [ { "code": "{\n\t\"name\": <string>, # name of your configuration\n\t\"stats\":\n\t\t{\n\t\t\t\"reads\": <integer>, # total notifications read\n\t\t\t\"notifications\": <integer>, # total notifications sent\n\t\t\t\"subscribers\": <integer> # total subscribers\n\t\t}\n}", "language": "shell" } ] } [/block]
[block:api-header] { "type": "basic", "title": "CALL" } [/block] [block:parameters] { "data": { "0-0": "URL", "0-1": "https://api.goroost.com/api/stats/config", "1-0": "HTTP Auth", "1-1": "YES [(see Authentication)](doc:authentication)" }, "cols": 2, "rows": 2 } [/block] The Roost **config** method requires an HTTP GET request. Note that no parameters are needed aside from the authentication, because the **API Key** and **Secret Key** are unique to a **particular configuration**. [block:api-header] { "type": "basic", "title": "Return Value" } [/block] On success, a JSON structure will be returned with the following structure: [block:code] { "codes": [ { "code": "{\n\t\"name\": <string>, # name of your configuration\n\t\"stats\":\n\t\t{\n\t\t\t\"reads\": <integer>, # total notifications read\n\t\t\t\"notifications\": <integer>, # total notifications sent\n\t\t\t\"subscribers\": <integer> # total subscribers\n\t\t}\n}", "language": "shell" } ] } [/block]
{"__v":6,"_id":"54f4ca24e4dd350d00e65b15","api":{"auth":"required","params":[],"results":{"codes":[{"status":200,"language":"json","code":"{}","name":""},{"status":400,"language":"json","code":"{}","name":""}]},"url":""},"body":"Use the **Config** command to retrieve stats for a particular Roost configuration.\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"# Config Example\\n\\ncurl -X GET -u \\\"[api key]:[api secret]\\\" \\\\\\nhttps://api.goroost.com/api/stats/config \",\n      \"language\": \"shell\"\n    }\n  ],\n  \"sidebar\": true\n}\n[/block]\n\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"# Example Return Value\\n\\n{\\n\\t\\\"name\\\":\\\"Name of Your Site\\\",\\n\\t\\\"stats\\\":\\n\\t\\t{\\n\\t\\t\\t\\\"reads\\\":29800,\\n\\t\\t\\t\\\"notifications\\\":210772,\\n\\t\\t\\t\\\"subscribers\\\":25087\\n\\t\\t}\\n}\",\n      \"language\": \"shell\"\n    }\n  ],\n  \"sidebar\": true\n}\n[/block]\n**Try the example on the right. ** Use your own **[API Key]** and **[API Secret]**.","category":"54f4c5e95bc4e91700f9ff6f","createdAt":"2015-03-02T20:37:56.167Z","excerpt":"","githubsync":"","hidden":false,"link_external":false,"link_url":"","order":1,"project":"54ed111fa45a441700fd4cf6","slug":"retrieving-a-config","sync_unique":"","title":"Retrieving a Config","type":"basic","updates":[],"user":"54ed0ffea45a441700fd4cf0","version":"54ed1120a45a441700fd4cf9"}

Retrieving a Config


Use the **Config** command to retrieve stats for a particular Roost configuration. [block:code] { "codes": [ { "code": "# Config Example\n\ncurl -X GET -u \"[api key]:[api secret]\" \\\nhttps://api.goroost.com/api/stats/config ", "language": "shell" } ], "sidebar": true } [/block] [block:code] { "codes": [ { "code": "# Example Return Value\n\n{\n\t\"name\":\"Name of Your Site\",\n\t\"stats\":\n\t\t{\n\t\t\t\"reads\":29800,\n\t\t\t\"notifications\":210772,\n\t\t\t\"subscribers\":25087\n\t\t}\n}", "language": "shell" } ], "sidebar": true } [/block] **Try the example on the right. ** Use your own **[API Key]** and **[API Secret]**.
Use the **Config** command to retrieve stats for a particular Roost configuration. [block:code] { "codes": [ { "code": "# Config Example\n\ncurl -X GET -u \"[api key]:[api secret]\" \\\nhttps://api.goroost.com/api/stats/config ", "language": "shell" } ], "sidebar": true } [/block] [block:code] { "codes": [ { "code": "# Example Return Value\n\n{\n\t\"name\":\"Name of Your Site\",\n\t\"stats\":\n\t\t{\n\t\t\t\"reads\":29800,\n\t\t\t\"notifications\":210772,\n\t\t\t\"subscribers\":25087\n\t\t}\n}", "language": "shell" } ], "sidebar": true } [/block] **Try the example on the right. ** Use your own **[API Key]** and **[API Secret]**.
{"__v":8,"_id":"54f4d66958e9df0d00917b0a","api":{"auth":"required","params":[],"results":{"codes":[{"status":200,"language":"json","code":"{}","name":""},{"status":400,"language":"json","code":"{}","name":""}]},"url":""},"body":"[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Call\"\n}\n[/block]\n\n[block:parameters]\n{\n  \"data\": {\n    \"0-0\": \"URL\",\n    \"0-1\": \"https://api.goroost.com/api/stats/notifications\",\n    \"1-0\": \"HTTP Auth\",\n    \"1-1\": \"YES [(see Authentication)](doc:authentication)\"\n  },\n  \"cols\": 2,\n  \"rows\": 2\n}\n[/block]\nThe Roost **notifications** method requires an HTTP GET request.\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Arguments\"\n}\n[/block]\nOPTIONAL ARGMENTS\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"Parameter\",\n    \"h-1\": \"Description\",\n    \"h-2\": \"Description\",\n    \"0-0\": \"count\",\n    \"1-0\": \"offset\",\n    \"0-1\": \"The number of notifications to be returned in descending chronological order from the current time.\",\n    \"1-1\": \"The number of notifications to skip when retrieving a list of notifications.\"\n  },\n  \"cols\": 2,\n  \"rows\": 2\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Return Value\"\n}\n[/block]\nOn success, returns stats and information for notifications in descending order in a JSON structure as shown below. Default is 10 notifications.\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"{\\n\\t\\\"notifications\\\":[\\n\\t\\t{\\n\\t\\t\\t\\\"id\\\":8363889,\\n\\t\\t\\t\\\"sent\\\":\\\"2014-10-22T17:10:05Z\\\",\\n\\t\\t\\t\\\"stats\\\":\\n\\t\\t\\t\\t{\\n\\t\\t\\t\\t\\t\\\"reads\\\":0,\\n\\t\\t\\t\\t\\t\\\"sends\\\":23\\n\\t\\t\\t\\t},\\n\\t\\t\\t\\\"alert\\\":\\\"The Benchmarks Are In: iPad Air 2 Up to...\\\",\\n\\t\\t\\t\\\"url\\\":\\\"http://www.tekrevue.com/ipad-air-2-benchmarks/\\\"\\n\\t\\t},\\n\\t\\t{\\n\\t\\t\\t\\\"id\\\":8362271,\\n\\t\\t\\t\\\"sent\\\":\\\"2014-10-22T15:10:04Z\\\",\\n\\t\\t\\t\\\"stats\\\":\\n\\t\\t\\t\\t{\\n\\t\\t\\t\\t\\t\\\"reads\\\":0,\\n\\t\\t\\t\\t\\t\\\"sends\\\":17\\n\\t\\t\\t\\t},\\n\\t\\t\\t\\\"alert\\\":\\\"Don’t Overpay, Get Third Party RAM Upgrades for...\\\",\\n\\t\\t\\t\\\"url\\\":\\\"http://www.tekrevue.com/third-party-ram-upgrades...\\\"\\n\\t\\t},\\n\\t\\t\\n\\t\\tetc...\\n\\t\\n\\t]\\n}\",\n      \"language\": \"shell\"\n    }\n  ]\n}\n[/block]","category":"54f4d63b5bc4e91700f9ff7d","createdAt":"2015-03-02T21:30:17.092Z","excerpt":"Use the Roost **notifications** call to retrieve a list of all notifications.","githubsync":"","hidden":false,"link_external":false,"link_url":"","order":0,"project":"54ed111fa45a441700fd4cf6","slug":"specification-2","sync_unique":"","title":"Specification","type":"basic","updates":[],"user":"54ed0ffea45a441700fd4cf0","version":"54ed1120a45a441700fd4cf9"}

Specification

Use the Roost **notifications** call to retrieve a list of all notifications.

[block:api-header] { "type": "basic", "title": "Call" } [/block] [block:parameters] { "data": { "0-0": "URL", "0-1": "https://api.goroost.com/api/stats/notifications", "1-0": "HTTP Auth", "1-1": "YES [(see Authentication)](doc:authentication)" }, "cols": 2, "rows": 2 } [/block] The Roost **notifications** method requires an HTTP GET request. [block:api-header] { "type": "basic", "title": "Arguments" } [/block] OPTIONAL ARGMENTS [block:parameters] { "data": { "h-0": "Parameter", "h-1": "Description", "h-2": "Description", "0-0": "count", "1-0": "offset", "0-1": "The number of notifications to be returned in descending chronological order from the current time.", "1-1": "The number of notifications to skip when retrieving a list of notifications." }, "cols": 2, "rows": 2 } [/block] [block:api-header] { "type": "basic", "title": "Return Value" } [/block] On success, returns stats and information for notifications in descending order in a JSON structure as shown below. Default is 10 notifications. [block:code] { "codes": [ { "code": "{\n\t\"notifications\":[\n\t\t{\n\t\t\t\"id\":8363889,\n\t\t\t\"sent\":\"2014-10-22T17:10:05Z\",\n\t\t\t\"stats\":\n\t\t\t\t{\n\t\t\t\t\t\"reads\":0,\n\t\t\t\t\t\"sends\":23\n\t\t\t\t},\n\t\t\t\"alert\":\"The Benchmarks Are In: iPad Air 2 Up to...\",\n\t\t\t\"url\":\"http://www.tekrevue.com/ipad-air-2-benchmarks/\"\n\t\t},\n\t\t{\n\t\t\t\"id\":8362271,\n\t\t\t\"sent\":\"2014-10-22T15:10:04Z\",\n\t\t\t\"stats\":\n\t\t\t\t{\n\t\t\t\t\t\"reads\":0,\n\t\t\t\t\t\"sends\":17\n\t\t\t\t},\n\t\t\t\"alert\":\"Don’t Overpay, Get Third Party RAM Upgrades for...\",\n\t\t\t\"url\":\"http://www.tekrevue.com/third-party-ram-upgrades...\"\n\t\t},\n\t\t\n\t\tetc...\n\t\n\t]\n}", "language": "shell" } ] } [/block]
[block:api-header] { "type": "basic", "title": "Call" } [/block] [block:parameters] { "data": { "0-0": "URL", "0-1": "https://api.goroost.com/api/stats/notifications", "1-0": "HTTP Auth", "1-1": "YES [(see Authentication)](doc:authentication)" }, "cols": 2, "rows": 2 } [/block] The Roost **notifications** method requires an HTTP GET request. [block:api-header] { "type": "basic", "title": "Arguments" } [/block] OPTIONAL ARGMENTS [block:parameters] { "data": { "h-0": "Parameter", "h-1": "Description", "h-2": "Description", "0-0": "count", "1-0": "offset", "0-1": "The number of notifications to be returned in descending chronological order from the current time.", "1-1": "The number of notifications to skip when retrieving a list of notifications." }, "cols": 2, "rows": 2 } [/block] [block:api-header] { "type": "basic", "title": "Return Value" } [/block] On success, returns stats and information for notifications in descending order in a JSON structure as shown below. Default is 10 notifications. [block:code] { "codes": [ { "code": "{\n\t\"notifications\":[\n\t\t{\n\t\t\t\"id\":8363889,\n\t\t\t\"sent\":\"2014-10-22T17:10:05Z\",\n\t\t\t\"stats\":\n\t\t\t\t{\n\t\t\t\t\t\"reads\":0,\n\t\t\t\t\t\"sends\":23\n\t\t\t\t},\n\t\t\t\"alert\":\"The Benchmarks Are In: iPad Air 2 Up to...\",\n\t\t\t\"url\":\"http://www.tekrevue.com/ipad-air-2-benchmarks/\"\n\t\t},\n\t\t{\n\t\t\t\"id\":8362271,\n\t\t\t\"sent\":\"2014-10-22T15:10:04Z\",\n\t\t\t\"stats\":\n\t\t\t\t{\n\t\t\t\t\t\"reads\":0,\n\t\t\t\t\t\"sends\":17\n\t\t\t\t},\n\t\t\t\"alert\":\"Don’t Overpay, Get Third Party RAM Upgrades for...\",\n\t\t\t\"url\":\"http://www.tekrevue.com/third-party-ram-upgrades...\"\n\t\t},\n\t\t\n\t\tetc...\n\t\n\t]\n}", "language": "shell" } ] } [/block]
{"__v":7,"_id":"54f4d67c5bc4e91700f9ff7e","api":{"auth":"required","params":[],"results":{"codes":[{"status":200,"language":"json","code":"{}","name":""},{"status":400,"language":"json","code":"{}","name":""}]},"url":""},"body":"Use the **notifications** command to retrieve a list of notifications.\n\nExample 1:  Get last 10 notifications.  10 is the default number fetched.\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"# Notifications Example 1\\n\\ncurl -X GET -u \\\"[api key]:[api secret]\\\" \\\\\\nhttps://api.goroost.com/api/stats/notifications \",\n      \"language\": \"shell\"\n    }\n  ],\n  \"sidebar\": true\n}\n[/block]\nExample 2: Get last 50 notifications.\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"# Notifications Example 2\\n\\ncurl -X GET -u \\\"[api key]:[api secret]\\\" \\\\\\nhttps://api.goroost.com/api/stats/notifications?count=50\",\n      \"language\": \"shell\"\n    }\n  ],\n  \"sidebar\": true\n}\n[/block]\nExample 3: Get notifications 51-75.\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"# Notifications Example 3\\n\\ncurl -X GET -u \\\"[api key]:[api secret]\\\" \\\\\\nhttps://api.goroost.com/api/stats/notifications?count=25&offset=50\",\n      \"language\": \"shell\"\n    }\n  ],\n  \"sidebar\": true\n}\n[/block]\n**Try the examples on the right. ** Use your own **[API Key]** and **[API Secret]**.","category":"54f4d63b5bc4e91700f9ff7d","createdAt":"2015-03-02T21:30:36.779Z","excerpt":"","githubsync":"","hidden":false,"link_external":false,"link_url":"","order":1,"project":"54ed111fa45a441700fd4cf6","slug":"retrieving-notifications","sync_unique":"","title":"Retrieving Notifications","type":"basic","updates":[],"user":"54ed0ffea45a441700fd4cf0","version":"54ed1120a45a441700fd4cf9"}

Retrieving Notifications


Use the **notifications** command to retrieve a list of notifications. Example 1: Get last 10 notifications. 10 is the default number fetched. [block:code] { "codes": [ { "code": "# Notifications Example 1\n\ncurl -X GET -u \"[api key]:[api secret]\" \\\nhttps://api.goroost.com/api/stats/notifications ", "language": "shell" } ], "sidebar": true } [/block] Example 2: Get last 50 notifications. [block:code] { "codes": [ { "code": "# Notifications Example 2\n\ncurl -X GET -u \"[api key]:[api secret]\" \\\nhttps://api.goroost.com/api/stats/notifications?count=50", "language": "shell" } ], "sidebar": true } [/block] Example 3: Get notifications 51-75. [block:code] { "codes": [ { "code": "# Notifications Example 3\n\ncurl -X GET -u \"[api key]:[api secret]\" \\\nhttps://api.goroost.com/api/stats/notifications?count=25&offset=50", "language": "shell" } ], "sidebar": true } [/block] **Try the examples on the right. ** Use your own **[API Key]** and **[API Secret]**.
Use the **notifications** command to retrieve a list of notifications. Example 1: Get last 10 notifications. 10 is the default number fetched. [block:code] { "codes": [ { "code": "# Notifications Example 1\n\ncurl -X GET -u \"[api key]:[api secret]\" \\\nhttps://api.goroost.com/api/stats/notifications ", "language": "shell" } ], "sidebar": true } [/block] Example 2: Get last 50 notifications. [block:code] { "codes": [ { "code": "# Notifications Example 2\n\ncurl -X GET -u \"[api key]:[api secret]\" \\\nhttps://api.goroost.com/api/stats/notifications?count=50", "language": "shell" } ], "sidebar": true } [/block] Example 3: Get notifications 51-75. [block:code] { "codes": [ { "code": "# Notifications Example 3\n\ncurl -X GET -u \"[api key]:[api secret]\" \\\nhttps://api.goroost.com/api/stats/notifications?count=25&offset=50", "language": "shell" } ], "sidebar": true } [/block] **Try the examples on the right. ** Use your own **[API Key]** and **[API Secret]**.
{"__v":2,"_id":"54f4de7e86a4e40d00375789","api":{"auth":"required","params":[],"results":{"codes":[{"status":200,"language":"json","code":"{}","name":""},{"status":400,"language":"json","code":"{}","name":""}]},"url":""},"body":"[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Call\"\n}\n[/block]\n\n[block:parameters]\n{\n  \"data\": {\n    \"0-0\": \"URL\",\n    \"0-1\": \"https://api.goroost.com/api/stats/notifications\",\n    \"1-0\": \"HTTP Auth\",\n    \"1-1\": \"YES [(see Authentication)](doc:authentication)\"\n  },\n  \"cols\": 2,\n  \"rows\": 2\n}\n[/block]\nThe Roost **notifications** method requires an HTTP GET request.\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Arguments\"\n}\n[/block]\nREQUIRED ARGMENTS\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"Parameter\",\n    \"h-1\": \"Description\",\n    \"h-2\": \"Description\",\n    \"0-0\": \"(notification id)\",\n    \"0-1\": \"Append '/' followed by the notification id to retrieve a single, particular notification.\"\n  },\n  \"cols\": 2,\n  \"rows\": 1\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Return Value\"\n}\n[/block]\nOn success, returns stats and information for a single notification in a JSON structure as shown below.\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"{\\n\\t\\\"id\\\":8362271,\\n\\t\\\"sent\\\":\\\"2014-10-22T15:10:04Z\\\",\\n\\t\\\"stats\\\":\\n\\t\\t{\\n\\t\\t\\t\\\"reads\\\":0,\\n\\t\\t\\t\\\"sends\\\":23\\n\\t\\t},\\n\\t\\\"alert\\\":\\\"Don’t Overpay, Get Third Party RAM Upgrades for the Retina iMac\\\",\\n\\t\\\"url\\\":\\\"http://www.tekrevue.com/third-party-ram-upgrades-retina-imac/\\\"\\n}\",\n      \"language\": \"shell\"\n    }\n  ]\n}\n[/block]","category":"54f4de695bc4e91700f9ff98","createdAt":"2015-03-02T22:04:46.894Z","excerpt":"Use the Roost **notifications** call to retrieve a specific notification by id.","githubsync":"","hidden":false,"link_external":false,"link_url":"","order":0,"project":"54ed111fa45a441700fd4cf6","slug":"specification-3","sync_unique":"","title":"Specification","type":"basic","updates":[],"user":"54ed0ffea45a441700fd4cf0","version":"54ed1120a45a441700fd4cf9"}

Specification

Use the Roost **notifications** call to retrieve a specific notification by id.

[block:api-header] { "type": "basic", "title": "Call" } [/block] [block:parameters] { "data": { "0-0": "URL", "0-1": "https://api.goroost.com/api/stats/notifications", "1-0": "HTTP Auth", "1-1": "YES [(see Authentication)](doc:authentication)" }, "cols": 2, "rows": 2 } [/block] The Roost **notifications** method requires an HTTP GET request. [block:api-header] { "type": "basic", "title": "Arguments" } [/block] REQUIRED ARGMENTS [block:parameters] { "data": { "h-0": "Parameter", "h-1": "Description", "h-2": "Description", "0-0": "(notification id)", "0-1": "Append '/' followed by the notification id to retrieve a single, particular notification." }, "cols": 2, "rows": 1 } [/block] [block:api-header] { "type": "basic", "title": "Return Value" } [/block] On success, returns stats and information for a single notification in a JSON structure as shown below. [block:code] { "codes": [ { "code": "{\n\t\"id\":8362271,\n\t\"sent\":\"2014-10-22T15:10:04Z\",\n\t\"stats\":\n\t\t{\n\t\t\t\"reads\":0,\n\t\t\t\"sends\":23\n\t\t},\n\t\"alert\":\"Don’t Overpay, Get Third Party RAM Upgrades for the Retina iMac\",\n\t\"url\":\"http://www.tekrevue.com/third-party-ram-upgrades-retina-imac/\"\n}", "language": "shell" } ] } [/block]
[block:api-header] { "type": "basic", "title": "Call" } [/block] [block:parameters] { "data": { "0-0": "URL", "0-1": "https://api.goroost.com/api/stats/notifications", "1-0": "HTTP Auth", "1-1": "YES [(see Authentication)](doc:authentication)" }, "cols": 2, "rows": 2 } [/block] The Roost **notifications** method requires an HTTP GET request. [block:api-header] { "type": "basic", "title": "Arguments" } [/block] REQUIRED ARGMENTS [block:parameters] { "data": { "h-0": "Parameter", "h-1": "Description", "h-2": "Description", "0-0": "(notification id)", "0-1": "Append '/' followed by the notification id to retrieve a single, particular notification." }, "cols": 2, "rows": 1 } [/block] [block:api-header] { "type": "basic", "title": "Return Value" } [/block] On success, returns stats and information for a single notification in a JSON structure as shown below. [block:code] { "codes": [ { "code": "{\n\t\"id\":8362271,\n\t\"sent\":\"2014-10-22T15:10:04Z\",\n\t\"stats\":\n\t\t{\n\t\t\t\"reads\":0,\n\t\t\t\"sends\":23\n\t\t},\n\t\"alert\":\"Don’t Overpay, Get Third Party RAM Upgrades for the Retina iMac\",\n\t\"url\":\"http://www.tekrevue.com/third-party-ram-upgrades-retina-imac/\"\n}", "language": "shell" } ] } [/block]
{"__v":8,"_id":"54f4dbc2e4dd350d00e65b2b","api":{"auth":"required","params":[],"results":{"codes":[{"status":200,"language":"json","code":"{}","name":""},{"status":400,"language":"json","code":"{}","name":""}]},"url":""},"body":"Use the **notifications** command to retrieve a specific notification by appending a **'/' **and the **notification id**.\n\nExample 1:  Retrieve a particular notification (#3392910)\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"# Specific Notification Example 1\\n\\ncurl -X GET -u \\\"[api key]:[api secret]\\\" \\\\\\nhttps://api.goroost.com/api/stats/notifications/3392910\",\n      \"language\": \"shell\"\n    }\n  ],\n  \"sidebar\": true\n}\n[/block]\n**Try the example on the right. ** Use your own **[API Key]** and **[API Secret]** and **notification id**.","category":"54f4de695bc4e91700f9ff98","createdAt":"2015-03-02T21:53:06.348Z","excerpt":"","githubsync":"","hidden":false,"link_external":false,"link_url":"","order":1,"project":"54ed111fa45a441700fd4cf6","slug":"retrieving-a-particular-notification","sync_unique":"","title":"Retrieving a Notification","type":"basic","updates":[],"user":"54ed0ffea45a441700fd4cf0","version":"54ed1120a45a441700fd4cf9"}

Retrieving a Notification


Use the **notifications** command to retrieve a specific notification by appending a **'/' **and the **notification id**. Example 1: Retrieve a particular notification (#3392910) [block:code] { "codes": [ { "code": "# Specific Notification Example 1\n\ncurl -X GET -u \"[api key]:[api secret]\" \\\nhttps://api.goroost.com/api/stats/notifications/3392910", "language": "shell" } ], "sidebar": true } [/block] **Try the example on the right. ** Use your own **[API Key]** and **[API Secret]** and **notification id**.
Use the **notifications** command to retrieve a specific notification by appending a **'/' **and the **notification id**. Example 1: Retrieve a particular notification (#3392910) [block:code] { "codes": [ { "code": "# Specific Notification Example 1\n\ncurl -X GET -u \"[api key]:[api secret]\" \\\nhttps://api.goroost.com/api/stats/notifications/3392910", "language": "shell" } ], "sidebar": true } [/block] **Try the example on the right. ** Use your own **[API Key]** and **[API Secret]** and **notification id**.
{"__v":4,"_id":"54f4e18186a4e40d0037578f","api":{"auth":"required","params":[],"results":{"codes":[{"status":200,"language":"json","code":"{}","name":""},{"status":400,"language":"json","code":"{}","name":""}]},"url":""},"body":"[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Call\"\n}\n[/block]\n\n[block:parameters]\n{\n  \"data\": {\n    \"0-0\": \"URL\",\n    \"0-1\": \"https://api.goroost.com/api/stats/segments\",\n    \"1-0\": \"HTTP Auth\",\n    \"1-1\": \"YES [(see Authentication)](doc:authentication)\"\n  },\n  \"cols\": 2,\n  \"rows\": 2\n}\n[/block]\nThe Roost **segments** method requires an HTTP GET request.\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Arguments\"\n}\n[/block]\nOPTIONAL ARGMENTS\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"Parameter\",\n    \"h-1\": \"Description\",\n    \"h-2\": \"Description\",\n    \"0-0\": \"count\",\n    \"1-0\": \"offset\",\n    \"0-1\": \"The number of notifications to be returned in descending chronological order from the current time.\",\n    \"1-1\": \"The number of notifications to skip when retrieving a list of notifications.\"\n  },\n  \"cols\": 2,\n  \"rows\": 2\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Return Value\"\n}\n[/block]\nOn success, returns stats and information for notifications in descending order in a JSON structure as shown below. Default is 10 notifications.\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"{\\n\\t\\\"segments\\\":[\\n\\t\\t{\\n\\t\\t\\t\\\"name\\\":\\\"Men\\\",\\n\\t\\t\\t\\\"stats\\\":\\n\\t\\t\\t\\t{\\n\\t\\t\\t\\t\\t\\\"reads\\\":0,\\n\\t\\t\\t\\t\\t\\\"notifications\\\":0,\\n\\t\\t\\t\\t\\t\\\"subscribers\\\":0\\n\\t\\t\\t\\t}\\n\\t\\t},\\n\\t\\t{\\n\\t\\t\\t\\\"name\\\":\\\"Women\\\",\\n\\t\\t\\t\\\"stats\\\":\\n\\t\\t\\t\\t{\\n\\t\\t\\t\\t\\t\\\"reads\\\":0,\\n\\t\\t\\t\\t\\t\\\"notifications\\\":0,\\n\\t\\t\\t\\t\\t\\\"subscribers\\\":0\\n\\t\\t\\t\\t}\\n\\t\\t}\\n\\t]\\n}\",\n      \"language\": \"shell\"\n    }\n  ]\n}\n[/block]","category":"54f4e13b5bc4e91700f9ffa3","createdAt":"2015-03-02T22:17:37.891Z","excerpt":"Use the Roost **segments** call to retrieve a list of all segments.","githubsync":"","hidden":false,"link_external":false,"link_url":"","order":0,"project":"54ed111fa45a441700fd4cf6","slug":"specification-4","sync_unique":"","title":"Specification","type":"basic","updates":[],"user":"54ed0ffea45a441700fd4cf0","version":"54ed1120a45a441700fd4cf9"}

Specification

Use the Roost **segments** call to retrieve a list of all segments.

[block:api-header] { "type": "basic", "title": "Call" } [/block] [block:parameters] { "data": { "0-0": "URL", "0-1": "https://api.goroost.com/api/stats/segments", "1-0": "HTTP Auth", "1-1": "YES [(see Authentication)](doc:authentication)" }, "cols": 2, "rows": 2 } [/block] The Roost **segments** method requires an HTTP GET request. [block:api-header] { "type": "basic", "title": "Arguments" } [/block] OPTIONAL ARGMENTS [block:parameters] { "data": { "h-0": "Parameter", "h-1": "Description", "h-2": "Description", "0-0": "count", "1-0": "offset", "0-1": "The number of notifications to be returned in descending chronological order from the current time.", "1-1": "The number of notifications to skip when retrieving a list of notifications." }, "cols": 2, "rows": 2 } [/block] [block:api-header] { "type": "basic", "title": "Return Value" } [/block] On success, returns stats and information for notifications in descending order in a JSON structure as shown below. Default is 10 notifications. [block:code] { "codes": [ { "code": "{\n\t\"segments\":[\n\t\t{\n\t\t\t\"name\":\"Men\",\n\t\t\t\"stats\":\n\t\t\t\t{\n\t\t\t\t\t\"reads\":0,\n\t\t\t\t\t\"notifications\":0,\n\t\t\t\t\t\"subscribers\":0\n\t\t\t\t}\n\t\t},\n\t\t{\n\t\t\t\"name\":\"Women\",\n\t\t\t\"stats\":\n\t\t\t\t{\n\t\t\t\t\t\"reads\":0,\n\t\t\t\t\t\"notifications\":0,\n\t\t\t\t\t\"subscribers\":0\n\t\t\t\t}\n\t\t}\n\t]\n}", "language": "shell" } ] } [/block]
[block:api-header] { "type": "basic", "title": "Call" } [/block] [block:parameters] { "data": { "0-0": "URL", "0-1": "https://api.goroost.com/api/stats/segments", "1-0": "HTTP Auth", "1-1": "YES [(see Authentication)](doc:authentication)" }, "cols": 2, "rows": 2 } [/block] The Roost **segments** method requires an HTTP GET request. [block:api-header] { "type": "basic", "title": "Arguments" } [/block] OPTIONAL ARGMENTS [block:parameters] { "data": { "h-0": "Parameter", "h-1": "Description", "h-2": "Description", "0-0": "count", "1-0": "offset", "0-1": "The number of notifications to be returned in descending chronological order from the current time.", "1-1": "The number of notifications to skip when retrieving a list of notifications." }, "cols": 2, "rows": 2 } [/block] [block:api-header] { "type": "basic", "title": "Return Value" } [/block] On success, returns stats and information for notifications in descending order in a JSON structure as shown below. Default is 10 notifications. [block:code] { "codes": [ { "code": "{\n\t\"segments\":[\n\t\t{\n\t\t\t\"name\":\"Men\",\n\t\t\t\"stats\":\n\t\t\t\t{\n\t\t\t\t\t\"reads\":0,\n\t\t\t\t\t\"notifications\":0,\n\t\t\t\t\t\"subscribers\":0\n\t\t\t\t}\n\t\t},\n\t\t{\n\t\t\t\"name\":\"Women\",\n\t\t\t\"stats\":\n\t\t\t\t{\n\t\t\t\t\t\"reads\":0,\n\t\t\t\t\t\"notifications\":0,\n\t\t\t\t\t\"subscribers\":0\n\t\t\t\t}\n\t\t}\n\t]\n}", "language": "shell" } ] } [/block]
{"__v":4,"_id":"54f4e19e82c14123009f40a5","api":{"auth":"required","params":[],"results":{"codes":[{"status":200,"language":"json","code":"{}","name":""},{"status":400,"language":"json","code":"{}","name":""}]},"url":""},"body":"Use the **segments** command to retrieve a list of notifications.\n\nExample 1:  Get last 10 segments created.  10 is the default number fetched.\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"# Notifications Example 1\\n\\ncurl -X GET -u \\\"[api key]:[api secret]\\\" \\\\\\nhttps://api.goroost.com/api/stats/segments \",\n      \"language\": \"shell\"\n    }\n  ],\n  \"sidebar\": true\n}\n[/block]\nExample 2: Get last 40 segments.\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"# Notifications Example 2\\n\\ncurl -X GET -u \\\"[api key]:[api secret]\\\" \\\\\\nhttps://api.goroost.com/api/stats/segments?count=40\",\n      \"language\": \"shell\"\n    }\n  ],\n  \"sidebar\": true\n}\n[/block]\nExample 3: Get segments 11-30.\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"# Notifications Example 3\\n\\ncurl -X GET -u \\\"[api key]:[api secret]\\\" \\\\\\nhttps://api.goroost.com/api/stats/segments?count=20&offset=10\",\n      \"language\": \"shell\"\n    }\n  ],\n  \"sidebar\": true\n}\n[/block]\n**Try the examples on the right. ** Use your own **[API Key]** and **[API Secret]**.","category":"54f4e13b5bc4e91700f9ffa3","createdAt":"2015-03-02T22:18:06.057Z","excerpt":"","githubsync":"","hidden":false,"link_external":false,"link_url":"","order":1,"project":"54ed111fa45a441700fd4cf6","slug":"retrieving-segments","sync_unique":"","title":"Retrieving Segments","type":"basic","updates":[],"user":"54ed0ffea45a441700fd4cf0","version":"54ed1120a45a441700fd4cf9"}

Retrieving Segments


Use the **segments** command to retrieve a list of notifications. Example 1: Get last 10 segments created. 10 is the default number fetched. [block:code] { "codes": [ { "code": "# Notifications Example 1\n\ncurl -X GET -u \"[api key]:[api secret]\" \\\nhttps://api.goroost.com/api/stats/segments ", "language": "shell" } ], "sidebar": true } [/block] Example 2: Get last 40 segments. [block:code] { "codes": [ { "code": "# Notifications Example 2\n\ncurl -X GET -u \"[api key]:[api secret]\" \\\nhttps://api.goroost.com/api/stats/segments?count=40", "language": "shell" } ], "sidebar": true } [/block] Example 3: Get segments 11-30. [block:code] { "codes": [ { "code": "# Notifications Example 3\n\ncurl -X GET -u \"[api key]:[api secret]\" \\\nhttps://api.goroost.com/api/stats/segments?count=20&offset=10", "language": "shell" } ], "sidebar": true } [/block] **Try the examples on the right. ** Use your own **[API Key]** and **[API Secret]**.
Use the **segments** command to retrieve a list of notifications. Example 1: Get last 10 segments created. 10 is the default number fetched. [block:code] { "codes": [ { "code": "# Notifications Example 1\n\ncurl -X GET -u \"[api key]:[api secret]\" \\\nhttps://api.goroost.com/api/stats/segments ", "language": "shell" } ], "sidebar": true } [/block] Example 2: Get last 40 segments. [block:code] { "codes": [ { "code": "# Notifications Example 2\n\ncurl -X GET -u \"[api key]:[api secret]\" \\\nhttps://api.goroost.com/api/stats/segments?count=40", "language": "shell" } ], "sidebar": true } [/block] Example 3: Get segments 11-30. [block:code] { "codes": [ { "code": "# Notifications Example 3\n\ncurl -X GET -u \"[api key]:[api secret]\" \\\nhttps://api.goroost.com/api/stats/segments?count=20&offset=10", "language": "shell" } ], "sidebar": true } [/block] **Try the examples on the right. ** Use your own **[API Key]** and **[API Secret]**.
{"__v":2,"_id":"54f4e22d58e9df0d00917b20","api":{"auth":"required","params":[],"results":{"codes":[{"status":200,"language":"json","code":"{}","name":""},{"status":400,"language":"json","code":"{}","name":""}]},"url":""},"body":"[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Call\"\n}\n[/block]\n\n[block:parameters]\n{\n  \"data\": {\n    \"0-0\": \"URL\",\n    \"0-1\": \"https://api.goroost.com/api/stats/notifications\",\n    \"1-0\": \"HTTP Auth\",\n    \"1-1\": \"YES [(see Authentication)](doc:authentication)\"\n  },\n  \"cols\": 2,\n  \"rows\": 2\n}\n[/block]\nThe Roost **segments** method requires an HTTP GET request.\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Arguments\"\n}\n[/block]\nREQUIRED ARGMENTS\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"Parameter\",\n    \"h-1\": \"Description\",\n    \"h-2\": \"Description\",\n    \"0-0\": \"<segment name>\",\n    \"0-1\": \"Append '/' followed by the segment name to retrieve a single, particular notification.\"\n  },\n  \"cols\": 2,\n  \"rows\": 1\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Return Value\"\n}\n[/block]\nOn success, returns stats and information for a single segment in a JSON structure as shown below.\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"{\\n\\t\\\"name\\\":\\\"iOS\\\",\\n\\t\\\"stats\\\":\\n\\t\\t{\\n\\t\\t\\t\\\"reads\\\":0,\\n\\t\\t\\t\\\"notifications\\\":0,\\n\\t\\t\\t\\\"subscribers\\\":0\\n\\t\\t}\\n}\",\n      \"language\": \"shell\"\n    }\n  ]\n}\n[/block]","category":"54f4e21058e9df0d00917b1e","createdAt":"2015-03-02T22:20:29.852Z","excerpt":"Use the Roost **segments** call to retrieve a specific notification by id.","githubsync":"","hidden":false,"link_external":false,"link_url":"","order":0,"project":"54ed111fa45a441700fd4cf6","slug":"specification-5","sync_unique":"","title":"Specification","type":"basic","updates":[],"user":"54ed0ffea45a441700fd4cf0","version":"54ed1120a45a441700fd4cf9"}

Specification

Use the Roost **segments** call to retrieve a specific notification by id.

[block:api-header] { "type": "basic", "title": "Call" } [/block] [block:parameters] { "data": { "0-0": "URL", "0-1": "https://api.goroost.com/api/stats/notifications", "1-0": "HTTP Auth", "1-1": "YES [(see Authentication)](doc:authentication)" }, "cols": 2, "rows": 2 } [/block] The Roost **segments** method requires an HTTP GET request. [block:api-header] { "type": "basic", "title": "Arguments" } [/block] REQUIRED ARGMENTS [block:parameters] { "data": { "h-0": "Parameter", "h-1": "Description", "h-2": "Description", "0-0": "<segment name>", "0-1": "Append '/' followed by the segment name to retrieve a single, particular notification." }, "cols": 2, "rows": 1 } [/block] [block:api-header] { "type": "basic", "title": "Return Value" } [/block] On success, returns stats and information for a single segment in a JSON structure as shown below. [block:code] { "codes": [ { "code": "{\n\t\"name\":\"iOS\",\n\t\"stats\":\n\t\t{\n\t\t\t\"reads\":0,\n\t\t\t\"notifications\":0,\n\t\t\t\"subscribers\":0\n\t\t}\n}", "language": "shell" } ] } [/block]
[block:api-header] { "type": "basic", "title": "Call" } [/block] [block:parameters] { "data": { "0-0": "URL", "0-1": "https://api.goroost.com/api/stats/notifications", "1-0": "HTTP Auth", "1-1": "YES [(see Authentication)](doc:authentication)" }, "cols": 2, "rows": 2 } [/block] The Roost **segments** method requires an HTTP GET request. [block:api-header] { "type": "basic", "title": "Arguments" } [/block] REQUIRED ARGMENTS [block:parameters] { "data": { "h-0": "Parameter", "h-1": "Description", "h-2": "Description", "0-0": "<segment name>", "0-1": "Append '/' followed by the segment name to retrieve a single, particular notification." }, "cols": 2, "rows": 1 } [/block] [block:api-header] { "type": "basic", "title": "Return Value" } [/block] On success, returns stats and information for a single segment in a JSON structure as shown below. [block:code] { "codes": [ { "code": "{\n\t\"name\":\"iOS\",\n\t\"stats\":\n\t\t{\n\t\t\t\"reads\":0,\n\t\t\t\"notifications\":0,\n\t\t\t\"subscribers\":0\n\t\t}\n}", "language": "shell" } ] } [/block]
{"__v":3,"_id":"54f4e247e4dd350d00e65b40","api":{"auth":"required","params":[],"results":{"codes":[{"status":200,"language":"json","code":"{}","name":""},{"status":400,"language":"json","code":"{}","name":""}]},"url":""},"body":"Use the **segments** command to retrieve a specific notification by appending a **'/' **and the **segment name**.\n\nExample 1:  Retrieve a particular segment (Sports)\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"# Specific Notification Example 1\\n\\ncurl -X GET -u \\\"[api key]:[api secret]\\\" \\\\\\nhttps://api.goroost.com/api/stats/notifications/Sports\",\n      \"language\": \"shell\"\n    }\n  ],\n  \"sidebar\": true\n}\n[/block]\n**Try the example on the right. ** Use your own **[API Key]** and **[API Secret]** and **segment name**.","category":"54f4e21058e9df0d00917b1e","createdAt":"2015-03-02T22:20:55.064Z","excerpt":"","githubsync":"","hidden":false,"link_external":false,"link_url":"","order":1,"project":"54ed111fa45a441700fd4cf6","slug":"retrieving-a-segment","sync_unique":"","title":"Retrieving a Segment","type":"basic","updates":[],"user":"54ed0ffea45a441700fd4cf0","version":"54ed1120a45a441700fd4cf9"}

Retrieving a Segment


Use the **segments** command to retrieve a specific notification by appending a **'/' **and the **segment name**. Example 1: Retrieve a particular segment (Sports) [block:code] { "codes": [ { "code": "# Specific Notification Example 1\n\ncurl -X GET -u \"[api key]:[api secret]\" \\\nhttps://api.goroost.com/api/stats/notifications/Sports", "language": "shell" } ], "sidebar": true } [/block] **Try the example on the right. ** Use your own **[API Key]** and **[API Secret]** and **segment name**.
Use the **segments** command to retrieve a specific notification by appending a **'/' **and the **segment name**. Example 1: Retrieve a particular segment (Sports) [block:code] { "codes": [ { "code": "# Specific Notification Example 1\n\ncurl -X GET -u \"[api key]:[api secret]\" \\\nhttps://api.goroost.com/api/stats/notifications/Sports", "language": "shell" } ], "sidebar": true } [/block] **Try the example on the right. ** Use your own **[API Key]** and **[API Secret]** and **segment name**.
{"__v":3,"_id":"54f4f30582c14123009f40c2","api":{"auth":"required","params":[],"results":{"codes":[{"status":200,"language":"json","code":"{}","name":""},{"status":400,"language":"json","code":"{}","name":""}]},"url":""},"body":"[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Call\"\n}\n[/block]\nThe **device_tokens** call will fetch 250 tokens.  \n[block:parameters]\n{\n  \"data\": {\n    \"0-0\": \"URL\",\n    \"0-1\": \"https://api.goroost.com/api/device_tokens\",\n    \"1-0\": \"HTTP Auth\",\n    \"1-1\": \"YES [(see Authentication)](doc:authentication)\"\n  },\n  \"cols\": 2,\n  \"rows\": 2\n}\n[/block]\nThe Roost **device_tokens** method requires an HTTP GET request.\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Arguments\"\n}\n[/block]\nOPTIONAL ARGMENTS\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"Parameter\",\n    \"h-1\": \"Description\",\n    \"h-2\": \"Description\",\n    \"0-0\": \"count\",\n    \"1-0\": \"offset\",\n    \"0-1\": \"The number of notifications to be returned in descending chronological order from the current time.\",\n    \"1-1\": \"The number of notifications to skip when retrieving a list of notifications.\",\n    \"2-0\": \"next\",\n    \"2-1\": \"Integer value indicating offset from the beginning of the list.  250 tokens will be fetched after this number has been skipped.\"\n  },\n  \"cols\": 2,\n  \"rows\": 3\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Return Value\"\n}\n[/block]\nOn success, returns device token information for (up to) 250 tokens.\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"{\\n   \\\"success\\\":true,\\n   \\\"registrations\\\":[\\n      {\\n         \\\"segments\\\":[\\n            \\\"tagtwo\\\",\\n            \\\"tagone\\\"\\n         ],\\n         \\\"enabled\\\":true,\\n         \\\"device_token\\\":\\n            \\\"8725AAED7938F52C67DF6B4162856CD492B37DEC99771423768ABE385B4ABDA8\\\",\\n         \\\"badge\\\":0\\n      }\\n   ]\\n}\",\n      \"language\": \"shell\"\n    }\n  ]\n}\n[/block]","category":"54f4e9de86a4e40d0037579c","createdAt":"2015-03-02T23:32:21.402Z","excerpt":"Use the Roost **device_tokens** call to retrieve a list of device_tokens.","githubsync":"","hidden":false,"link_external":false,"link_url":"","order":0,"project":"54ed111fa45a441700fd4cf6","slug":"specification-6","sync_unique":"","title":"Specification","type":"basic","updates":[],"user":"54ed0ffea45a441700fd4cf0","version":"54ed1120a45a441700fd4cf9"}

Specification

Use the Roost **device_tokens** call to retrieve a list of device_tokens.

[block:api-header] { "type": "basic", "title": "Call" } [/block] The **device_tokens** call will fetch 250 tokens. [block:parameters] { "data": { "0-0": "URL", "0-1": "https://api.goroost.com/api/device_tokens", "1-0": "HTTP Auth", "1-1": "YES [(see Authentication)](doc:authentication)" }, "cols": 2, "rows": 2 } [/block] The Roost **device_tokens** method requires an HTTP GET request. [block:api-header] { "type": "basic", "title": "Arguments" } [/block] OPTIONAL ARGMENTS [block:parameters] { "data": { "h-0": "Parameter", "h-1": "Description", "h-2": "Description", "0-0": "count", "1-0": "offset", "0-1": "The number of notifications to be returned in descending chronological order from the current time.", "1-1": "The number of notifications to skip when retrieving a list of notifications.", "2-0": "next", "2-1": "Integer value indicating offset from the beginning of the list. 250 tokens will be fetched after this number has been skipped." }, "cols": 2, "rows": 3 } [/block] [block:api-header] { "type": "basic", "title": "Return Value" } [/block] On success, returns device token information for (up to) 250 tokens. [block:code] { "codes": [ { "code": "{\n \"success\":true,\n \"registrations\":[\n {\n \"segments\":[\n \"tagtwo\",\n \"tagone\"\n ],\n \"enabled\":true,\n \"device_token\":\n \"8725AAED7938F52C67DF6B4162856CD492B37DEC99771423768ABE385B4ABDA8\",\n \"badge\":0\n }\n ]\n}", "language": "shell" } ] } [/block]
[block:api-header] { "type": "basic", "title": "Call" } [/block] The **device_tokens** call will fetch 250 tokens. [block:parameters] { "data": { "0-0": "URL", "0-1": "https://api.goroost.com/api/device_tokens", "1-0": "HTTP Auth", "1-1": "YES [(see Authentication)](doc:authentication)" }, "cols": 2, "rows": 2 } [/block] The Roost **device_tokens** method requires an HTTP GET request. [block:api-header] { "type": "basic", "title": "Arguments" } [/block] OPTIONAL ARGMENTS [block:parameters] { "data": { "h-0": "Parameter", "h-1": "Description", "h-2": "Description", "0-0": "count", "1-0": "offset", "0-1": "The number of notifications to be returned in descending chronological order from the current time.", "1-1": "The number of notifications to skip when retrieving a list of notifications.", "2-0": "next", "2-1": "Integer value indicating offset from the beginning of the list. 250 tokens will be fetched after this number has been skipped." }, "cols": 2, "rows": 3 } [/block] [block:api-header] { "type": "basic", "title": "Return Value" } [/block] On success, returns device token information for (up to) 250 tokens. [block:code] { "codes": [ { "code": "{\n \"success\":true,\n \"registrations\":[\n {\n \"segments\":[\n \"tagtwo\",\n \"tagone\"\n ],\n \"enabled\":true,\n \"device_token\":\n \"8725AAED7938F52C67DF6B4162856CD492B37DEC99771423768ABE385B4ABDA8\",\n \"badge\":0\n }\n ]\n}", "language": "shell" } ] } [/block]
{"__v":4,"_id":"54f4f31d86a4e40d003757a4","api":{"auth":"required","params":[],"results":{"codes":[{"status":200,"language":"json","code":"{}","name":""},{"status":400,"language":"json","code":"{}","name":""}]},"url":""},"body":"Use the **device_tokens** command to retrieve a list of notifications.\n\nExample 1:  Get most recent 250 device tokens\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"# Notifications Example 1\\n\\ncurl -X GET -u \\\"[api key]:[api secret]\\\" \\\\\\nhttps://api.goroost.com/api/device_tokens \",\n      \"language\": \"shell\"\n    }\n  ],\n  \"sidebar\": true\n}\n[/block]\nExample 2: Get device tokens 1001-1250\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"# Notifications Example 2\\n\\ncurl -X GET -u \\\"[api key]:[api secret]\\\" \\\\\\nhttps://api.goroost.com/api/device_tokens?next=1000\",\n      \"language\": \"shell\"\n    }\n  ],\n  \"sidebar\": true\n}\n[/block]","category":"54f4e9de86a4e40d0037579c","createdAt":"2015-03-02T23:32:45.156Z","excerpt":"","githubsync":"","hidden":false,"link_external":false,"link_url":"","order":1,"project":"54ed111fa45a441700fd4cf6","slug":"retrieving-device-tokens","sync_unique":"","title":"Retrieving Device Tokens","type":"basic","updates":[],"user":"54ed0ffea45a441700fd4cf0","version":"54ed1120a45a441700fd4cf9"}

Retrieving Device Tokens


Use the **device_tokens** command to retrieve a list of notifications. Example 1: Get most recent 250 device tokens [block:code] { "codes": [ { "code": "# Notifications Example 1\n\ncurl -X GET -u \"[api key]:[api secret]\" \\\nhttps://api.goroost.com/api/device_tokens ", "language": "shell" } ], "sidebar": true } [/block] Example 2: Get device tokens 1001-1250 [block:code] { "codes": [ { "code": "# Notifications Example 2\n\ncurl -X GET -u \"[api key]:[api secret]\" \\\nhttps://api.goroost.com/api/device_tokens?next=1000", "language": "shell" } ], "sidebar": true } [/block]
Use the **device_tokens** command to retrieve a list of notifications. Example 1: Get most recent 250 device tokens [block:code] { "codes": [ { "code": "# Notifications Example 1\n\ncurl -X GET -u \"[api key]:[api secret]\" \\\nhttps://api.goroost.com/api/device_tokens ", "language": "shell" } ], "sidebar": true } [/block] Example 2: Get device tokens 1001-1250 [block:code] { "codes": [ { "code": "# Notifications Example 2\n\ncurl -X GET -u \"[api key]:[api secret]\" \\\nhttps://api.goroost.com/api/device_tokens?next=1000", "language": "shell" } ], "sidebar": true } [/block]
{"__v":2,"_id":"54f5ae8b8dadef0d001186f9","api":{"auth":"required","params":[],"results":{"codes":[{"status":200,"language":"json","code":"{}","name":""},{"status":400,"language":"json","code":"{}","name":""}]},"url":""},"body":"[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Call\"\n}\n[/block]\nThe **feedback** call will fetch up to 250 native feedback records in a JSON structure.  \n[block:parameters]\n{\n  \"data\": {\n    \"0-0\": \"URL\",\n    \"0-1\": \"https://api.goroost.com/api/feedback\",\n    \"1-0\": \"HTTP Auth\",\n    \"1-1\": \"YES [(see Authentication)](doc:authentication)\"\n  },\n  \"cols\": 2,\n  \"rows\": 2\n}\n[/block]\nThe Roost **device_tokens** method requires an HTTP GET request.\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Arguments\"\n}\n[/block]\nOPTIONAL ARGMENTS\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"Parameter\",\n    \"h-1\": \"Description\",\n    \"h-2\": \"Description\",\n    \"0-0\": \"since\",\n    \"0-1\": \"ISO8601 Timestamp.  Specifies the starting point at which you want native feedback information.  Feedback will be sent from that time through the present.\",\n    \"1-0\": \"next\",\n    \"1-1\": \"Integer that specifies the number of native feedback records to skip.  This is a paging mechanism.\"\n  },\n  \"cols\": 2,\n  \"rows\": 2\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Return Value\"\n}\n[/block]\nOn success, returns 250 feedback records from native devices in a JSON structure.\n\nIf there are more than 250 records, then a \"next_page\" parameter will be returned as part of the JSON object, which includes the number to skip to get the next page of records.\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"{\\n   \\\"success\\\":true,\\n   \\\"registrations\\\":[\\n      {\\n         \\\"segments\\\":[\\n           \\\"tagtwo\\\",\\n            \\\"tagone\\\"\\n         ],\\n         \\\"enabled\\\":false,\\n         \\\"device_token\\\": \\n            \\\"8725AAED7938F52C67DF6B4162856CD492B37DEC99771423768ABE385B4ABDA8\\\",\\n         \\\"badge\\\":0}\\n      }\\n   ]\\n}\\n\",\n      \"language\": \"shell\"\n    }\n  ]\n}\n[/block]","category":"54f5ae5c58e9df0d00917bec","createdAt":"2015-03-03T12:52:27.713Z","excerpt":"Use the Roost **feedback** call to retrieve a list of device_tokens.","githubsync":"","hidden":false,"link_external":false,"link_url":"","order":0,"project":"54ed111fa45a441700fd4cf6","slug":"specification-7","sync_unique":"","title":"Specification","type":"basic","updates":[],"user":"54ed0ffea45a441700fd4cf0","version":"54ed1120a45a441700fd4cf9"}

Specification

Use the Roost **feedback** call to retrieve a list of device_tokens.

[block:api-header] { "type": "basic", "title": "Call" } [/block] The **feedback** call will fetch up to 250 native feedback records in a JSON structure. [block:parameters] { "data": { "0-0": "URL", "0-1": "https://api.goroost.com/api/feedback", "1-0": "HTTP Auth", "1-1": "YES [(see Authentication)](doc:authentication)" }, "cols": 2, "rows": 2 } [/block] The Roost **device_tokens** method requires an HTTP GET request. [block:api-header] { "type": "basic", "title": "Arguments" } [/block] OPTIONAL ARGMENTS [block:parameters] { "data": { "h-0": "Parameter", "h-1": "Description", "h-2": "Description", "0-0": "since", "0-1": "ISO8601 Timestamp. Specifies the starting point at which you want native feedback information. Feedback will be sent from that time through the present.", "1-0": "next", "1-1": "Integer that specifies the number of native feedback records to skip. This is a paging mechanism." }, "cols": 2, "rows": 2 } [/block] [block:api-header] { "type": "basic", "title": "Return Value" } [/block] On success, returns 250 feedback records from native devices in a JSON structure. If there are more than 250 records, then a "next_page" parameter will be returned as part of the JSON object, which includes the number to skip to get the next page of records. [block:code] { "codes": [ { "code": "{\n \"success\":true,\n \"registrations\":[\n {\n \"segments\":[\n \"tagtwo\",\n \"tagone\"\n ],\n \"enabled\":false,\n \"device_token\": \n \"8725AAED7938F52C67DF6B4162856CD492B37DEC99771423768ABE385B4ABDA8\",\n \"badge\":0}\n }\n ]\n}\n", "language": "shell" } ] } [/block]
[block:api-header] { "type": "basic", "title": "Call" } [/block] The **feedback** call will fetch up to 250 native feedback records in a JSON structure. [block:parameters] { "data": { "0-0": "URL", "0-1": "https://api.goroost.com/api/feedback", "1-0": "HTTP Auth", "1-1": "YES [(see Authentication)](doc:authentication)" }, "cols": 2, "rows": 2 } [/block] The Roost **device_tokens** method requires an HTTP GET request. [block:api-header] { "type": "basic", "title": "Arguments" } [/block] OPTIONAL ARGMENTS [block:parameters] { "data": { "h-0": "Parameter", "h-1": "Description", "h-2": "Description", "0-0": "since", "0-1": "ISO8601 Timestamp. Specifies the starting point at which you want native feedback information. Feedback will be sent from that time through the present.", "1-0": "next", "1-1": "Integer that specifies the number of native feedback records to skip. This is a paging mechanism." }, "cols": 2, "rows": 2 } [/block] [block:api-header] { "type": "basic", "title": "Return Value" } [/block] On success, returns 250 feedback records from native devices in a JSON structure. If there are more than 250 records, then a "next_page" parameter will be returned as part of the JSON object, which includes the number to skip to get the next page of records. [block:code] { "codes": [ { "code": "{\n \"success\":true,\n \"registrations\":[\n {\n \"segments\":[\n \"tagtwo\",\n \"tagone\"\n ],\n \"enabled\":false,\n \"device_token\": \n \"8725AAED7938F52C67DF6B4162856CD492B37DEC99771423768ABE385B4ABDA8\",\n \"badge\":0}\n }\n ]\n}\n", "language": "shell" } ] } [/block]
{"__v":3,"_id":"54f5af1a58e9df0d00917bed","api":{"auth":"required","params":[],"results":{"codes":[{"status":200,"language":"json","code":"{}","name":""},{"status":400,"language":"json","code":"{}","name":""}]},"url":""},"body":"Use the **feedback** command to retrieve a list of notifications.\n\nExample 1:  Get feedback from native push services since Feb 28, 2015, 8:00am GMT\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"# Notifications Example 1\\n\\ncurl -X GET -u \\\"[api key]:[api secret]\\\" \\\\\\nhttps://api.goroost.com/api/feedback?since=2015-2-28T08:00:00Z \",\n      \"language\": \"shell\"\n    }\n  ],\n  \"sidebar\": true\n}\n[/block]\nExample 2:  Get feedback records 501-750 since Feb 28, 2015, 8:00am GMT\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"# Notifications Example 2\\n\\ncurl -X GET -u \\\"[api key]:[api secret]\\\" \\\\\\nhttps://api.goroost.com/api/feedback?next=1000\",\n      \"language\": \"shell\"\n    }\n  ]\n}\n[/block]","category":"54f5ae5c58e9df0d00917bec","createdAt":"2015-03-03T12:54:50.016Z","excerpt":"","githubsync":"","hidden":false,"link_external":false,"link_url":"","order":1,"project":"54ed111fa45a441700fd4cf6","slug":"retrieving-feedback","sync_unique":"","title":"Retrieving Feedback","type":"basic","updates":[],"user":"54ed0ffea45a441700fd4cf0","version":"54ed1120a45a441700fd4cf9"}

Retrieving Feedback


Use the **feedback** command to retrieve a list of notifications. Example 1: Get feedback from native push services since Feb 28, 2015, 8:00am GMT [block:code] { "codes": [ { "code": "# Notifications Example 1\n\ncurl -X GET -u \"[api key]:[api secret]\" \\\nhttps://api.goroost.com/api/feedback?since=2015-2-28T08:00:00Z ", "language": "shell" } ], "sidebar": true } [/block] Example 2: Get feedback records 501-750 since Feb 28, 2015, 8:00am GMT [block:code] { "codes": [ { "code": "# Notifications Example 2\n\ncurl -X GET -u \"[api key]:[api secret]\" \\\nhttps://api.goroost.com/api/feedback?next=1000", "language": "shell" } ] } [/block]
Use the **feedback** command to retrieve a list of notifications. Example 1: Get feedback from native push services since Feb 28, 2015, 8:00am GMT [block:code] { "codes": [ { "code": "# Notifications Example 1\n\ncurl -X GET -u \"[api key]:[api secret]\" \\\nhttps://api.goroost.com/api/feedback?since=2015-2-28T08:00:00Z ", "language": "shell" } ], "sidebar": true } [/block] Example 2: Get feedback records 501-750 since Feb 28, 2015, 8:00am GMT [block:code] { "codes": [ { "code": "# Notifications Example 2\n\ncurl -X GET -u \"[api key]:[api secret]\" \\\nhttps://api.goroost.com/api/feedback?next=1000", "language": "shell" } ] } [/block]
{"__v":3,"_id":"54ef7aeb6ce8d81900c1c3e4","api":{"auth":"required","params":[],"results":{"codes":[{"status":200,"language":"json","code":"{}","name":""},{"status":400,"language":"json","code":"{}","name":""}]},"url":""},"body":"Roost currently supports web push in the following browsers:\n\n[block:html]\n{\n  \"html\": \"<ul>\\n  <li>Safari (Mavericks) on Mac OS X</li>\\n</ul>\"\n}\n[/block]\n\n[block:html]\n{\n  \"html\": \"<ul>\\n  <li>Chrome Beta on Mac OS X</li>\\n  <li>Chrome Beta on Windows</li>\\n  <li>Chrome Beta on Android</li>\\n</ul>\"\n}\n[/block]","category":"54ef7a795bf74a0d00ef4185","createdAt":"2015-02-26T19:58:35.583Z","excerpt":"","githubsync":"","hidden":false,"link_external":false,"link_url":"","order":0,"project":"54ed111fa45a441700fd4cf6","slug":"roost-supported-browsers","sync_unique":"","title":"Roost-Supported Browsers","type":"basic","updates":[],"user":"54ed0ffea45a441700fd4cf0","version":"54ed1120a45a441700fd4cf9"}

Roost-Supported Browsers


Roost currently supports web push in the following browsers: [block:html] { "html": "<ul>\n <li>Safari (Mavericks) on Mac OS X</li>\n</ul>" } [/block] [block:html] { "html": "<ul>\n <li>Chrome Beta on Mac OS X</li>\n <li>Chrome Beta on Windows</li>\n <li>Chrome Beta on Android</li>\n</ul>" } [/block]
Roost currently supports web push in the following browsers: [block:html] { "html": "<ul>\n <li>Safari (Mavericks) on Mac OS X</li>\n</ul>" } [/block] [block:html] { "html": "<ul>\n <li>Chrome Beta on Mac OS X</li>\n <li>Chrome Beta on Windows</li>\n <li>Chrome Beta on Android</li>\n</ul>" } [/block]