Devices

Devices Documentation

Device [LIST]

Device [LIST]

Request

Endpoint

GET /api/v2/user/devices
Content-Type: application/vnd.api+json

Body

Response

Headers

Content-Type: application/vnd.api+json; charset=utf-8
200 OK

Body

{
  "data": [
    {
      "id": "3cc5f497-2132-4582-ba96-b6d4649c65cb",
      "type": "user_devices",
      "attributes": {
        "created_at": "2022-01-12T17:18:43Z",
        "locale": "en",
        "platform": "GCM",
        "updated_at": "2022-01-12T17:18:43Z",
        "updated_in_db_at": "2022-01-12T17:18:43Z",
        "version": "0.0.1"
      },
      "relationships": {
        "user": {
          "data": {
            "id": "1c772015-fcb6-4719-bd3f-5523f1039405",
            "type": "users"
          }
        }
      }
    }
  ],
  "meta": {
    "pagination": {
      "page": 1,
      "per_page": 25,
      "total_count": 1,
      "total_pages": 1
    },
    "sort": null,
    "filter": {
    }
  }
}

Fields

data

Type [Device]

Description An array of Device Objects

Device [POST]

Device [POST]

Request

Endpoint

POST /api/v2/user/devices
Content-Type: application/vnd.api+json

Body

{
  "data": {
    "type": "user_devices",
    "attributes": {
      "locale": "en",
      "platform": "GCM",
      "token": "a5b4dddf-2cbe-4d72-ace1-3ef86626ff1e",
      "updated_in_db_at": "2022-01-12 17:18:43 UTC",
      "version": "0.0.1"
    }
  }
}

Parameters

Attributes

created_at

Type date

Description The timestamp of when this resource was created

Required No

locale

Type string

Description The locale set on the device (to localize push notifications sent to the device)

Required No

platform

Type string

Description The platform which the device is registered on (must be either APNS or GCM)

Required No

token

Type string

Description The token provided by the platform needed for the server to send notifications to the device

Required No

updated_at

Type date

Description The timestamp of when this resource was last updated

Required No

updated_in_db_at

Type date

Description This is to be used as a reference for the last time the resource was updated in the remote database - specifically for when data is updated while the client is offline.

Required No

version

Type string

Description The version of the client app installed on the device

Required No

Response

Headers

Content-Type: application/vnd.api+json; charset=utf-8
201 Created

Body

{
  "data": {
    "id": "880eac5d-83ef-41f7-abab-aad72d477ac6",
    "type": "user_devices",
    "attributes": {
      "created_at": "2022-01-12T17:18:43Z",
      "locale": "en",
      "platform": "GCM",
      "updated_at": "2022-01-12T17:18:43Z",
      "updated_in_db_at": "2022-01-12T17:18:43Z",
      "version": "0.0.1"
    },
    "relationships": {
      "user": {
        "data": {
          "id": "940acb1e-a98c-4638-98b9-172bcc6b9072",
          "type": "users"
        }
      }
    }
  }
}

Fields

Attributes

created_at

Type date

Description The timestamp of when this resource was created

locale

Type string

Description The locale set on the device (to localize push notifications sent to the device)

platform

Type string

Description The platform which the device is registered on (must be either APNS or GCM)

updated_at

Type date

Description The timestamp of when this resource was last updated

updated_in_db_at

Type date

Description This is to be used as a reference for the last time the resource was updated in the remote database - specifically for when data is updated while the client is offline.

version

Type string

Description The version of the client app installed on the device

Relationships

user.data

Type User

Description A user that this device is associated with

Device [GET]

Device [GET]

Request

Endpoint

GET /api/v2/user/devices/c4a3fb7a-ed8d-4d07-a499-fd09e3422b4f
Content-Type: application/vnd.api+json

Body

Response

Headers

Content-Type: application/vnd.api+json; charset=utf-8
200 OK

Body

{
  "data": {
    "id": "c4a3fb7a-ed8d-4d07-a499-fd09e3422b4f",
    "type": "user_devices",
    "attributes": {
      "created_at": "2022-01-12T17:18:43Z",
      "locale": "en",
      "platform": "GCM",
      "updated_at": "2022-01-12T17:18:43Z",
      "updated_in_db_at": "2022-01-12T17:18:43Z",
      "version": "0.0.1"
    },
    "relationships": {
      "user": {
        "data": {
          "id": "8e5501c4-0e3c-407f-a176-2d744536d75a",
          "type": "users"
        }
      }
    }
  }
}

Fields

Attributes

created_at

Type date

Description The timestamp of when this resource was created

locale

Type string

Description The locale set on the device (to localize push notifications sent to the device)

platform

Type string

Description The platform which the device is registered on (must be either APNS or GCM)

updated_at

Type date

Description The timestamp of when this resource was last updated

updated_in_db_at

Type date

Description This is to be used as a reference for the last time the resource was updated in the remote database - specifically for when data is updated while the client is offline.

version

Type string

Description The version of the client app installed on the device

Relationships

user.data

Type User

Description A user that this device is associated with

Device [DELETE]

Device [DELETE]

Request

Endpoint

DELETE /api/v2/user/devices/9d99d846-cb7b-4c67-836b-754812b93717
Content-Type: application/vnd.api+json

Body

Response

Headers

204 No Content

Body

Last updated