Update Device
This request updates a device, targeted by secure ID.
| patch | /push/devices/{device_sid} |
| put | /push/devices/{device_sid} |
Sample
A sample PATCH request to update the Device object, targeted by secure ID, with the values in the request body:
curl -X PATCH \
'https://api.carrierx.com/core/v2/push/devices/56d485ae-0693-421a-91eb-6b02b152573a' \
-H 'Content-Type: application/json' \
--data-binary '{"type":"android"}' \
-H 'Authorization: Bearer 5ebc03d6-8b2b-44ad-bf65-72d4f1491dda'
Response
200 status code with a serialized copy of the updated Device object:
{
"application_sid": "b3edc875-f73c-4c48-895a-8697b92b8d07",
"application_version": null,
"device_sid": "56d485ae-0693-421a-91eb-6b02b152573a",
"environment": "production",
"os_version": null,
"partner_sid": "e00430c3-a7d0-4666-ab5c-f7202448382f",
"token": "1111",
"type": "android"
}
A Device object can be updated using either a PATCH or PUT request.
-
A
PATCHrequest can be used to update one or more attribute values. When using aPATCHrequest, only the attributes specified in the request payload will be updated, all other attributes and values will remain the same. The device secure ID is passed in the query URL, and the values to be modified are passed in the request body. -
A
PUTrequest can be used to update an entire Device object. The device secure ID is passed in the query URL, and the entire Device object is passed in the request body.
Note, while all the fields must be present in a PUT request, not all the attribute values may be modified after the initial creation, because when created, some of them become read-only.
Required Scopes
To update a device object, the partner must have one of the following scopes enabled:
push.managepush.update
Path Arguments
| Parameter | Data Type | Description |
|---|---|---|
| device_sid required | string | The device secure ID. |
Body Arguments
JSON representation of the fields and values to be updated.
Fields that can be modified are:
application_versionenvironmentos_versiontokentype
Refer to this table to view all fields that appear in the Device object.