Admin 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:

  • Ipwhitelists

This document describes the API for creating, reading, updating and deleting whitelisted country codes and/or IPs.

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/ip_whitelists.[xml|json]

Returns a list of all whitelisted IPs and country codes.

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 example returns a listing of all whitelisted IPs and country codes.
[GET] https://service_name.synctv.com/api/v2/ip_whitelists.xml?access_id=1234&signature=674aaff974348eb1a1bdd72dce75053d
Example Response
XML JSON

<response>
  <ip_whitelists>
    <ip_whitelist>
      <id>1</id>
      <value>10.10.10.1</value>
      <type>ip</type>
    </ip_whitelist>
    <ip_whitelist>
      <id>2</id>
      <value>10.10.10.2</value>
      <type>ip</type>
    </ip_whitelist>
  </ip_whitelists>
</response>
Response Fields:
  • (Response) IpWhitelist
    A list of all IpWhitelists. See below for a description of the response fields.

Url:

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

Returns information for the specified IpWhitelist.

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 ip whitelist information for ip whitelist with id == 100.
[GET] https://service_name.synctv.com/api/v2/ip_whitelists/100.xml?access_id=1234&signature=674aaff974348eb1a1bdd72dce75053d
Example Response
XML JSON

<response>
  <ip_whitelist>
    <id>100</id>
    <value>10.10.10.3</value>
    <type>ip</type>
  </ip_whitelist>
</response>
Response Fields:
  • (Integer) ip_whitelist[id]
    The unique identifier of the IpWhitelist.
  • (String) ip_whitelist[type]
    The type of whitelist 'ip' or 'country_code2'.
  • (String) ip_whitelist[value]
    The IP or country code that is whitelisted.

Url:

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

Creates a new IpWhitelist.

Required Arguments:
  • (Integer) access_id
    Access id returned from Authorization (User) client_authorize.
  • (String) signature
    MD5 hash encoded string of query parameters.
  • (String) ip_whitelist[type]
    The type of whitelist (either 'ip' or 'country_code2' ONLY).
  • (String) ip_whitelist[value]
    The IP or country code to be white listed.
Example Request

The following URL creates an ip whitelist with type "ip" and value "207.46.19.254"
[POST] https://service_name.synctv.com/api/v2/ip_whitelists.xml?ip_whitelist[type]=ip&ip_whitelist[value]="207.46.19.254"&access_id=1234&signature=674aaff974348eb1a1bdd72dce75053d
Example Response
XML JSON

<response>
  <ip_whitelist>
    <id>1</id>
    <value>207.46.19.254</value>
    <type>ip</type>
  </ip_whitelist>
</response>
Response Fields:
  • (Integer) ip_whitelist[id]
    The unique identifier of IpWhitelist.
  • (String) ip_whitelist[type]
    The type of whitelist 'ip' or 'country_code2'.
  • (String) ip_whitelist[value]
    The IP or country code that is whitelisted.

Url:

  • [PUT] /api/v2/ip_whitelists/:id.[xml|json]

Updates the specified IpWhitelist.

Note:
This will return only success or failure, no content.
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 updates ip_whitelist 100 to have ip "207.46.19.254"
[PUT] https://service_name.synctv.com/api/v2/ip_whitelists/100.xml?ip_whitelist[value]="207.46.19.254"&access_id=1234&signature=674aaff974348eb1a1bdd72dce75053d
Request Field:
  • (String) ip_whitelist[type] — The type of whitelist (either 'ip' or 'country_code2' ONLY).
  • (String) ip_whitelist[value] — The IP or country code to update the whitelist with.
Example Response
XML JSON

On success: HTTP 200
On error:   HTTP 400 with array of errors in message tags
<response>
  <code>-3</code>
  <messages>
    <message>Value can't be blank.</message>
  </messages>
</response>

Url:

  • [DELETE] /api/v2/ip_whitelists/:id.[xml|json]

Delete the specified whitelist.

Note:
This will return only success or failure, no content.
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 deletes ip whitelist 100.
[DELETE] https://service_name.synctv.com/api/v2/ip_whitelists/100.xml?access_id=1234&signature=674aaff974348eb1a1bdd72dce75053d
Example Response
XML JSON

On success: HTTP 200
On error:   HTTP 400 with array of errors in message tags
<response>
  <code>-4</code>
  <messages>
    <message>Record not found</message>
  </messages>
</response>