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:

  • Ownership policies

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

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

Returns a list of all ownership policies.

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 ownership policies.
[GET] https://service_name.synctv.com/api/v2/ownership_policies.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.
  • (Array) bundle_ids — Filter ownership policies by bundle ids associated with it(E.g. bundle_ids[]=1&bundle_ids[]=3)
  • (Array) status — Filter ownership policies by status(E.g. status[]=1&status[]=-1)
  • (DateTime) begin_at_greater — Filter ownership policies by begin_at >= specified timestamp (E.g. begin_at_greater=2012-02-15T02:06:56Z)
  • (DateTime) begin_at_less — Filter ownership policies by begin_at <= specified timestamp (E.g. begin_at_greater=2012-02-15T02:06:56Z)
  • (DateTime) end_at_greater — Filter ownership policies by end_at >= specified timestamp (E.g. end_at_greater=2012-02-15T02:06:56Z)
  • (DateTime) end_at_less — Filter ownership policies by end_at <= specified timestamp (E.g. end_at_greater=2012-02-15T02:06:56Z)
  • (Array) any_of_view_rule_ids — Filter ownership policies by any of the given view rule ids associated with it (E.g. any_of_view_rule_ids[]=1&any_of_view_rule_ids[]=3)
  • (Array) all_of_view_rule_ids — Filter ownership policies by all of the given view rule ids associated with it (E.g. all_of_view_rule_ids[]=1&all_of_view_rule_ids[]=3)
  • (Array) none_of_view_rule_ids — Filter ownership policies by none of the given view rule ids associated with it (E.g. none_of_view_rule_ids[]=1&none_of_view_rule_ids[]=3)
  • (Array) any_of_price_rule_ids — Filter ownership policies by any of the given price rule ids associated with it (E.g. any_of_price_rule_ids[]=1&any_of_price_rule_ids[]=3)
  • (Array) all_of_price_rule_ids — Filter ownership policies by all of the given price rule ids associated with it (E.g. all_of_price_rule_ids[]=1&all_of_price_rule_ids[]=3)
  • (Array) none_of_price_rule_ids — Filter ownership policies by none of the given price rule ids associated with it (E.g. none_of_price_rule_ids[]=1&none_of_price_rule_ids[]=3)
  • (Array) any_of_ownership_factory_ids — Filter ownership policies by any of the given ownership factory ids associated with it (E.g. any_of_ownership_factory_ids[]=1&any_of_ownership_factory_ids[]=3)
  • (Array) all_of_ownership_factory_ids — Filter ownership policies by all of the given ownership factory ids associated with it (E.g. all_of_ownership_factory_ids[]=1&all_of_ownership_factory_ids[]=3)
  • (Array) none_of_ownership_factory_ids — Filter ownership policies by none of the given ownership factory ids associated with it (E.g. none_of_ownership_factory_ids[]=1&none_of_ownership_factory_ids[]=3)
  • (Array) any_of_available_platform_ids — Filter ownership policies by any of the given platform ids associated through platform view rules to ownership policies, this also includes ownership policies with no platform view rules as they belong to all active platforms. (E.g. any_of_available_platform_ids[]=1&any_of_available_platform_ids[]=3)
  • (Array) any_of_available_platform_type_ids — Filter ownership policies by any of the given platform type ids associated through platform view rules to ownership policies, this also includes ownership policies with no platform view rules as they belong to all active platforms. (E.g. any_of_available_platform_type_ids[]=1&any_of_available_platform_type_ids[]=3)
  • (Array) any_of_platform_ids — Filter ownership policies by any of the given platform ids associated through platform view rule to ownership policies (E.g. any_of_platform_ids[]=1&any_of_platform_ids[]=3)
  • (Array) all_of_platform_ids — Filter ownership policies by all of the given platform ids associated through platform view rules to ownership policies (E.g. all_of_platform_ids[]=1&all_of_platform_ids[]=3)
  • (Array) none_of_platform_ids — Filter ownership policies by none of the given platform ids associated through platform view rules to ownership policies (E.g. none_of_platform_ids[]=1&none_of_platform_ids[]=3)
  • (Float) available_price_greater — Filter ownership policies with price >= specified price (E.g. available_price_greater=1.99)
  • (Float) available_price_less — Filter ownership policies with price <= specified price (E.g. available_price_less=1.99)
  • (Array) any_of_available_price_currencies — Filter ownership policies with any of price currencies specified symbols (E.g. any_of_available_price_currencies[]=USD)
