Push Device Registration (PUT)

Updates an existing device registration for the push service.

Description

The push device registration is updated with the new user ID or the token specified. In most use cases this call is used to update the userId only.

Method

PUT

Path

/apps/applicationId/devices/deviceId

Example

https://example.com:443/imfpush/v1/apps/myapp/devices/12345-6789

Path Parameters

deviceId
The device identifier
applicationId
The name or identifier of the application

Header Parameters

Some header parameters are optional.

Accept-Language
(Optional) The preferred language to use for error messages. Default:en-US
Authorization
The token with the scope "devices.write" and "push.application.<applicationId>" obtained using the confidential client in the format Bearer token.. This parameter has to be mandatorily set.
Content-Type
Specify the JSON content type. For example: application/json. This parameter has to be mandatorily set.

Consumes

application/json

Produces

application/json

Payload

The details of the device registration will be updated.

JSON Example

{
  "deviceId" : "12345-6789",
  "phoneNumber" : "123456789",
  "token" : "xyz",
  "userId" : "admin",
}

Payload Properties

The payload has the following properties:
deviceId
The unique id of the device.
phoneNumber
Phone number to be used for SMS based notification.
token
The token of the device. Its optional to set this.
userId
The userId of the device. Its optional to set this.

Response

The details of the device registration that is updated.

JSON Example

{
  "createdMode" : "API",
  "createdTime" : "2015-05-20T11:42:11Z",
  "deviceId" : "12345-6789",
  "lastUpdatedTime" : "2015-05-20T11:42:11Z",
  "phoneNumber" : "123456789",
  "platform" : "A",
  "token" : "xyz",
  "userId" : "admin",
}

Response Properties

The response has the following properties:

createdMode
The mode of creation.
createdTime
The date and time when the push device registration was created on the server in ISO 8601 format.
deviceId
The unique id of the device.
lastUpdatedTime
The date and time when the push device registration was last updated on the server in ISO 8601 format.
phoneNumber
Phone number to be used for SMS based notification.
platform
The device platform.
token
The unique push token of the device.
userId
The userId of the device.

Errors

400
A device registration has userId longer than 254 characters.
401
Unauthorized - The caller is either not authenticated or not authorized to make this request.
404
A device registration with the specified deviceId is not found.
405
Unsupported Content type - The content type specified in Content-Type header is not application/json.
406
Unsupported Accept type - The content type specified in Accept header is not application/json.
500
An internal error occurred.