Create Push Token

Prev Next
Post
/api/v1/push.token

Changelog

Version Description
9.0.0 Changed response to flat tokenType and tokenValue.
0.60.0 Added
Header parameters
X-Auth-Token
stringRequired

The authorization token of the user.

Example9HqLlyZOugoStsXCUfD_0YdwnNnunAJF8V47U3QHXSq
X-User-Id
stringRequired

The user ID of the user.

ExampleaobEdbYhXfu5hkeqG
Body parameters
Example
{
  "type": "gcm",
  "value": "TOKEN",
  "appName": "MyApp"
}
object
id
string

Optional existing push token document ID to update.

type
string Required

The possible values are apn or gcm.

value
string Required

The token value.

appName
string Required

The name of the application to associate the token with.

voipToken
string

Optional iOS VoIP (PushKit) token. Stored as a separate document; not returned in the response.

Responses
200
Success Example
{
  "result": {
    "tokenType": "gcm",
    "tokenValue": "TOKEN",
    "appName": "RocketAPP",
    "userId": "52d5Rw8LT3TeDa59Z",
    "enabled": true,
    "createdAt": "2018-09-11T18:22:55.006Z",
    "_updatedAt": "2018-09-11T18:22:55.006Z",
    "_id": "DMMjKG2hFoLvM2hk7"
  },
  "success": true
}
Expand All
object
result
object
tokenType
string

The token type: apn, gcm, or voip.

tokenValue
string

The device token.

appName
string
userId
string
enabled
boolean
createdAt
string
_updatedAt
string
_id
string
success
boolean
400

Bad Request

Invalid Token Param
{
  "success": false,
  "error": "must have required property 'type' [error-invalid-params]",
  "errorType": "error-invalid-params"
}
object
success
boolean
error
string
errorType
string
401

Unauthorized

Authorization Error
{
  "success": false,
  "error": "You must be logged in to do this."
}
object
success
boolean
error
string