Example Response
XML JSON

<response>
  <ownership_policies>
    <ownership_policy>
      <id>1</id>
      <name>MyString</name>
      <description>Some description</description>
      <status>1</status>
      <begin_at nil="true"/>
      <end_at nil="true"/>
      <updated_at>2014-05-01T21:33:15Z</updated_at>
      <created_at>2014-05-01T21:33:15Z</created_at>
      <price>
        <amount>0</amount>
        <currency>USD</currency>
        <tax>0</tax>
      </price>
    </ownership_policy>
    <ownership_policy>
      <id>2</id>
      <name>MyString</name>
      <description>Some description</description>
      <status>1</status>
      <begin_at nil="true"/>
      <end_at nil="true"/>
      <updated_at>2014-05-01T21:33:15Z</updated_at>
      <created_at>2014-05-01T21:33:15Z</created_at>
      <price>
        <amount>0</amount>
        <currency>USD</currency>
        <tax>0</tax>
      </price>
    </ownership_policy>
  </ownership_policies>
</response>
Response Fields:
  • (Integer) ownership_policy[id]
    The ownership policy's unique identifier.
  • (Integer) ownership_policy[status]
    The status of the ownership policy (-1 - Deleted, 0 - Inactive, 1 - Active).
  • (String) ownership_policy[name]
    The ownership policy's name.
  • (String) ownership_policy[description]
    The ownership policy's description.
  • (DateTime) ownership_policy[begin_at]
    The ownership policy's avilability date begin_at.
  • (DateTime) ownership_policy[end_at]
    The ownership policy's avilability date end_at.
  • (DateTime) ownership_policy[created_at]
    Timestamp of when the ownership policy was created.
  • (DateTime) ownership_policy[updated_at]
    Timestamp of when the ownership policy was last updated.
  • (Array) ownership_policy[platform_ids]
    The list of platform ids for the media.

Url:

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

Returns information for the specified ownership policy.

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

<response>
  <ownership_policy>
    <id>100</id>
    <name>MyString</name>
    <description>Some description</description>
    <status>1</status>
    <begin_at nil="true"/>
    <end_at nil="true"/>
    <updated_at>2014-05-01T21:33:16Z</updated_at>
    <created_at>2014-05-01T21:33:16Z</created_at>
    <price>
      <amount>0</amount>
      <currency>USD</currency>
      <tax>0</tax>
    </price>
  </ownership_policy>
  <price_rules>
    <price_rule>
      <id>1</id>
      <name>MyString</name>
      <type>OwnershipPolicy::PriceRule</type>
      <key>HD</key>
      <options>
      </options>
      <price>1.5</price>
      <percent nil="true"/>
      <currency>USD</currency>
      <tax>0.0</tax>
      <status>1</status>
      <created_at>2014-05-01T21:33:16Z</created_at>
      <updated_at>2014-05-01T21:33:16Z</updated_at>
    </price_rule>
    <price_rule>
      <id>2</id>
      <name>MyString</name>
      <type>OwnershipPolicy::PriceRule</type>
      <key>HD</key>
      <options>
      </options>
      <price>1.5</price>
      <percent nil="true"/>
      <currency>USD</currency>
      <tax>0.0</tax>
      <status>1</status>
      <created_at>2014-05-01T21:33:16Z</created_at>
      <updated_at>2014-05-01T21:33:16Z</updated_at>
    </price_rule>
  </price_rules>
  <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:33:16Z</created_at>
      <updated_at>2014-05-01T21:33:16Z</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:33:16Z</created_at>
      <updated_at>2014-05-01T21:33:16Z</updated_at>
    </view_rule>
  </view_rules>
  <ownership_factories>
    <ownership_factory>
      <id>1</id>
      <name>MyString</name>
      <type>OwnershipPolicy::OwnershipFactory</type>
      <key>HD</key>
      <options>
      </options>
      <status>0</status>
      <created_at>2014-05-01T21:33:16Z</created_at>
      <updated_at>2014-05-01T21:33:16Z</updated_at>
      <timeline_duration nil="true"/>
    </ownership_factory>
    <ownership_factory>
      <id>2</id>
      <name>MyString</name>
      <type>OwnershipPolicy::OwnershipFactory</type>
      <key>HD</key>
      <options>
      </options>
      <status>0</status>
      <created_at>2014-05-01T21:33:16Z</created_at>
      <updated_at>2014-05-01T21:33:16Z</updated_at>
      <timeline_duration nil="true"/>
    </ownership_factory>
  </ownership_factories>
  <bundle_ids>
    <bundle_id>1</bundle_id>
    <bundle_id>2</bundle_id>
  </bundle_ids>
