Client devices

GET /api/client_devices
show all devices registered to the current logged in user

Success Response Code: 200

Response Fields

client_devices[registration_id] registration ID to identify this device for push notifications String
client_devices[push_enabled] whether any pushes go to this device Boolean
client_devices[push_conversation_activity] whether this device should receive push notifications for conversations Boolean
client_devices[push_mentions] whether this device should receive push notifications for @ mentions Boolean
client_devices[push_announcements] whether this device should receive push notifications for broadcast messages Boolean
client_devices[push_replies] whether this device should receive push notifications for message replies Boolean
client_devices[push_hashtags] whether this device should receive push notifications for subscribed hashtags Boolean
client_devices[notification_type] the types of notifications this client receives: 'main' or 'conversations' String
client_devices[client_id] the registered client_id relating to this device Integer
client_devices[os_version] the OS version of the registered device (if applicable) String
client_devices[client_version] the version of the app on the registered device (if applicable) String

Example Curl Commands

curl -X GET -v --basic -u "emily@socialcast.com:demo" https://demo.socialcast.com/api/client_devices.json

Examples

GET /api/client_devices.json
200
{
  "client_devices": [
    {
      "registration_id": "T√łken!1",
      "push_enabled": true,
      "push_mentions": true,
      "push_conversation_activity": true,
      "push_announcements": true,
      "push_replies": false,
      "push_hashtags": true,
      "notification_type": "main",
      "client_id": 1,
      "os_version": null,
      "client_version": null
    }
  ]
}

PUT /api/client_devices
register a device to the current logged in user. Client devices are referenced by registration_id and notification_type

Success Response Code: 204

Params

Param name Description
registration_id
required

id for the device


Value: Must be a String
notification_type
optional

notification type (default='main')


Value: Must be one of: <code>main</code>, <code>conversations</code>.
client_device
optional

Value: Must be a Hash
client_device[push_enabled]
optional

whether any pushes go to this device


Value: Must be one of: <code>true</code>, <code>false</code>.
client_device[push_conversation_activity]
optional

whether this device should receive push notifications for conversations


Value: Must be one of: <code>true</code>, <code>false</code>.
client_device[push_mentions]
optional

whether this device should receive push notifications for @ mentions


Value: Must be one of: <code>true</code>, <code>false</code>.
client_device[push_announcements]
optional

whether this device should receive push notifications for broadcast messages


Value: Must be one of: <code>true</code>, <code>false</code>.
client_device[push_replies]
optional

whether this device should receive push notifications for message replies


Value: Must be one of: <code>true</code>, <code>false</code>.
client_device[push_hashtags]
optional

whether this device should receive push notifications for subscribed hashtags


Value: Must be one of: <code>true</code>, <code>false</code>.
client_device[os_version]
optional

the OS version of the registered device (if applicable)


Value: Must be a String
client_device[client_version]
optional

the version of the app on the registered device (if applicable)


Value: Must be a String

Example Curl Commands

curl -X PUT -v --basic -u "emily@socialcast.com:demo" https://demo.socialcast.com/api/client_devices.json -F "registration_id=token-1" -F "client_device[push_replies]=true"

DELETE /api/client_devices
unregister a device. Client devices are referenced by registration_id and notification_type

Success Response Code: 204

Params

Param name Description
registration_id
required

id for the device


Value: Must be a String
notification_type
optional

notification type (default='main')


Value: Must be one of: <code>main</code>, <code>conversations</code>.

Example Curl Commands

curl -X DELETE -v --basic -u "emily@socialcast.com:demo" https://demo.socialcast.com/api/client_devices -F "registration_id=token-1" -F "notification_type=main"