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:

  • Custom ownerships

This document describes the API for listing the currently authorized account's ownerships.

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

Returns a list of the currently authorized account's ownerships, the associated media and it's viewing progress.

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 the currently authorized account's ownerships.
[GET] https://service_name.synctv.com/api/v2/custom/ownerships.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) status — Filter by status.(E.g. status[]=1&status[]=2&status[]=3)
  • (String) sort_order — Defines the sort order of the response. (e.g. sort_order=created_at)
  • (String) id — The unique identifier of the ownership.
  • (String) begin_at — Timestamp for when the currently authorized account's ownership started.
  • (String) end_at — Timestamp for when the currently authorized account's ownership is suppose to end.
  • (String) created_at — Timestamp for when the ownership was created.
  • (Boolean) sort_descending — Reverse order of sort_order sorting, make it descending.
  • (Integer) platform_id — Filters response to include only items with the provided platform_id (e.g. platform_id=1).
  • (Integer) bundle_id — Filters response to include only items with the provided bundle_id (e.g. bundle_id=1).
  • (Integer) ownership_policy_id — Filters response to include only items with the provided ownership_policy_id (e.g. ownership_policy_id=1).
Example Response
XML JSON

<response>
  <ownerships>
    <ownership>
      <id>1</id>
      <bundle_id>1</bundle_id>
      <ownership_policy_id>1</ownership_policy_id>
      <account_id>1</account_id>
      <status>0</status>
      <begin_at>2012-02-24T10:04:18Z</begin_at>
      <end_at>2012-02-24T10:04:18Z</end_at>
      <platform_id>1</platform_id>
      <device_uid nil="true"/>
      <device_user_uid nil="true"/>
      <playback_begin_at nil="true"/>
      <playback_end_at nil="true"/>
      <created_at>2014-05-01T21:26:03Z</created_at>
      <activated_at nil="true"/>
      <expired_at nil="true"/>
    </ownership>
    <ownership>
      <id>2</id>
      <bundle_id>2</bundle_id>
      <ownership_policy_id>2</ownership_policy_id>
      <account_id>2</account_id>
      <status>0</status>
      <begin_at>2012-02-24T10:04:18Z</begin_at>
      <end_at>2012-02-24T10:04:18Z</end_at>
      <platform_id>2</platform_id>
      <device_uid nil="true"/>
      <device_user_uid nil="true"/>
      <playback_begin_at nil="true"/>
      <playback_end_at nil="true"/>
      <created_at>2014-05-01T21:26:03Z</created_at>
      <activated_at nil="true"/>
      <expired_at nil="true"/>
    </ownership>
  </ownerships>
  <medias>
    <media>
      <id>1</id>
      <name>Media-40</name>
      <description>this is a description</description>
      <active>true</active>
      <order_number nil="true"/>
      <available_platform_ids>
        <available_platform_id>3</available_platform_id>
      </available_platform_ids>
      <audio_languages/>
      <subtitle_languages/>
      <duration>600</duration>
      <hd>false</hd>
      <container_ids/>
      <media_type>
        <id>1</id>
        <name>MediaType-43</name>
      </media_type>
      <meta_data/>
      <available_at nil="true"/>
      <expires_at nil="true"/>
      <created_at>2014-05-01T21:26:03Z</created_at>
      <updated_at>2014-05-01T21:26:03Z</updated_at>
      <images/>
      <external_id nil="true"/>
      <published_at>2013-07-01T21:23:35Z</published_at>
      <avg_rating>0.0</avg_rating>
      <properties>
      </properties>
    </media>
    <media>
      <id>2</id>
      <name>Media-41</name>
      <description>this is a description</description>
      <active>true</active>
      <order_number nil="true"/>
      <available_platform_ids>
        <available_platform_id>4</available_platform_id>
      </available_platform_ids>
      <audio_languages/>
      <subtitle_languages/>
      <duration>600</duration>
      <hd>false</hd>
      <container_ids/>
      <media_type>
        <id>2</id>
        <name>MediaType-44</name>
      </media_type>
      <meta_data/>
      <available_at nil="true"/>
      <expires_at nil="true"/>
      <created_at>2014-05-01T21:26:03Z</created_at>
      <updated_at>2014-05-01T21:26:03Z</updated_at>
      <images/>
      <external_id nil="true"/>
      <published_at>2013-07-01T21:23:35Z</published_at>
      <avg_rating>0.0</avg_rating>
      <properties>
      </properties>
    </media>
  </medias>
  <views>
    <view>
      <id>1</id>
      <account_id>3</account_id>
      <account_profile_id nil="true"/>
      <media_id>3</media_id>
      <client_id>1</client_id>
      <watched_time>3000</watched_time>
      <type>Account::Activity::MediaView</type>
      <created_at>2014-05-01T21:26:03Z</created_at>
    </view>
    <view>
      <id>2</id>
      <account_id>4</account_id>
      <account_profile_id nil="true"/>
      <media_id>4</media_id>
      <client_id>2</client_id>
      <watched_time>4000</watched_time>
      <type>Account::Activity::MediaView</type>
      <created_at>2014-05-01T21:26:03Z</created_at>
    </view>
  </views>
</response>
Response Fields:
  • (Array) ownerships
    List of currently authorized user's ownerships (See the Ownerships API for a description of the response fields).
  • (Array) medias
    List of the media associated with the listed ownerships (See the Medium (Media) API for a description of the response fields).
  • (Array) views
    List of the viewing progress of each listed media(See the Medium (Views) API for a description of the response fields).

Url:

  • [GET] /api/v2/custom/ownerships/count.[xml|json]

Returns a count of the currently authorized account's ownerships.

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 ownerships.
[GET] https://service_name.synctv.com/api/v2/custom/ownerships.xml?access_id=1234&signature=674aaff974348eb1a1bdd72dce75053d
Request Field:
  • (Array) status — Filter by status.(E.g. status[]=1&status[]=2&status[]=3)
Example Response
XML JSON

<response>
  <count>30</count>
  <code>1</code>
  <message>Successfully completed.</message>
</response>
Response Fields:
  • (Integer) count
    The total count of the currently authorized account's ownerships.