</response>
Response Fields:
  • (Integer) ownership_policy[id]
    The ownership policy's unique identifier.
  • (Integer) ownership_policy[status]
    The status of the ownership policy (-1 - Deleted, 0 - Inactive, 1 - Active).
  • (String) ownership_policy[name]
    The ownership policy's name.
  • (String) ownership_policy[description]
    The ownership policy's description.
  • (DateTime) ownership_policy[begin_at]
    The ownership policy's avilability date begin_at.
  • (DateTime) ownership_policy[end_at]
    The ownership policy's avilability date end_at.
  • (DateTime) ownership_policy[created_at]
    Timestamp of when the ownership policy was created.
  • (DateTime) ownership_policy[updated_at]
    Timestamp of when the ownership policy was last updated.
  • (Array) ownership_policy[platform_ids]
    The list of platform ids for the media.
  • (Array) price_rules
    The price rules associated with this ownership policy. See the Ownership Policy (Price Rules) API for a description of the response fields.
  • (Array) view_rules
    The view rules associated with this ownership policy. See the Ownership Policy (View Rules) API for a description of the response fields.
  • (Array) ownership_factories
    The ownership factory(s) associated with this ownership policy. See the Ownership Policy (Ownership Factories) API for a description of the response fields.
  • (Array) bundle_ids
    The ids of bundle(s) associated with this ownership policy. See the Bundles API for a description of the response fields.

Url:

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

Creates a new ownership policy.

Required Arguments:
  • (Integer) access_id
    Access id returned from Authorization (User) client_authorize.
  • (String) signature
    MD5 hash encoded string of query parameters.
  • (String) ownership_policy[name]
    The ownership policy's name.
  • (String) ownership_policy[description]
    The ownership policy's description.
Example Request

The following URL creates an ownership policy with name "Rental for 60 days" and status "1"
[POST] https://service_name.synctv.com/api/v2/ownership_policies.xml?ownership_policy[name]=Rental+for+60+days&ownership_policy[status]=1&access_id=1234&signature=674aaff974348eb1a1bdd72dce75053d
Request Field:
  • (Integer) ownership_policy[status] — The status of the ownership policy (0 - inactive, 1 - active).
  • (Array) ownership_policy[view_rule_ids][] — Array of view rule ids that should be linked to this ownership policy (e.g. ownership_policy[view_rule_ids][]=1&ownership_policy[view_rule_ids][]=3&ownership_policy[view_rule_ids][]=2).
  • (Array) ownership_policy[price_rule_ids][] — Array of price rule ids that should be linked to this ownership policy (e.g. ownership_policy[price_rule_ids][]=3&ownership_policy[price_rule_ids][]=5&ownership_policy[price_rule_ids][]=1).
  • (Array) ownership_policy[ownership_factory_ids][] — Array of ownership factory ids that should be linked to this ownership policy (e.g. ownership_policy[ownership_factory_ids][]=2&ownership_policy[ownership_factory_ids][]=1&ownership_policy[ownership_factory][]=4).
  • (Array) ownership_policy[bundle_ids][] — Array of bundle ids that should be linked to this ownership policy (e.g. ownership_policy[bundle_ids][]=2&ownership_policy[bundle_ids][]=1&ownership_policy[bundle_ids][]=4).
  • (Array) ownership_policy[platform_ids][] — Array of bundle ids that should be linked to this ownership policy (e.g. ownership_policy[platform_ids][]=2&ownership_policy[platform_ids][]=1&ownership_policy[platform_ids][]=4).
  • (DateTime) ownership_policy[begin_at] — The timestamp for when the ownership policy becomes active.
  • (DateTime) ownership_policy[end_at] — The timestamp for when the ownership policy is no longer active active.
