Examples

POST /api/v2/push-notification-tokens
{
  "data": {
    "type": "push-notification-tokens",
    "attributes": {
      "token": "nt5KjURfCEhYm:TDaks1Sz3QGIiLZB4lX0OWAvnt5KjURfCEhYm:TDaks1Sz3QGIiLZB4lX0OWAvnt5KjURfCEhYm:TDaks1Sz3QGIiLZB4lX0OWAvnt5KjURfCEhYm:TDaks1Sz3QGIiLZB4lX0OWAv",
      "browser": "firefox",
      "active": true,
      "user-agent": null,
      "platform": "web",
      "mobile-os": null
    },
    "relationships": {
      "account": {
        "data": {
          "type": "accounts",
          "id": "27"
        }
      }
    }
  }
}
201
{
  "data": {
    "id": "16",
    "type": "push-notification-tokens",
    "links": {
      "self": "http://test.host/api/v2/push-notification-tokens/16"
    },
    "attributes": {
      "token": "nt5KjURfCEhYm:TDaks1Sz3QGIiLZB4lX0OWAvnt5KjURfCEhYm:TDaks1Sz3QGIiLZB4lX0OWAvnt5KjURfCEhYm:TDaks1Sz3QGIiLZB4lX0OWAvnt5KjURfCEhYm:TDaks1Sz3QGIiLZB4lX0OWAv",
      "browser": "firefox",
      "active": true,
      "user-agent": null,
      "platform": "web",
      "mobile-os": null
    },
    "relationships": {
      "account": {
        "links": {
          "self": "http://test.host/api/v2/push-notification-tokens/16/relationships/account",
          "related": "http://test.host/api/v2/push-notification-tokens/16/account"
        }
      }
    }
  }
}

Params

Param name Description
data
required

Push notification token information

Validations:

  • Must be a Hash

data[token]
optional

Service provider's unique token

Validations:

  • Must be a String

data[browser]
optional

Type of browser (required if platform is web)

Validations:

  • Must be one of: chrome, firefox.

data[active]
optional

Token status

Validations:

  • Must be one of: true, false.

data[platform]
required

Platform type

Validations:

  • Must be one of: web, native.

data[mobile_os]
optional

Mobile OS type (required if platform is native)

Validations:

  • Must be one of: ios, android.