{"__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,"parentDoc":null,"project":"54ed111fa45a441700fd4cf6","slug":"rest-api-basics","sync_unique":"","title":"Getting Started","type":"basic","updates":[],"user":"54ed0ffea45a441700fd4cf0","version":"54ed1120a45a441700fd4cf9","childrenPages":[]}

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":21,"_id":"54ee42daa3811c0d00a154ed","api":{"auth":"required","params":[],"results":{"codes":[{"status":200,"language":"json","code":"{}","name":""},{"status":400,"language":"json","code":"{}","name":""}]},"settings":"","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 recipient 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,"parentDoc":null,"project":"54ed111fa45a441700fd4cf6","slug":"rest-api-quickstart","sync_unique":"","title":"Sending Your First Push","type":"basic","updates":["55718ad638b33b0d006ffd1d"],"user":"54ed0ffea45a441700fd4cf0","version":"54ed1120a45a441700fd4cf9","childrenPages":[]}

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 recipient 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 recipient 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,"parentDoc":null,"project":"54ed111fa45a441700fd4cf6","slug":"authentication","sync_unique":"","title":"Authentication","type":"basic","updates":[],"user":"54ed0ffea45a441700fd4cf0","version":"54ed1120a45a441700fd4cf9","childrenPages":[]}

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":2,"_id":"54ee40ff76ced60d00b0a043","api":{"auth":"required","params":[{"_id":"54ee5252c622200d00ac0a17","required":false,"desc":"first param","default":"","type":"string","name":"one","in":"body"},{"_id":"54ee5252c622200d00ac0a16","required":false,"desc":"second param","default":"","type":"string","name":"two","in":"body"}],"results":{"codes":[{"status":200,"language":"json","code":"{}","name":""},{"status":400,"language":"json","code":"{}","name":""}]},"settings":"","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](https://developers.google.com/drive/web/handle-errors).","category":"54ee4218236c1d0d0028f499","createdAt":"2015-02-25T21:39:11.767Z","editedParams":true,"editedParams2":true,"excerpt":"","githubsync":"","hidden":false,"link_external":false,"link_url":"","order":3,"parentDoc":null,"project":"54ed111fa45a441700fd4cf6","slug":"quick-start-sending-push-notifications","sync_unique":"","title":"Throttling","type":"basic","updates":["555cd5cc7e271d0d00f3cab0"],"user":"54ed0ffea45a441700fd4cf0","version":"54ed1120a45a441700fd4cf9","childrenPages":[]}

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](https://developers.google.com/drive/web/handle-errors).
[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](https://developers.google.com/drive/web/handle-errors).
{"__v":14,"_id":"54ef129f5bf74a0d00ef40b3","api":{"auth":"required","params":[],"results":{"codes":[{"status":200,"language":"json","code":"{}","name":""},{"status":400,"language":"json","code":"{}","name":""}]},"settings":"","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    \"6-0\": \"title\",\n    \"7-0\": \"imageURL\",\n    \"6-1\": \"Title (top) text of the notification, which normally defaults to your site name.\",\n    \"7-1\": \"URL of image which is displayed with the notification and in the Bell notification center.\\n\\nNote: Image is displayed only in the Bell notification center on Safari desktop.\"\n  },\n  \"cols\": 2,\n  \"rows\": 8\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,"parentDoc":null,"project":"54ed111fa45a441700fd4cf6","slug":"specification","sync_unique":"","title":"Specification","type":"basic","updates":[],"user":"54ed0ffea45a441700fd4cf0","version":"54ed1120a45a441700fd4cf9","childrenPages":[]}

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\"", "6-0": "title", "7-0": "imageURL", "6-1": "Title (top) text of the notification, which normally defaults to your site name.", "7-1": "URL of image which is displayed with the notification and in the Bell notification center.\n\nNote: Image is displayed only in the Bell notification center on Safari desktop." }, "cols": 2, "rows": 8 } [/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\"", "6-0": "title", "7-0": "imageURL", "6-1": "Title (top) text of the notification, which normally defaults to your site name.", "7-1": "URL of image which is displayed with the notification and in the Bell notification center.\n\nNote: Image is displayed only in the Bell notification center on Safari desktop." }, "cols": 2, "rows": 8 } [/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,"parentDoc":null,"project":"54ed111fa45a441700fd4cf6","slug":"basic-push","sync_unique":"","title":"Basic Push","type":"basic","updates":[],"user":"54ed0ffea45a441700fd4cf0","version":"54ed1120a45a441700fd4cf9","childrenPages":[]}

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":2,"_id":"564f586cdc163a0d005a5f4c","api":{"auth":"required","params":[],"results":{"codes":[{"status":200,"language":"json","code":"{}","name":""},{"status":400,"language":"json","code":"{}","name":""}]},"settings":"","url":""},"body":"Push with a custom notification image.  This image replaces your site logo in the notifications, and is also shown in the notification center.\n[block:parameters]\n{\n  \"data\": {\n    \"0-0\": \"imageURL\",\n    \"1-0\": \"url\",\n    \"h-0\": \"Key Name\",\n    \"h-1\": \"Description\",\n    \"0-1\": \"URL of image which is displayed with the notification and in the Bell notification center.\\n\\nNote: Image is displayed only in the Bell notification center on Safari desktop.\",\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\": 1\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    \\\"imageURL\\\" :\\\"http://url-of-your-custom-image\\\"\\n}\\n\",\n      \"language\": \"json\"\n    }\n  ]\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Example\"\n}\n[/block]\nThis example simply adds an **imageURL** to a basic push.\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"# EXAMPLE - SENDING A NOTIFICATION WITH A\\n# CUSTOM IMAGE\\n\\ncurl -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  \\\"imageURL\\\" :\\\"http://url-of-your-custom-image\\\"}' \\\\\\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-11-20T17:29:16.717Z","excerpt":"","githubsync":"","hidden":false,"link_external":false,"link_url":"","order":2,"parentDoc":null,"project":"54ed111fa45a441700fd4cf6","slug":"push-with-image","sync_unique":"","title":"Push with Image","type":"basic","updates":[],"user":"54ed0ffea45a441700fd4cf0","version":"54ed1120a45a441700fd4cf9","childrenPages":[]}

Push with Image


Push with a custom notification image. This image replaces your site logo in the notifications, and is also shown in the notification center. [block:parameters] { "data": { "0-0": "imageURL", "1-0": "url", "h-0": "Key Name", "h-1": "Description", "0-1": "URL of image which is displayed with the notification and in the Bell notification center.\n\nNote: Image is displayed only in the Bell notification center on Safari desktop.", "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": 1 } [/block] [block:code] { "codes": [ { "code": "{\n \"alert\" : \"A Notification Title\",\n \"url\" : \"http://some-target-url\",\n \"imageURL\" :\"http://url-of-your-custom-image\"\n}\n", "language": "json" } ] } [/block] [block:api-header] { "type": "basic", "title": "Example" } [/block] This example simply adds an **imageURL** to a basic push. [block:code] { "codes": [ { "code": "# EXAMPLE - SENDING A NOTIFICATION WITH A\n# CUSTOM IMAGE\n\ncurl -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 \"imageURL\" :\"http://url-of-your-custom-image\"}' \\\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 custom notification image. This image replaces your site logo in the notifications, and is also shown in the notification center. [block:parameters] { "data": { "0-0": "imageURL", "1-0": "url", "h-0": "Key Name", "h-1": "Description", "0-1": "URL of image which is displayed with the notification and in the Bell notification center.\n\nNote: Image is displayed only in the Bell notification center on Safari desktop.", "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": 1 } [/block] [block:code] { "codes": [ { "code": "{\n \"alert\" : \"A Notification Title\",\n \"url\" : \"http://some-target-url\",\n \"imageURL\" :\"http://url-of-your-custom-image\"\n}\n", "language": "json" } ] } [/block] [block:api-header] { "type": "basic", "title": "Example" } [/block] This example simply adds an **imageURL** to a basic push. [block:code] { "codes": [ { "code": "# EXAMPLE - SENDING A NOTIFICATION WITH A\n# CUSTOM IMAGE\n\ncurl -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 \"imageURL\" :\"http://url-of-your-custom-image\"}' \\\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":2,"_id":"564f587a51f2ec0d001d697e","api":{"auth":"required","params":[],"results":{"codes":[{"status":200,"language":"json","code":"{}","name":""},{"status":400,"language":"json","code":"{}","name":""}]},"settings":"","url":""},"body":"Push with a custom **title** (top) line of text.  The title normally defaults to the name of your site.\n\nTitle should not exceed 25 characters in order to display nicely on all devices.\n\n[block:parameters]\n{\n  \"data\": {\n    \"0-0\": \"title\",\n    \"h-0\": \"Key Name\",\n    \"h-1\": \"Description\",\n    \"0-1\": \"Title (top) text of the notification, which normally defaults to your site name.\\n\\nTitle is limited to 25 characters.\"\n  },\n  \"cols\": 2,\n  \"rows\": 1\n}\n[/block]\n\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"{\\n    \\\"alert\\\" : \\\"The Body of the Notification\\\",\\n    \\\"url\\\" : \\\"http://some-target-url\\\",\\n    \\\"title\\\" : \\\"Title of the Notification\\\"\\n}\\n\",\n      \"language\": \"json\"\n    }\n  ]\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Example\"\n}\n[/block]\nSimple example adding the **title** to a basic 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\\\":\\\"A Notification Title\\\", \\\\\\n  \\\"url\\\":\\\"http://some-target-url\\\", \\\\\\n  \\\"title\\\" :\\\"Top Line of Notification\\\"}' \\\\\\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-11-20T17:29:30.106Z","excerpt":"","githubsync":"","hidden":false,"link_external":false,"link_url":"","order":3,"parentDoc":null,"project":"54ed111fa45a441700fd4cf6","slug":"push-with-title","sync_unique":"","title":"Push with Title","type":"basic","updates":[],"user":"54ed0ffea45a441700fd4cf0","version":"54ed1120a45a441700fd4cf9","childrenPages":[]}

Push with Title


Push with a custom **title** (top) line of text. The title normally defaults to the name of your site. Title should not exceed 25 characters in order to display nicely on all devices. [block:parameters] { "data": { "0-0": "title", "h-0": "Key Name", "h-1": "Description", "0-1": "Title (top) text of the notification, which normally defaults to your site name.\n\nTitle is limited to 25 characters." }, "cols": 2, "rows": 1 } [/block] [block:code] { "codes": [ { "code": "{\n \"alert\" : \"The Body of the Notification\",\n \"url\" : \"http://some-target-url\",\n \"title\" : \"Title of the Notification\"\n}\n", "language": "json" } ] } [/block] [block:api-header] { "type": "basic", "title": "Example" } [/block] Simple example adding the **title** to a basic push. [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 \"title\" :\"Top Line of Notification\"}' \\\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 custom **title** (top) line of text. The title normally defaults to the name of your site. Title should not exceed 25 characters in order to display nicely on all devices. [block:parameters] { "data": { "0-0": "title", "h-0": "Key Name", "h-1": "Description", "0-1": "Title (top) text of the notification, which normally defaults to your site name.\n\nTitle is limited to 25 characters." }, "cols": 2, "rows": 1 } [/block] [block:code] { "codes": [ { "code": "{\n \"alert\" : \"The Body of the Notification\",\n \"url\" : \"http://some-target-url\",\n \"title\" : \"Title of the Notification\"\n}\n", "language": "json" } ] } [/block] [block:api-header] { "type": "basic", "title": "Example" } [/block] Simple example adding the **title** to a basic push. [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 \"title\" :\"Top Line of Notification\"}' \\\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":7,"_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":4,"parentDoc":null,"project":"54ed111fa45a441700fd4cf6","slug":"push-to-tag-1","sync_unique":"","title":"Push To Segment","type":"basic","updates":["56a5dd16d222d20d00500d95"],"user":"54ed0ffea45a441700fd4cf0","version":"54ed1120a45a441700fd4cf9","childrenPages":[]}

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":5,"parentDoc":null,"project":"54ed111fa45a441700fd4cf6","slug":"push-to-alias","sync_unique":"","title":"Push To Alias","type":"basic","updates":[],"user":"54ed0ffea45a441700fd4cf0","version":"54ed1120a45a441700fd4cf9","childrenPages":[]}

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":6,"parentDoc":null,"project":"54ed111fa45a441700fd4cf6","slug":"ab-split-testing","sync_unique":"","title":"A/B Split-Testing","type":"basic","updates":[],"user":"54ed0ffea45a441700fd4cf0","version":"54ed1120a45a441700fd4cf9","childrenPages":[]}

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":7,"parentDoc":null,"project":"54ed111fa45a441700fd4cf6","slug":"push-scheduling","sync_unique":"","title":"Push Scheduling","type":"basic","updates":[],"user":"54ed0ffea45a441700fd4cf0","version":"54ed1120a45a441700fd4cf9","childrenPages":[]}

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":8,"parentDoc":null,"project":"54ed111fa45a441700fd4cf6","slug":"push-with-multiple-parameters","sync_unique":"","title":"Push with Multiple-Parameters","type":"basic","updates":[],"user":"54ed0ffea45a441700fd4cf0","version":"54ed1120a45a441700fd4cf9","childrenPages":[]}

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":20,"_id":"56311264eae7ef0d00270e2e","api":{"auth":"required","params":[],"results":{"codes":[{"status":200,"language":"json","code":"{}","name":""},{"status":400,"language":"json","code":"{}","name":""}]},"settings":"","url":""},"body":"Notifications can be sent in batches.  This is often useful if you are sending a large number of notifications -- it is much more efficient and mitigates [Throttling](doc:quick-start-sending-push-notifications)  issues.\n\nWhen sending notifications in a batch, the JSON array ([]) will be passed as data (instead of a JSON object).  JSON objects for each separate notification are then placed inside that outermost array.\n[block:parameters]\n{\n  \"data\": {\n    \"0-0\": \"URL\",\n    \"0-1\": \"https://api.goroost.com/api/push/batch\",\n    \"1-0\": \"HTTP Auth\",\n    \"1-1\": \"YES [(see Authentication)](doc:authentication)\"\n  },\n  \"cols\": 2,\n  \"rows\": 2\n}\n[/block]\n\n[block:parameters]\n{\n  \"data\": {\n    \"0-0\": \"(array of notifications)\",\n    \"h-0\": \"Key Name\",\n    \"h-1\": \"Description\",\n    \"0-1\": \"Array of notification objects\"\n  },\n  \"cols\": 2,\n  \"rows\": 1\n}\n[/block]\n\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"[\\n    {\\n        \\\"alert\\\" : \\\"First Notification Title\\\",\\n        \\\"url\\\" : \\\"http://first-target-url\\\"\\n    },\\n    {\\n        \\\"alert\\\" : \\\"Second Notification Title\\\",\\n        \\\"url\\\" : \\\"http://second-target-url\\\"\\n    }\\n]\\n\",\n      \"language\": \"json\"\n    }\n  ]\n}\n[/block]\nNotifications contained in the array may have any parameters that are permitted for individual notifications.  So, one notification may contain scheduling information, while another may be sent to a specific [Alias](doc:push-to-alias)  or [Segment](doc:push-to-tag-1) .\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\\\":\\\"First Notification Title\\\", \\\"url\\\":\\\"http://first-target-url.com\\\"}, {\\\"alert\\\":\\\"Second Notification Title\\\", \\\"url\\\":\\\"http://second-target-url.com\\\"}, {\\\"alert\\\":\\\"Third Notification Title\\\", \\\"url\\\":\\\"http://third-target-url.com\\\"}]' \\\\\\n  https://api.goroost.com/api/push/batch \\n\",\n      \"language\": \"shell\"\n    }\n  ],\n  \"sidebar\": true\n}\n[/block]\n**Limitations:**  The Roost batch push call is limited to **100 notifications per call**.  For additional information read more about [Throttling here](doc:quick-start-sending-push-notifications).","category":"54ef128c6ce8d81900c1c340","createdAt":"2015-10-28T18:22:28.956Z","excerpt":"Use the Roost **push/batch** call to send several notifications in a single call.","githubsync":"","hidden":false,"link_external":false,"link_url":"","order":9,"parentDoc":null,"project":"54ed111fa45a441700fd4cf6","slug":"batch-push","sync_unique":"","title":"Batch Push","type":"basic","updates":[],"user":"54ed0ffea45a441700fd4cf0","version":"54ed1120a45a441700fd4cf9","childrenPages":[]}

Batch Push

Use the Roost **push/batch** call to send several notifications in a single call.

Notifications can be sent in batches. This is often useful if you are sending a large number of notifications -- it is much more efficient and mitigates [Throttling](doc:quick-start-sending-push-notifications) issues. When sending notifications in a batch, the JSON array ([]) will be passed as data (instead of a JSON object). JSON objects for each separate notification are then placed inside that outermost array. [block:parameters] { "data": { "0-0": "URL", "0-1": "https://api.goroost.com/api/push/batch", "1-0": "HTTP Auth", "1-1": "YES [(see Authentication)](doc:authentication)" }, "cols": 2, "rows": 2 } [/block] [block:parameters] { "data": { "0-0": "(array of notifications)", "h-0": "Key Name", "h-1": "Description", "0-1": "Array of notification objects" }, "cols": 2, "rows": 1 } [/block] [block:code] { "codes": [ { "code": "[\n {\n \"alert\" : \"First Notification Title\",\n \"url\" : \"http://first-target-url\"\n },\n {\n \"alert\" : \"Second Notification Title\",\n \"url\" : \"http://second-target-url\"\n }\n]\n", "language": "json" } ] } [/block] Notifications contained in the array may have any parameters that are permitted for individual notifications. So, one notification may contain scheduling information, while another may be sent to a specific [Alias](doc:push-to-alias) or [Segment](doc:push-to-tag-1) . [block:code] { "codes": [ { "code": "curl -X POST -u \"[api key]:[api secret]\" \\\n -H \"Content-Type: application/json\" \\\n --data '[{\"alert\":\"First Notification Title\", \"url\":\"http://first-target-url.com\"}, {\"alert\":\"Second Notification Title\", \"url\":\"http://second-target-url.com\"}, {\"alert\":\"Third Notification Title\", \"url\":\"http://third-target-url.com\"}]' \\\n https://api.goroost.com/api/push/batch \n", "language": "shell" } ], "sidebar": true } [/block] **Limitations:** The Roost batch push call is limited to **100 notifications per call**. For additional information read more about [Throttling here](doc:quick-start-sending-push-notifications).
Notifications can be sent in batches. This is often useful if you are sending a large number of notifications -- it is much more efficient and mitigates [Throttling](doc:quick-start-sending-push-notifications) issues. When sending notifications in a batch, the JSON array ([]) will be passed as data (instead of a JSON object). JSON objects for each separate notification are then placed inside that outermost array. [block:parameters] { "data": { "0-0": "URL", "0-1": "https://api.goroost.com/api/push/batch", "1-0": "HTTP Auth", "1-1": "YES [(see Authentication)](doc:authentication)" }, "cols": 2, "rows": 2 } [/block] [block:parameters] { "data": { "0-0": "(array of notifications)", "h-0": "Key Name", "h-1": "Description", "0-1": "Array of notification objects" }, "cols": 2, "rows": 1 } [/block] [block:code] { "codes": [ { "code": "[\n {\n \"alert\" : \"First Notification Title\",\n \"url\" : \"http://first-target-url\"\n },\n {\n \"alert\" : \"Second Notification Title\",\n \"url\" : \"http://second-target-url\"\n }\n]\n", "language": "json" } ] } [/block] Notifications contained in the array may have any parameters that are permitted for individual notifications. So, one notification may contain scheduling information, while another may be sent to a specific [Alias](doc:push-to-alias) or [Segment](doc:push-to-tag-1) . [block:code] { "codes": [ { "code": "curl -X POST -u \"[api key]:[api secret]\" \\\n -H \"Content-Type: application/json\" \\\n --data '[{\"alert\":\"First Notification Title\", \"url\":\"http://first-target-url.com\"}, {\"alert\":\"Second Notification Title\", \"url\":\"http://second-target-url.com\"}, {\"alert\":\"Third Notification Title\", \"url\":\"http://third-target-url.com\"}]' \\\n https://api.goroost.com/api/push/batch \n", "language": "shell" } ], "sidebar": true } [/block] **Limitations:** The Roost batch push call is limited to **100 notifications per call**. For additional information read more about [Throttling here](doc:quick-start-sending-push-notifications).
{"__v":8,"_id":"564f6054b85ee335004cbde0","api":{"auth":"required","params":[],"results":{"codes":[{"status":200,"language":"json","code":"{}","name":""},{"status":400,"language":"json","code":"{}","name":""}]},"settings":"","url":""},"body":"The **alias** command associates the current use with an arbitrary alias, or ID.  This is usually an id you use in your backend system.\n\nOnce an alias is set, you can then push 1-to-1 notifications to that particular user -- see [Push to Alias](doc:push-to-alias).\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://go.goroost.com/api/device_tokens/TOKEN\\n\\nTOKEN is replaced with the device ID for a particular user\\n\\n**IMPORTANT:  TOKEN must be URI encoded in the URL**\",\n    \"1-0\": \"HTTP Auth\",\n    \"1-1\": \"YES [(see Authentication)](doc:authentication)\"\n  },\n  \"cols\": 2,\n  \"rows\": 2\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"JSON Arguments\"\n}\n[/block]\n\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"Key Name\",\n    \"h-1\": \"Description\",\n    \"0-0\": \"alias\",\n    \"0-1\": \"The unique text string to be associated with a  user as an alias (ID).\"\n  },\n  \"cols\": 2,\n  \"rows\": 1\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Example\"\n}\n[/block]\nThis example simply assigns an **alias** to a particular user based on his device (TOKEN).\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"# EXAMPLE - ASSOCIATING THE CURRENT USER WITH\\n# AN ALIAS (ID)\\n\\ncurl -X PUT -u \\\"[api key]:[api secret]\\\" \\\\\\n  -H \\\"Content-Type: application/json\\\" \\\\\\n  --data '{\\\"alias\\\" : \\\"some-unique-id\\\"}' \\\\\\n  https://go.goroost.com/api/device_tokens/TOKEN \",\n      \"language\": \"text\"\n    }\n  ],\n  \"sidebar\": true\n}\n[/block]\n**Try the example on the right.** Use your own **[API Key]** and **[API Secret]**.\n\n**alias** and **TOKEN** should be replaced programmatically by your code with values that are unique to a particular user.  **IMPORTANT:  TOKEN must be URI encoded in the URL**","category":"564e5d066de06a0d00ab081a","createdAt":"2015-11-20T18:03:00.393Z","excerpt":"","githubsync":"","hidden":false,"link_external":false,"link_url":"","order":0,"parentDoc":null,"project":"54ed111fa45a441700fd4cf6","slug":"set-alias","sync_unique":"","title":"Set Alias","type":"basic","updates":[],"user":"54ed0ffea45a441700fd4cf0","version":"54ed1120a45a441700fd4cf9","childrenPages":[]}

Set Alias


The **alias** command associates the current use with an arbitrary alias, or ID. This is usually an id you use in your backend system. Once an alias is set, you can then push 1-to-1 notifications to that particular user -- see [Push to Alias](doc:push-to-alias). [block:api-header] { "type": "basic", "title": "CALL" } [/block] [block:parameters] { "data": { "0-0": "URL", "0-1": "https://go.goroost.com/api/device_tokens/TOKEN\n\nTOKEN is replaced with the device ID for a particular user\n\n**IMPORTANT: TOKEN must be URI encoded in the URL**", "1-0": "HTTP Auth", "1-1": "YES [(see Authentication)](doc:authentication)" }, "cols": 2, "rows": 2 } [/block] [block:api-header] { "type": "basic", "title": "JSON Arguments" } [/block] [block:parameters] { "data": { "h-0": "Key Name", "h-1": "Description", "0-0": "alias", "0-1": "The unique text string to be associated with a user as an alias (ID)." }, "cols": 2, "rows": 1 } [/block] [block:api-header] { "type": "basic", "title": "Example" } [/block] This example simply assigns an **alias** to a particular user based on his device (TOKEN). [block:code] { "codes": [ { "code": "# EXAMPLE - ASSOCIATING THE CURRENT USER WITH\n# AN ALIAS (ID)\n\ncurl -X PUT -u \"[api key]:[api secret]\" \\\n -H \"Content-Type: application/json\" \\\n --data '{\"alias\" : \"some-unique-id\"}' \\\n https://go.goroost.com/api/device_tokens/TOKEN ", "language": "text" } ], "sidebar": true } [/block] **Try the example on the right.** Use your own **[API Key]** and **[API Secret]**. **alias** and **TOKEN** should be replaced programmatically by your code with values that are unique to a particular user. **IMPORTANT: TOKEN must be URI encoded in the URL**
The **alias** command associates the current use with an arbitrary alias, or ID. This is usually an id you use in your backend system. Once an alias is set, you can then push 1-to-1 notifications to that particular user -- see [Push to Alias](doc:push-to-alias). [block:api-header] { "type": "basic", "title": "CALL" } [/block] [block:parameters] { "data": { "0-0": "URL", "0-1": "https://go.goroost.com/api/device_tokens/TOKEN\n\nTOKEN is replaced with the device ID for a particular user\n\n**IMPORTANT: TOKEN must be URI encoded in the URL**", "1-0": "HTTP Auth", "1-1": "YES [(see Authentication)](doc:authentication)" }, "cols": 2, "rows": 2 } [/block] [block:api-header] { "type": "basic", "title": "JSON Arguments" } [/block] [block:parameters] { "data": { "h-0": "Key Name", "h-1": "Description", "0-0": "alias", "0-1": "The unique text string to be associated with a user as an alias (ID)." }, "cols": 2, "rows": 1 } [/block] [block:api-header] { "type": "basic", "title": "Example" } [/block] This example simply assigns an **alias** to a particular user based on his device (TOKEN). [block:code] { "codes": [ { "code": "# EXAMPLE - ASSOCIATING THE CURRENT USER WITH\n# AN ALIAS (ID)\n\ncurl -X PUT -u \"[api key]:[api secret]\" \\\n -H \"Content-Type: application/json\" \\\n --data '{\"alias\" : \"some-unique-id\"}' \\\n https://go.goroost.com/api/device_tokens/TOKEN ", "language": "text" } ], "sidebar": true } [/block] **Try the example on the right.** Use your own **[API Key]** and **[API Secret]**. **alias** and **TOKEN** should be replaced programmatically by your code with values that are unique to a particular user. **IMPORTANT: TOKEN must be URI encoded in the URL**
{"__v":2,"_id":"564f7a57fdbb0e2b00990769","api":{"auth":"required","params":[],"results":{"codes":[{"status":200,"language":"json","code":"{}","name":""},{"status":400,"language":"json","code":"{}","name":""}]},"settings":"","url":""},"body":"The **enable** command overrides the subscription state for the user associated with an alias. \n\n**Important**: This call will have effect ONLY IF THE USER IS SUBSCRIBED. The enable/disable state modifies an active subscription, and will have no effect on users who have disallowed notifications, or who have not opted-in yet.\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://go.goroost.com/api/aliases/ALIAS\\n\\nALIAS is replaced with the alias previously defined for a particular user\",\n    \"1-0\": \"HTTP Auth\",\n    \"1-1\": \"YES [(see Authentication)](doc:authentication)\"\n  },\n  \"cols\": 2,\n  \"rows\": 2\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"JSON Arguments\"\n}\n[/block]\n\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"Key Name\",\n    \"h-1\": \"Description\",\n    \"0-0\": \"enabled\",\n    \"0-1\": \"Set to true to enable the current user's subscription, and false to disable.\"\n  },\n  \"cols\": 2,\n  \"rows\": 1\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Example\"\n}\n[/block]\nThis example disables the current user.  If they are not yet opted-in, or have disabled notifications via the browser -- then this is a no-op.\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"# EXAMPLE - DISABLING THE CURRENT USER\\n\\ncurl -X PUT -u \\\"[api key]:[api secret]\\\" \\\\\\n  -H \\\"Content-Type: application/json\\\" \\\\\\n  --data '{\\\"\\\"enabled\\\" : \\\"false\\\"}' \\\\\\n  https://go.goroost.com/api/aliases/ALIAS \",\n      \"language\": \"text\"\n    }\n  ],\n  \"sidebar\": true\n}\n[/block]\n**Try the example on the right.** Use your own **[API Key]** and **[API Secret]**.\n\n**ALIAS** should be replaced programmatically by your code with a alias/ID for a particular user.","category":"564e5d066de06a0d00ab081a","createdAt":"2015-11-20T19:53:59.166Z","excerpt":"","githubsync":"","hidden":false,"isReference":false,"link_external":false,"link_url":"","order":1,"parentDoc":null,"project":"54ed111fa45a441700fd4cf6","slug":"enabledisable-by-alias","sync_unique":"","title":"Enable/Disable by Alias","type":"basic","updates":[],"user":"54ed0ffea45a441700fd4cf0","version":"54ed1120a45a441700fd4cf9","childrenPages":[]}

Enable/Disable by Alias


The **enable** command overrides the subscription state for the user associated with an alias. **Important**: This call will have effect ONLY IF THE USER IS SUBSCRIBED. The enable/disable state modifies an active subscription, and will have no effect on users who have disallowed notifications, or who have not opted-in yet. [block:api-header] { "type": "basic", "title": "CALL" } [/block] [block:parameters] { "data": { "0-0": "URL", "0-1": "https://go.goroost.com/api/aliases/ALIAS\n\nALIAS is replaced with the alias previously defined for a particular user", "1-0": "HTTP Auth", "1-1": "YES [(see Authentication)](doc:authentication)" }, "cols": 2, "rows": 2 } [/block] [block:api-header] { "type": "basic", "title": "JSON Arguments" } [/block] [block:parameters] { "data": { "h-0": "Key Name", "h-1": "Description", "0-0": "enabled", "0-1": "Set to true to enable the current user's subscription, and false to disable." }, "cols": 2, "rows": 1 } [/block] [block:api-header] { "type": "basic", "title": "Example" } [/block] This example disables the current user. If they are not yet opted-in, or have disabled notifications via the browser -- then this is a no-op. [block:code] { "codes": [ { "code": "# EXAMPLE - DISABLING THE CURRENT USER\n\ncurl -X PUT -u \"[api key]:[api secret]\" \\\n -H \"Content-Type: application/json\" \\\n --data '{\"\"enabled\" : \"false\"}' \\\n https://go.goroost.com/api/aliases/ALIAS ", "language": "text" } ], "sidebar": true } [/block] **Try the example on the right.** Use your own **[API Key]** and **[API Secret]**. **ALIAS** should be replaced programmatically by your code with a alias/ID for a particular user.
The **enable** command overrides the subscription state for the user associated with an alias. **Important**: This call will have effect ONLY IF THE USER IS SUBSCRIBED. The enable/disable state modifies an active subscription, and will have no effect on users who have disallowed notifications, or who have not opted-in yet. [block:api-header] { "type": "basic", "title": "CALL" } [/block] [block:parameters] { "data": { "0-0": "URL", "0-1": "https://go.goroost.com/api/aliases/ALIAS\n\nALIAS is replaced with the alias previously defined for a particular user", "1-0": "HTTP Auth", "1-1": "YES [(see Authentication)](doc:authentication)" }, "cols": 2, "rows": 2 } [/block] [block:api-header] { "type": "basic", "title": "JSON Arguments" } [/block] [block:parameters] { "data": { "h-0": "Key Name", "h-1": "Description", "0-0": "enabled", "0-1": "Set to true to enable the current user's subscription, and false to disable." }, "cols": 2, "rows": 1 } [/block] [block:api-header] { "type": "basic", "title": "Example" } [/block] This example disables the current user. If they are not yet opted-in, or have disabled notifications via the browser -- then this is a no-op. [block:code] { "codes": [ { "code": "# EXAMPLE - DISABLING THE CURRENT USER\n\ncurl -X PUT -u \"[api key]:[api secret]\" \\\n -H \"Content-Type: application/json\" \\\n --data '{\"\"enabled\" : \"false\"}' \\\n https://go.goroost.com/api/aliases/ALIAS ", "language": "text" } ], "sidebar": true } [/block] **Try the example on the right.** Use your own **[API Key]** and **[API Secret]**. **ALIAS** should be replaced programmatically by your code with a alias/ID for a particular user.
{"__v":4,"_id":"564f78db51f2ec0d001d69b3","api":{"auth":"required","params":[],"results":{"codes":[{"status":200,"language":"json","code":"{}","name":""},{"status":400,"language":"json","code":"{}","name":""}]},"settings":"","url":""},"body":"The **enable** command overrides the subscription state for a particular user based device ID (Token). \n\n**Important**: This call will have effect ONLY IF THE USER IS SUBSCRIBED. The enable/disable state modifies an active subscription, and will have no effect on users who have disallowed notifications, or who have not opted-in yet.\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://go.goroost.com/api/device_tokens/TOKEN\\n\\nTOKEN is replaced with the device ID for a particular user\\n\\n**IMPORTANT:  TOKEN must be URI encoded in the URL**\",\n    \"1-0\": \"HTTP Auth\",\n    \"1-1\": \"YES [(see Authentication)](doc:authentication)\"\n  },\n  \"cols\": 2,\n  \"rows\": 2\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"JSON Arguments\"\n}\n[/block]\n\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"Key Name\",\n    \"h-1\": \"Description\",\n    \"0-0\": \"enabled\",\n    \"0-1\": \"Set to true to enable the current user's subscription, and false to disable.\"\n  },\n  \"cols\": 2,\n  \"rows\": 1\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Example\"\n}\n[/block]\nThis example disables the current user.  If they are not yet opted-in, or have disabled notifications via the browser -- then this is a no-op.\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"# EXAMPLE - DISABLING THE CURRENT USER\\n\\ncurl -X PUT -u \\\"[api key]:[api secret]\\\" \\\\\\n  -H \\\"Content-Type: application/json\\\" \\\\\\n  --data '{\\\"\\\"enabled\\\" : \\\"false\\\"}' \\\\\\n  https://go.goroost.com/api/device_tokens/TOKEN \",\n      \"language\": \"text\"\n    }\n  ],\n  \"sidebar\": true\n}\n[/block]\n**Try the example on the right.** Use your own **[API Key]** and **[API Secret]**.\n\n**TOKEN** should be replaced programmatically by your code with the device ID for a particular user.  IMPORTANT: TOKEN must be URI encoded in the URL","category":"564e5d066de06a0d00ab081a","createdAt":"2015-11-20T19:47:39.315Z","excerpt":"","githubsync":"","hidden":false,"link_external":false,"link_url":"","order":2,"parentDoc":null,"project":"54ed111fa45a441700fd4cf6","slug":"enabledisable-by-token","sync_unique":"","title":"Enable/Disable by Token","type":"basic","updates":[],"user":"54ed0ffea45a441700fd4cf0","version":"54ed1120a45a441700fd4cf9","childrenPages":[]}

Enable/Disable by Token


The **enable** command overrides the subscription state for a particular user based device ID (Token). **Important**: This call will have effect ONLY IF THE USER IS SUBSCRIBED. The enable/disable state modifies an active subscription, and will have no effect on users who have disallowed notifications, or who have not opted-in yet. [block:api-header] { "type": "basic", "title": "CALL" } [/block] [block:parameters] { "data": { "0-0": "URL", "0-1": "https://go.goroost.com/api/device_tokens/TOKEN\n\nTOKEN is replaced with the device ID for a particular user\n\n**IMPORTANT: TOKEN must be URI encoded in the URL**", "1-0": "HTTP Auth", "1-1": "YES [(see Authentication)](doc:authentication)" }, "cols": 2, "rows": 2 } [/block] [block:api-header] { "type": "basic", "title": "JSON Arguments" } [/block] [block:parameters] { "data": { "h-0": "Key Name", "h-1": "Description", "0-0": "enabled", "0-1": "Set to true to enable the current user's subscription, and false to disable." }, "cols": 2, "rows": 1 } [/block] [block:api-header] { "type": "basic", "title": "Example" } [/block] This example disables the current user. If they are not yet opted-in, or have disabled notifications via the browser -- then this is a no-op. [block:code] { "codes": [ { "code": "# EXAMPLE - DISABLING THE CURRENT USER\n\ncurl -X PUT -u \"[api key]:[api secret]\" \\\n -H \"Content-Type: application/json\" \\\n --data '{\"\"enabled\" : \"false\"}' \\\n https://go.goroost.com/api/device_tokens/TOKEN ", "language": "text" } ], "sidebar": true } [/block] **Try the example on the right.** Use your own **[API Key]** and **[API Secret]**. **TOKEN** should be replaced programmatically by your code with the device ID for a particular user. IMPORTANT: TOKEN must be URI encoded in the URL
The **enable** command overrides the subscription state for a particular user based device ID (Token). **Important**: This call will have effect ONLY IF THE USER IS SUBSCRIBED. The enable/disable state modifies an active subscription, and will have no effect on users who have disallowed notifications, or who have not opted-in yet. [block:api-header] { "type": "basic", "title": "CALL" } [/block] [block:parameters] { "data": { "0-0": "URL", "0-1": "https://go.goroost.com/api/device_tokens/TOKEN\n\nTOKEN is replaced with the device ID for a particular user\n\n**IMPORTANT: TOKEN must be URI encoded in the URL**", "1-0": "HTTP Auth", "1-1": "YES [(see Authentication)](doc:authentication)" }, "cols": 2, "rows": 2 } [/block] [block:api-header] { "type": "basic", "title": "JSON Arguments" } [/block] [block:parameters] { "data": { "h-0": "Key Name", "h-1": "Description", "0-0": "enabled", "0-1": "Set to true to enable the current user's subscription, and false to disable." }, "cols": 2, "rows": 1 } [/block] [block:api-header] { "type": "basic", "title": "Example" } [/block] This example disables the current user. If they are not yet opted-in, or have disabled notifications via the browser -- then this is a no-op. [block:code] { "codes": [ { "code": "# EXAMPLE - DISABLING THE CURRENT USER\n\ncurl -X PUT -u \"[api key]:[api secret]\" \\\n -H \"Content-Type: application/json\" \\\n --data '{\"\"enabled\" : \"false\"}' \\\n https://go.goroost.com/api/device_tokens/TOKEN ", "language": "text" } ], "sidebar": true } [/block] **Try the example on the right.** Use your own **[API Key]** and **[API Secret]**. **TOKEN** should be replaced programmatically by your code with the device ID for a particular user. IMPORTANT: TOKEN must be URI encoded in the URL