Example Response
XML JSON

<response>
  <ownership_policy>
    <id>1</id>
    <name>MyString</name>
    <description>Some description</description>
    <status>1</status>
    <begin_at nil="true"/>
    <end_at nil="true"/>
    <updated_at>2014-05-01T21:33:17Z</updated_at>
    <created_at>2014-05-01T21:33:17Z</created_at>
    <price>
      <amount>0</amount>
      <currency>USD</currency>
      <tax>0</tax>
    </price>
  </ownership_policy>
</response>
Response Fields:
  • (Integer) ownership_policy[id]
    The ownership policy's unique identifier.
  • (Integer) ownership_policy[status]
    The status of the ownership policy (-1 - Deleted, 0 - Inactive, 1 - Active).
  • (String) ownership_policy[name]
    The ownership policy's name.
  • (String) ownership_policy[description]
    The ownership policy's description.
  • (DateTime) ownership_policy[begin_at]
    The ownership policy's avilability date begin_at.
  • (DateTime) ownership_policy[end_at]
    The ownership policy's avilability date end_at.
  • (DateTime) ownership_policy[created_at]
    Timestamp of when the ownership policy was created.
  • (DateTime) ownership_policy[updated_at]
    Timestamp of when the ownership policy was last updated.

Url:

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

Updates the specified ownership policy.

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 ownership policy 100 to have the new name "Rental for 59 days".
[PUT] https://service_name.synctv.com/api/v2/ownership_policies/100.xml?ownership_policy[name]=Rental+for+59+days&access_id=1234&signature=674aaff974348eb1a1bdd72dce75053d

The following URL updates ownership policy 100's second view_rule to reference view_rule 4.
[PUT] https://service_name.synctv.com/api/v2/ownership_policies/100.xml?ownership_policy[view_rule_ids][2]=4&access_id=1234&signature=674aaff974348eb1a1bdd72dce75053d
Request Field:
  • (String) ownership_policy[name] — The ownership policy's name.
  • (String) ownership_policy[description] — The ownership policy's description.
  • (Integer) ownership_policy[status] — The status of ownership policy (0 - inactive, 1 - active)
  • (Array) ownership_policy[view_rule_ids][] — Array of view rule ids that should be linked to this ownership policy (e.g. ownership_policy[view_rule_ids][]=1&ownership_policy[view_rule_ids][]=3&ownership_policy[view_rule_ids][]=2).
  • (Array) ownership_policy[price_rule_ids][] — Array of price rule ids that should be linked to this ownership policy (e.g. ownership_policy[price_rule_ids][]=3&ownership_policy[price_rule_ids][]=5&ownership_policy[price_rule_ids][]=1).
  • (Array) ownership_policy[ownership_factory_ids][] — Array of ownership factory ids that should be linked to this ownership policy (e.g. ownership_policy[ownership_factory_ids][]=2&ownership_policy[ownership_factory_ids][]=1&ownership_policy[ownership_factory][]=4).
  • (Array) ownership_policy[bundle_ids][] — Array of bundle ids that should be linked to this ownership policy (e.g. ownership_policy[bundle_ids][]=2&ownership_policy[bundle_ids][]=1&ownership_policy[bundle_ids][]=4).
  • (Array) ownership_policy[platform_ids][] — Array of bundle ids that should be linked to this ownership policy (e.g. ownership_policy[platform_ids][]=2&ownership_policy[platform_ids][]=1&ownership_policy[platform_ids][]=4).
  • (DateTime) ownership_policy[begin_at] — The timestamp for when the ownership policy becomes active.
  • (DateTime) ownership_policy[end_at] — The timestamp for when the ownership policy is no longer active active.
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>Name can't be empty.</message>
  </messages>
</response>

Url:

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

Ownership Policies cannot be truly deleted, this will set the specified ownership policy's status to -1 (Deleted).

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" ownership policy with id = 100
[DELETE] https://service_name.synctv.com/api/v2/ownership_policies/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>