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:

  • View rules

This document describes the API for reading ownership view rules.

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

Returns a list of all view rules.

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 list of all view rules.
https://service_name.synctv.com/api/v2/ownership_policies/view_rules.xml?access_id=1234&signature=674aaff974348eb1a1bdd72dce75053d
Request Field:
  • (Integer) offset — Used for pagination of response data (default: 25 items per response). Specifies the offset of the next block of data to receive.
  • (String) key_like — Filters response to include items that contain the specified value in the key field (e.g. key_like=lost).
Example Response
XML JSON

<response>
  <view_rules>
    <view_rule>
      <id>1</id>
      <name>MyString</name>
      <type>OwnershipPolicy::ViewRule</type>
      <key>HD</key>
      <options>
      </options>
      <status>1</status>
      <created_at>2014-05-01T21:34:28Z</created_at>
      <updated_at>2014-05-01T21:34:28Z</updated_at>
    </view_rule>
    <view_rule>
      <id>2</id>
      <name>MyString</name>
      <type>OwnershipPolicy::ViewRule</type>
      <key>HD</key>
      <options>
      </options>
      <status>1</status>
      <created_at>2014-05-01T21:34:28Z</created_at>
      <updated_at>2014-05-01T21:34:28Z</updated_at>
    </view_rule>
  </view_rules>
</response>
Response Fields:
  • (Integer) view_rule[id]
    The view rule's unique identifier.
  • (String) view_rule[name]
    The view rule's name.
  • (String) view_rule[type]
    The view rule's type.
  • (String) view_rule[key]
    The view rule's key; it is used as part of the associated ownership_policy's key generation.
  • (Hash) view_rule[options]
    Hash array of configurable options unique to each rule.
  • (Integer) view_rule[status]
    The status of the view rule (0 - inactive, 1 - active).
  • (DateTime) view_rule[created_at]
    The date of the view rule's creation.
  • (DateTime) view_rule[updated_at]
    The date of the view rule's last update.

Url:

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

Returns detailed information for the specified view rule.

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 ownership policy view rule with ID =100.
https://service_name.synctv.com/api/v2/ownership_policies/view_rules/100.xml?access_id=1234&signature=674aaff974348eb1a1bdd72dce75053d
Example Response
XML JSON

<response>
  <view_rule>
    <id>100</id>
    <name>MyString</name>
    <type>OwnershipPolicy::ViewRule</type>
    <key>HD</key>
    <options>
    </options>
    <status>1</status>
    <created_at>2014-05-01T21:34:30Z</created_at>
    <updated_at>2014-05-01T21:34:30Z</updated_at>
  </view_rule>
</response>
Response Fields:
  • (Integer) view_rule[id]
    The view rule's unique identifier.
  • (String) view_rule[name]
    The view rule's name.
  • (String) view_rule[type]
    The view rule's type.
  • (String) view_rule[key]
    The view rule's key; it is used as part of the associated ownership_policy's key generation.
  • (Hash) view_rule[options]
    Hash array of configurable options unique to each rule.
  • (Integer) view_rule[status]
    The status of the view rule (0 - inactive, 1 - active).
  • (DateTime) view_rule[created_at]
    The date of the view rule's creation.
  • (DateTime) view_rule[updated_at]
    The date of the view rule's last update.