{"_id":"56d1f33f00a2a70b00b365eb","project":"5526c95cf69851170038b48f","version":{"_id":"56d1f33700a2a70b00b3658e","project":"5526c95cf69851170038b48f","__v":2,"createdAt":"2016-02-27T19:04:23.946Z","releaseDate":"2016-02-27T19:04:23.946Z","categories":["56d1f33900a2a70b00b3658f","56d1f33900a2a70b00b36590","56d1f33900a2a70b00b36591","56d1f33900a2a70b00b36592","56d1f33900a2a70b00b36593","56d1f33900a2a70b00b36594","56d1f33900a2a70b00b36595","56d1f33900a2a70b00b36596","56d1f33900a2a70b00b36597","56d1f33900a2a70b00b36598","56d1f33900a2a70b00b36599","56d1f33900a2a70b00b3659a","571f9497ada30c34003b7cee"],"is_deprecated":false,"is_hidden":false,"is_beta":true,"is_stable":true,"codename":"beta","version_clean":"2.0.0-beta","version":"2.0.0-beta"},"__v":3,"category":{"_id":"56d1f33900a2a70b00b36598","pages":["56d1f33f00a2a70b00b365e9","56d1f33f00a2a70b00b365ea","56d1f33f00a2a70b00b365eb","56d1f33f00a2a70b00b365ec","56d1f33f00a2a70b00b365ed"],"project":"5526c95cf69851170038b48f","__v":1,"version":"56d1f33700a2a70b00b3658e","sync":{"url":"","isSync":false},"reference":false,"createdAt":"2015-04-20T16:08:19.335Z","from_sync":false,"order":7,"slug":"rest-api","title":"API"},"parentDoc":null,"user":"5526d4bb4a7ac121004c605c","updates":[],"next":{"pages":[],"description":""},"createdAt":"2015-12-04T15:28:38.249Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[]},"settings":"","auth":"required","params":[],"url":""},"isReference":false,"order":4,"body":"[block:html]\n{\n  \"html\": \"<style>\\n  .endpoint-spacer {\\n     height: 20px;\\n  }\\n  \\n  .endpoint {\\n    position: relative;\\n    padding: 10px 20px;\\n    color: #555;\\n    font-weight: bold;\\n    margin-bottom: 10px;\\n  }\\n  \\n  .endpoint.get {\\n    background-color: #E4FFDD;\\n  }\\n  \\n  .endpoint.put {\\n    background-color: #FFEFFA;\\n  }\\n  \\n  .endpoint.post {\\n    background-color: #EDF5FF;\\n  }\\n  \\n  .endpoint.patch {\\n    background-color: #FFEEC7;\\n  }\\n  \\n  .endpoint.delete {\\n    background-color: #FFE4E0;\\n  }\\n  \\n  .docs-content hr {\\n    border-top: 1px solid #eee;\\n    border-color: #eee;\\n    margin-bottom: 1px;\\n  }\\n  \\n  .docs-content p {\\n    margin-left: 20px;\\n  }\\n  \\n  .blocks-parent > div {\\n    margin-bottom: 0px;\\n  }\\n</style>\"\n}\n[/block]\n## Endpoints:\n\n**Notifications:**\n\n* [List](#notifications-list) your recent notifications\n* [Check](#notifications-get) the status of a notification\n* [View](#notifications-list-messages) the list of notification messages\n* [Post](#notifications-post) a new push notification\n\n**Messages:**\n\n* [List](#messages-list) your recent messages\n* [Check](#messages-get) the status of a message\n\n**Tokens:**\n\n* [List](#tokens-list) recently created tokens\n* [Get](#tokens-get) information about a token\n* [Update](#tokens-patch) a push token on Ionic servers\n* [Create](#tokens-post) a new token on Ionic servers\n* [Delete](#tokens-delete) a token from Ionic servers\n\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Notifications\"\n}\n[/block]\n\n[block:html]\n{\n  \"html\": \"<a name=\\\"notifications-list\\\"></a>\\n<div class=\\\"endpoint get\\\">\\n\\t<span class=\\\"pg-type-big pg-type type-get\\\">get</span> https://api.ionic.io/push/notifications\\n</div>\"\n}\n[/block]\n**List the recent notifications you've sent**\n\n**Authentication Required:** Yes\n\n**Response:** A list of recent notifications.\n\n**Parameters:** None\n\n\n[block:html]\n{\n  \"html\": \"<a name=\\\"notifications-get\\\"></a>\\n<div class=\\\"endpoint get\\\">\\n\\t<span class=\\\"pg-type-big pg-type type-get\\\">get</span> https://api.ionic.io/push/notifications/{uuid}\\n</div>\"\n}\n[/block]\n**Get information about a specific notification you've sent:**\n\n**Authentication Required:** Yes\n\n**Response:** Information about the notification.\n\n**Parameters:** \n\n* **uuid:** The notification's ID.\n\n[block:html]\n{\n  \"html\": \"<a name=\\\"notifications-list-messages\\\"></a>\\n<div class=\\\"endpoint get\\\">\\n\\t<span class=\\\"pg-type-big pg-type type-get\\\">get</span> https://api.ionic.io/push/notifications/{uuid}/messages\\n</div>\"\n}\n[/block]\n**List the notification's recent messages you've sent**\n\n**Authentication Required:** Yes\n\n**Response:** A list of recent notification messages (actual deliveries).\n\n**Parameters:**\n\n* **uuid:** The notification id\n\n\n[block:html]\n{\n  \"html\": \"<a name=\\\"notifications-post\\\"></a>\\n<div class=\\\"endpoint post\\\">\\n\\t<span class=\\\"pg-type-big pg-type type-post\\\">post</span> https://api.ionic.io/push/notifications\\n</div>\"\n}\n[/block]\n**Send a push notification:**\n\n**Authorization Required:** Yes\n\n**Response:** Confirmation and a uuid to look up the notification later.\n\n**Parameters:**\n\n* Check out [Anatomy of a Push Notification](doc:anatomy-of-a-push-notification) for a detailed overview of the POST JSON object.\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Messages\"\n}\n[/block]\n\n[block:html]\n{\n  \"html\": \"<a name=\\\"messages-list\\\"></a>\\n<div class=\\\"endpoint get\\\">\\n\\t<span class=\\\"pg-type-big pg-type type-get\\\">get</span> https://api.ionic.io/push/messages\\n</div>\"\n}\n[/block]\n**List the recent messages sent**\n\n**Authentication Required:** Yes\n\n**Response:** A list of recent messages.\n\n**Parameters:** None\n[block:html]\n{\n  \"html\": \"<a name=\\\"messages-get\\\"></a>\\n<div class=\\\"endpoint get\\\">\\n\\t<span class=\\\"pg-type-big pg-type type-get\\\">get</span> https://api.ionic.io/push/messages/{uuid}\\n</div>\"\n}\n[/block]\n**Get information about a specific message sent:**\n\n**Authentication Required:** Yes\n\n**Response:** Information about the message, most importantly its current status and any associated errors.\n\n**Parameters:** \n\n* **uuid:** The message's ID.\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Tokens\"\n}\n[/block]\n\n[block:html]\n{\n  \"html\": \"<a name=\\\"tokens-list\\\"></a>\\n<div class=\\\"endpoint get\\\">\\n\\t<span class=\\\"pg-type-big pg-type type-get\\\">get</span> https://api.ionic.io/push/tokens\\n</div>\"\n}\n[/block]\n**List the recent tokens created**\n\n**Authentication Required:** Yes\n\n**Response:** A list of recent tokens.\n\n**Parameters:**\n\n* user_id (string) (optional) Passing a User UUID will show tokens tied to that user id.\n* show_invalid (bool) (optional) Passing true will show invalid tokens in the listing.\n[block:html]\n{\n  \"html\": \"<a name=\\\"tokens-get\\\"></a>\\n<div class=\\\"endpoint get\\\">\\n\\t<span class=\\\"pg-type-big pg-type type-get\\\">get</span> https://api.ionic.io/push/tokens/{token_id}\\n</div>\"\n}\n[/block]\n**Get information about a specific token.**\n\n**Authentication Required:** Yes\n\n**Response:** Information about the token\n\n**Parameters:** \n\n* **token_id:** The token's ID.\n[block:html]\n{\n  \"html\": \"<a name=\\\"tokens-post\\\"></a>\\n<div class=\\\"endpoint post\\\">\\n\\t<span class=\\\"pg-type-big pg-type type-post\\\">post</span> https://api.ionic.io/push/tokens\\n</div>\"\n}\n[/block]\n**Save a device token, adding it to the user collection if necessary.**\n\n**Authentication Required:** Yes\n\n**Response:** Confirmation\n\n**Parameters:** \n\n* **token:** The device token.\n* **user_id:** The ID for the Ionic User you wish to add the token to\n[block:html]\n{\n  \"html\": \"<a name=\\\"tokens-patch\\\"></a>\\n<div class=\\\"endpoint patch\\\">\\n\\t<span class=\\\"pg-type-big pg-type type-patch\\\">patch</span> https://api.ionic.io/push/tokens/{token_id}\\n</div>\"\n}\n[/block]\n**Validate or invalidate a device token.**\n\n**Authentication Required:** Yes\n\n**Response:** Confirmation\n\n**Parameters:** \n\n* **token_id:** The device token ID.\n* **valid:** The validity status of the token\n[block:html]\n{\n  \"html\": \"<a name=\\\"tokens-delete\\\"></a>\\n<div class=\\\"endpoint delete\\\">\\n\\t<span class=\\\"pg-type-big pg-type type-delete\\\">delete</span> https://api.ionic.io/push/tokens/{token_id}\\n</div>\"\n}\n[/block]\n**Delete a device token.**\n\n**Authentication Required:** Yes\n\n**Response:** Confirmation\n\n**Parameters:** \n\n* **token_id:** The device token ID.","excerpt":"","slug":"api-push","type":"basic","title":"Push Endpoints"}
[block:html] { "html": "<style>\n .endpoint-spacer {\n height: 20px;\n }\n \n .endpoint {\n position: relative;\n padding: 10px 20px;\n color: #555;\n font-weight: bold;\n margin-bottom: 10px;\n }\n \n .endpoint.get {\n background-color: #E4FFDD;\n }\n \n .endpoint.put {\n background-color: #FFEFFA;\n }\n \n .endpoint.post {\n background-color: #EDF5FF;\n }\n \n .endpoint.patch {\n background-color: #FFEEC7;\n }\n \n .endpoint.delete {\n background-color: #FFE4E0;\n }\n \n .docs-content hr {\n border-top: 1px solid #eee;\n border-color: #eee;\n margin-bottom: 1px;\n }\n \n .docs-content p {\n margin-left: 20px;\n }\n \n .blocks-parent > div {\n margin-bottom: 0px;\n }\n</style>" } [/block] ## Endpoints: **Notifications:** * [List](#notifications-list) your recent notifications * [Check](#notifications-get) the status of a notification * [View](#notifications-list-messages) the list of notification messages * [Post](#notifications-post) a new push notification **Messages:** * [List](#messages-list) your recent messages * [Check](#messages-get) the status of a message **Tokens:** * [List](#tokens-list) recently created tokens * [Get](#tokens-get) information about a token * [Update](#tokens-patch) a push token on Ionic servers * [Create](#tokens-post) a new token on Ionic servers * [Delete](#tokens-delete) a token from Ionic servers [block:api-header] { "type": "basic", "title": "Notifications" } [/block] [block:html] { "html": "<a name=\"notifications-list\"></a>\n<div class=\"endpoint get\">\n\t<span class=\"pg-type-big pg-type type-get\">get</span> https://api.ionic.io/push/notifications\n</div>" } [/block] **List the recent notifications you've sent** **Authentication Required:** Yes **Response:** A list of recent notifications. **Parameters:** None [block:html] { "html": "<a name=\"notifications-get\"></a>\n<div class=\"endpoint get\">\n\t<span class=\"pg-type-big pg-type type-get\">get</span> https://api.ionic.io/push/notifications/{uuid}\n</div>" } [/block] **Get information about a specific notification you've sent:** **Authentication Required:** Yes **Response:** Information about the notification. **Parameters:** * **uuid:** The notification's ID. [block:html] { "html": "<a name=\"notifications-list-messages\"></a>\n<div class=\"endpoint get\">\n\t<span class=\"pg-type-big pg-type type-get\">get</span> https://api.ionic.io/push/notifications/{uuid}/messages\n</div>" } [/block] **List the notification's recent messages you've sent** **Authentication Required:** Yes **Response:** A list of recent notification messages (actual deliveries). **Parameters:** * **uuid:** The notification id [block:html] { "html": "<a name=\"notifications-post\"></a>\n<div class=\"endpoint post\">\n\t<span class=\"pg-type-big pg-type type-post\">post</span> https://api.ionic.io/push/notifications\n</div>" } [/block] **Send a push notification:** **Authorization Required:** Yes **Response:** Confirmation and a uuid to look up the notification later. **Parameters:** * Check out [Anatomy of a Push Notification](doc:anatomy-of-a-push-notification) for a detailed overview of the POST JSON object. [block:api-header] { "type": "basic", "title": "Messages" } [/block] [block:html] { "html": "<a name=\"messages-list\"></a>\n<div class=\"endpoint get\">\n\t<span class=\"pg-type-big pg-type type-get\">get</span> https://api.ionic.io/push/messages\n</div>" } [/block] **List the recent messages sent** **Authentication Required:** Yes **Response:** A list of recent messages. **Parameters:** None [block:html] { "html": "<a name=\"messages-get\"></a>\n<div class=\"endpoint get\">\n\t<span class=\"pg-type-big pg-type type-get\">get</span> https://api.ionic.io/push/messages/{uuid}\n</div>" } [/block] **Get information about a specific message sent:** **Authentication Required:** Yes **Response:** Information about the message, most importantly its current status and any associated errors. **Parameters:** * **uuid:** The message's ID. [block:api-header] { "type": "basic", "title": "Tokens" } [/block] [block:html] { "html": "<a name=\"tokens-list\"></a>\n<div class=\"endpoint get\">\n\t<span class=\"pg-type-big pg-type type-get\">get</span> https://api.ionic.io/push/tokens\n</div>" } [/block] **List the recent tokens created** **Authentication Required:** Yes **Response:** A list of recent tokens. **Parameters:** * user_id (string) (optional) Passing a User UUID will show tokens tied to that user id. * show_invalid (bool) (optional) Passing true will show invalid tokens in the listing. [block:html] { "html": "<a name=\"tokens-get\"></a>\n<div class=\"endpoint get\">\n\t<span class=\"pg-type-big pg-type type-get\">get</span> https://api.ionic.io/push/tokens/{token_id}\n</div>" } [/block] **Get information about a specific token.** **Authentication Required:** Yes **Response:** Information about the token **Parameters:** * **token_id:** The token's ID. [block:html] { "html": "<a name=\"tokens-post\"></a>\n<div class=\"endpoint post\">\n\t<span class=\"pg-type-big pg-type type-post\">post</span> https://api.ionic.io/push/tokens\n</div>" } [/block] **Save a device token, adding it to the user collection if necessary.** **Authentication Required:** Yes **Response:** Confirmation **Parameters:** * **token:** The device token. * **user_id:** The ID for the Ionic User you wish to add the token to [block:html] { "html": "<a name=\"tokens-patch\"></a>\n<div class=\"endpoint patch\">\n\t<span class=\"pg-type-big pg-type type-patch\">patch</span> https://api.ionic.io/push/tokens/{token_id}\n</div>" } [/block] **Validate or invalidate a device token.** **Authentication Required:** Yes **Response:** Confirmation **Parameters:** * **token_id:** The device token ID. * **valid:** The validity status of the token [block:html] { "html": "<a name=\"tokens-delete\"></a>\n<div class=\"endpoint delete\">\n\t<span class=\"pg-type-big pg-type type-delete\">delete</span> https://api.ionic.io/push/tokens/{token_id}\n</div>" } [/block] **Delete a device token.** **Authentication Required:** Yes **Response:** Confirmation **Parameters:** * **token_id:** The device token ID.