Resource: Offers

Topics:

Actions

  • - (Object) index

Url:

  • [GET] /rest/v1/offers?[arguments]
Note:

This action does not require a cookie session. If there is no cookie session then the device id parameter is required.

Returns a list of offers

Arguments:

  • (Integer) device

    The id of the service device (only required if no cookie session)

Example Request:

https://service_name.synctv.com/rest/v1/offers?device=urn:synctv:devices:web:11223344

Example Response:

<ssap>
  <response>
    <count>2</count>
    <code>1</code>
    <message>Successfully completed.</message>
  </response>
  <version>0.5</version>
  <offers type="array">
    <offer>
      <name>default</name>
      <requires_promo_code type="boolean">false</requires_promo_code>
      <id type="integer">100</id>
      <starts_on nil="true"/>
      <ends_on nil="true"/>
    </offer>
    <offer>
      <name>30-day promotion</name>
      <requires_promo_code type="boolean">true</requires_promo_code>
      <id type="integer">101</id>
      <starts_on nil="true"/>
      <ends_on nil="true"/>
    </offer>
  </offers>
</ssap>

Response Fields:

  • (Array) offers

    A list of offers. See below for a description of offer fields.

  • - (Object) show

Url:

  • [GET] /rest/v1/offers/:id?[arguments]
Note:

This action does not require a cookie session. If there is no cookie session then the device id parameter is required.

Returns information for an offer

Arguments:

  • (Integer) device

    The id of the service device (only required if no cookie session)

Example Request:

The following URL returns the information for offer with id == 100 
https://service_name.synctv.com/rest/v1/offers/100?device=urn:synctv:devices:web:11223344

Example Response:

<ssap>
  <offer>
    <name>default</name>
    <requires_promo_code type="boolean">false</requires_promo_code>
    <id type="integer">100</id>
    <starts_on nil="true"/>
    <ends_on nil="true"/>
  </offer>
  <response>
    <count>2</count>
    <code>1</code>
    <message>Successfully completed.</message>
  </response>
  <version>0.5</version>
</ssap>

Response Fields:

  • (Integer) id

    A unique ID identifying the Offer.

  • (String) name

    A string the describes the offer. This value should be unique to other offers.

  • (Date) starts_on

    Indicates the starting date for the offer. If empty no start date is defined.

  • (Date) ends_on

    Indicates the ending datefor the offer. If empty no end date is defined.

  • (Boolean) requires_promo_code

    If true indicates that a valid promo_code is required to use the offer. See promo_code API for more information.