{"revision":"c10276e953456835cdbb1f3a60d58ae1980be353","document":{"id":532,"path":"api-reference/rest-apis/pushinstallation-api.md","title":"Push Installation API","bundle":null,"doc_type":null,"release":"australia","body":"\n# Push Installation API\n\nThe Push Installation API provides endpoints to register and unregister the tokens that enable mobile devices to receive push notifications from an application.\n\nA push notification is a text message that appears on a user's mobile device to alert them about something important or to ask them to perform an action.\n\nWhen creating custom mobile applications, in order to set up Push notifications, you must register the device with the manufacturer’s service. The service must know the address of a user's device so it can properly send notifications to that device using push tokens. The device also needs to be able to receive the notifications and act on them. For instructions on how to register a device and get a push token, refer to the device’s operating systems developer documentation. For example, for Apple devices, refer to [https://developer.apple.com/documentation/usernotifications/registering\\_your\\_app\\_with\\_apns](https://developer.apple.com/documentation/usernotifications/registering_your_app_with_apns).\n\n**Parent Topic:**[REST API reference](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/rest-apis/api-rest.md)\n\n## Push Installation - POST /now/push/\\{pushApplicationName\\}/installation\n\nAdds or updates tokens that enable devices to receive push notifications from the specified application.\n\n### URL format\n\nVersioned URL: `/api/now/{api_version}/push/{pushApplicationName}/installation`\n\nDefault URL: `/api/now/push/{pushApplicationName}/installation`\n\n**Note:** Available versions are specified in the [REST API Explorer](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/rest-api-explorer/use-REST-API-Explorer.md). For scripted REST APIs there is additional version information on the [Scripted REST Service form](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/rest-api-explorer/c_CustomWebServices.md).\n\n### Supported request parameters\n\n<table class=\"rest_api_path_parameters\"><thead><tr><th>\n\nParameter\n\n</th><th>\n\nDescription\n\n</th></tr></thead><tbody><tr><td>\n\napi\\_version\n\n</td><td id=\"version-entry-RESTAPI\">\n\nOptional. Version of the endpoint to access. For example, `v1` or `v2`. Only specify this value to use an endpoint version other than the latest. Data type: String\n\n</td></tr><tr><td>\n\npushApplicationName\n\n</td><td>\n\nName of the application for which to register the push notifications. This parameter must be the same as the value in the Name column for the associated application.Data type: String\n\nTable: Push Application \\[sys\\_push\\_application\\]\n\n</td></tr></tbody>\n</table>|Name|Description|\n|----|-----------|\n|None| |\n\n<table class=\"rest_api_request_body\"><thead><tr><th>\n\nElement\n\n</th><th>\n\nDescription\n\n</th></tr></thead><tbody><tr><td>\n\nplatform\n\n</td><td>\n\nPlatform on which to register the push notification. Data type: String\n\nTable: In the Name field of the Push Platform \\[sys\\_push\\_platform\\] table.\n\n</td></tr><tr><td>\n\ntoken\n\n</td><td>\n\nToken supplied by the device manufacturer, such as Apple, when the mobile application registers to receive push notifications. Data type: String\n\nStored in: Push Notification Installation \\[sys\\_push\\_notif\\_app\\_install\\]\n\n</td></tr></tbody>\n</table>### Headers\n\nThe following request and response headers apply to this HTTP action only, or apply to this action in a distinct way. For a list of general headers used in the REST API, see [Supported REST API headers](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/rest-api-explorer/c_RESTAPI.md).\n\n|Header|Description|\n|------|-----------|\n|Content-Type|Data format of the request body. Only supports **application/json**.|\n\n|Header|Description|\n|------|-----------|\n|None| |\n\n### Status codes\n\nThe following status codes apply to this HTTP action. For a list of possible status codes used in the REST API, see [REST API HTTP response codes](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/rest-api-explorer/c_RESTAPI.md).\n\n|Status code|Description|\n|-----------|-----------|\n|200|Successful. The request was successfully processed.|\n|400|Bad Request. A bad request type or malformed request was detected.|\n|401|Unauthorized. The user credentials are incorrect or have not been passed.|\n|500|Internal Server Error. A logic error on the server-side code occurred.|\n\n### Response body parameters \\(JSON or XML\\)\n\n|Name|Description|\n|----|-----------|\n|None||\n\n### Sample cURL request\n\n```\ncurl -X POST \\\n  https://instance.servicenow.com/api/now/push/ServiceNowPushApp/installation \\\n--header \"Content-Type: application/json\" \\\n--user \"username\":\"password\" \\\n--data '{\"platform\":\"Apple\",\"token\":\"544836d77ac2e551bbf78204630509a7d494fc87f52e85da52e5b5d42910e2cf\"}' \\\n```\n\n```\nNone\n```\n\n## Push Installation - POST /now/push/\\{pushApplicationName\\}/removeInstallation\n\nDeactivates the tokens that enable mobile devices to receive push notifications from the specified application.\n\n### URL format\n\nVersioned URL: `/api/now/{api_version}/push/{pushApplicationName}/removeInstallation`\n\nDefault URL: `/api/now/push/{pushApplicationName}/removeInstallation`\n\n**Note:** Available versions are specified in the [REST API Explorer](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/rest-api-explorer/use-REST-API-Explorer.md). For scripted REST APIs there is additional version information on the [Scripted REST Service form](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/rest-api-explorer/c_CustomWebServices.md).\n\n### Supported request parameters\n\n<table class=\"rest_api_path_parameters\"><thead><tr><th>\n\nName\n\n</th><th>\n\nDescription\n\n</th></tr></thead><tbody><tr><td>\n\napi\\_version\n\n</td><td id=\"version-entry-RESTAPI\">\n\nOptional. Version of the endpoint to access. For example, `v1` or `v2`. Only specify this value to use an endpoint version other than the latest. Data type: String\n\n</td></tr><tr><td>\n\npushApplicationName\n\n</td><td>\n\nName of the application for which to unregister the push notifications.Data type: String\n\nTable: In the Name field for the associated application in the Push Application \\[sys\\_push\\_application\\] table.\n\n</td></tr></tbody>\n</table>|Name|Description|\n|----|-----------|\n|None| |\n\n<table class=\"rest_api_request_body\"><thead><tr><th>\n\nElement\n\n</th><th>\n\nDescription\n\n</th></tr></thead><tbody><tr><td>\n\nplatform\n\n</td><td>\n\nPlatform on which to register the push notification. Data type: String\n\nTable: In the Name field of the Push Platform \\[sys\\_push\\_platform\\] table.\n\n</td></tr></tbody>\n</table>### Headers\n\nThe following request and response headers apply to this HTTP action only, or apply to this action in a distinct way. For a list of general headers used in the REST API, see [Supported REST API headers](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/rest-api-explorer/c_RESTAPI.md).\n\n|Header|Description|\n|------|-----------|\n|Content-Type|Data format of the request body. Only supports **application/json**.|\n\n|Header|Description|\n|------|-----------|\n|None| |\n\n### Status codes\n\nThe following status codes apply to this HTTP action. For a list of possible status codes used in the REST API, see [REST API HTTP response codes](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/rest-api-explorer/c_RESTAPI.md).\n\n|Status code|Description|\n|-----------|-----------|\n|200|Successful. The request was successfully processed.|\n|400|Bad Request. A bad request type or malformed request was detected.|\n|401|Unauthorized. The user credentials are incorrect or have not been passed.|\n|500|Internal Server Error. A logic error on the server-side code occurred.|\n\n### Response body parameters \\(JSON or XML\\)\n\n|Name|Description|\n|----|-----------|\n|None||\n\n### Sample cURL request\n\n```\ncurl -X POST \\\n  https://instance.servicenow.com/api/now/push/ServiceNowPushApp/removeInstallation \\\n--header \"Content-Type: application/json\" \\\n--user \"username\":\"password\" \\\n--data '{\"platform\":\"Apple\"}' \\\n```\n\n```\nNone\n```\n\n"}}