Client APIs
At its core, SyncTV is an API driven service. The APIs themselves are easy enough for developers to understand, but understanding the ecosystem is a little trickier. We've created the following tutorials to help you get your head around it.

Topics:

  • Accounts

This document describes the API for creating, reading, updating and deleting accounts.

Note:
Each call to the SyncTV V2 API described in this section requires an MD5 hash signature.
See the Authorization (User) API for details on generating the MD5 hash signature.
Actions

Url:

  • [GET] /api/v2/accounts/:id.[xml|json]

Returns information for the specified user account

Required Arguments:
  • (Integer) access_id
    Access id returned from Authorization (User) client_authorize.
  • (String) signature
    MD5 hash encoded string of query parameters.
Example Request

The following URL returns the account information for account with id == 100.
[GET] https://service_name.synctv.com/api/v2/accounts/100.xml?access_id=1234&signature=674aaff974348eb1a1bdd72dce75053d
Example Response
XML JSON

<response>
  <accounts>
    <id>100</id>
    <email>test-account-11@synctv.com</email>
    <status>1</status>
    <roles>
      <role>user</role>
    </roles>
    <properties>
    </properties>
    <created_at>2014-05-01T21:24:13Z</created_at>
    <updated_at>2014-05-01T21:24:13Z</updated_at>
  </accounts>
</response>
Response Fields:
  • (Integer) account[id]
    The unique id of the account.
  • (String) account[email]
    The email address of the user.
  • (Integer) account[status]
    The status of the account [0 == inactive, 1 == active].
  • (Element) account[roles]
    A list of roles associated with the account used to determine access permissions.

Url:

  • [POST] /api/v2/accounts.[xml|json]

Creates a new user account.

Example Request

The following URL creates an account with email "john_smith@synctv.com" and password "12345".
[POST] https://service_name.synctv.com/api/v2/accounts.xml?account[email]=john_smith@synctv.com&account[password]=12345&account[password_confirmation]=12345&access_id=1234&signature=674aaff974348eb1a1bdd72dce75053d
Request Field:
  • (Integer) access_id — Access id returned from Authorization (User) client_authorize.
  • (String) signature — MD5 hash encoded string of query parameters.
  • (String) account[email] — The email address of the user [e.g. john_smith@synctv.com].
  • (String) account[password] — The password for the account.
  • (String) account[password_confirmation] — The password confirmation.
  • (String) account[meta_data_attributes][][key] — Used to set the meta data key value.
  • (String) account[meta_data_attributes][][value] — Used to set the meta data value value.
  • (String) account[account_type_id] — Used to set the account type.
  • (Array) account[roles][] — Sets an account's role as "admin", "backend" or "user" (creator must have the correct permissions).
Example Response
XML JSON

<response>
  <account>
    <id>1</id>
    <email>test-account-12@synctv.com</email>
    <status>1</status>
    <roles>
      <role>user</role>
    </roles>
    <properties>
    </properties>
    <created_at>2014-05-01T21:24:14Z</created_at>
    <updated_at>2014-05-01T21:24:14Z</updated_at>
  </account>
</response>
Response Fields:
  • (Integer) account[id]
    The unique id of the account.
  • (String) account[email]
    The email address of the user.
  • (Integer) account[status]
    The status of the account [0 == inactive, 1 == active].
  • (Element) account[roles]
    A list of roles associated with the account used to determine access permissions.

Url:

  • [GET] /api/v2/accounts/current.[xml|json]

Returns information for the current user account.

Required Arguments:
  • (Integer) access_id
    Access id returned from Authorization (User) client_authorize.
  • (String) signature
    MD5 hash encoded string of query parameters.
Example Request

The following URL returns the account information of the current user account
[GET] https://service_name.synctv.com/api/v2/accounts/current.xml?access_id=1234&signature=674aaff974348eb1a1bdd72dce75053d
Example Response
XML JSON

<response>
  <account>
    <id>1</id>
    <email>test-account-13@synctv.com</email>
    <status>1</status>
    <roles>
      <role>user</role>
    </roles>
    <properties>
    </properties>
    <created_at>2014-05-01T21:24:15Z</created_at>
    <updated_at>2014-05-01T21:24:15Z</updated_at>
  </account>
</response>
Response Fields:
  • (Integer) account[id]
    The unique id of the account.
  • (String) account[email]
    The email address of the user.
  • (Integer) account[status]
    The status of the account [0 == inactive, 1 == active].
  • (Element) account[roles]
    The list of roles associated with the account used to determine access permissions.