Resource: Accounts

Topics:

Actions

  • - (Object) index(method = GET, url = '/rest/v1/accounts')

Url:

  • [GET] /rest/v1/accounts
Note:

This action requires a cookie session with admin rights. See the documentation for REST Session for more information.

Returns a list of user accounts.

Arguments:

  • (DateTime) subscription_end_from

    (optional) Filters accounts by start of subscription end date.

  • (DateTime) subscription_end_to

    (optional) Filters accounts by end of subscription end date.

  • (String) subscription_status

    (optional) Filters accounts by subscription status [values: active, suspended, cancelled, not_started, billing_hold, ended, expired].

  • (DateTime) created_at_from

    (optional) Filters by start of created_at.

  • (DateTime) created_at_to

    (optional) Filters by end of created_at.

  • (String) sort_order

    (optional) Set sort order for accounts [values: subscription_cancels_on - sorts by subscription cancels_on column].

Example Request:

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

Example Response:

<scbp>
  <accounts type="array">
    <account>
      <id>100</id>
      <created_at>Aug 30, 2011 01:20AM</created_at>
      <account_status>active</account_status>
      <account_type>standard</account_type>
      <billing_status>no_card_on_file</billing_status>
      <terms_accepted>true</terms_accepted>
      <receive_news_email>false</receive_news_email>
      <disable_billing>true</disable_billing>
      <first_name/>
      <last_name/>
      <email>john_doe@myservice.com</email>
      <phone_number/>
      <content_access_code/>
      <offer_id/>
      <street1/>
      <street2/>
      <city/>
      <state_prov/>
      <postal_code/>
      <country/>
      <epg_eid/>
      <epg_etoken/>
      <epg_packages/>
    </account>
    <account>
      <id>101</id>
      <created_at>Aug 31, 2011 01:20AM</created_at>
      <account_status>active</account_status>
      <account_type>standard</account_type>
      <billing_status>no_card_on_file</billing_status>
      <terms_accepted>true</terms_accepted>
      <receive_news_email>false</receive_news_email>
      <disable_billing>true</disable_billing>
      <first_name/>
      <last_name/>
      <email>mary_doe@myservice.com</email>
      <phone_number/>
      <content_access_code/>
      <offer_id/>
      <street1/>
      <street2/>
      <city/>
      <state_prov/>
      <postal_code/>
      <country/>
      <epg_eid/>
      <epg_etoken/>
      <epg_packages/>
    </account>
  </accounts>
  <response>
    <count>2</count>
    <code>1</code>
    <message>Successfully completed.</message>
  </response>
  <version>0.6</version>
</scbp>
  • - (Object) show(method = GET, url = '/rest/v1/accounts/:id OR /rest/v1/account')

Url:

  • [GET] /rest/v1/accounts/:id (admin access)
  • [GET] /rest/v1/account (user access)
Note:

This action requires a cookie session with either admin or user rights. See the documentation for REST Sessions for more information.

Note:

For admin access use ’/rest/v1/accounts/:id’. For user access use ’/rest/v1/account’.

Returns information for a user account

Example Request:

[Admin Access]
The following URL returns the account information for account with id == 100 
https://service_name.synctv.com/rest/v1/accounts/100

[User Access]
The following URL returns the account information for the current logged-in user 
https://service_name.synctv.com/rest/v1/account

Example Response:

<ssap>
  <account>
    <id>100</id>
    <created_at>Aug 30, 2011 01:20AM</created_at>
    <account_status>active</account_status>
    <account_type>standard</account_type>
    <billing_status>no_card_on_file</billing_status>
    <terms_accepted>true</terms_accepted>
    <receive_news_email>false</receive_news_email>
    <disable_billing>true</disable_billing>
    <first_name/>
    <last_name/>
    <email>john_doe@myservice.com</email>
    <phone_number/>
    <content_access_code/>
    <offer_id/>
    <street1/>
    <street2/>
    <city/>
    <state_prov/>
    <postal_code/>
    <country/>
    <epg_eid/>
    <epg_etoken/>
    <epg_packages/>
  </account>
  <response>
    <count>1</count>
    <code>1</code>
    <message>Successfully completed.</message>
  </response>
  <billing_url>https://example.billing.url</billing_url>
  <version>0.6</version>
</ssap>
  • - (Object) create(method = POST, url = '/rest/v1/accounts')

Url:

  • [POST] /rest/v1/accounts
Note:

If the service has more than one offer associated with it, then one of promo_code, price_id, or offer_id parameters must be included.

Note:

When billing info is required on signup, the response will include a ‘billing_url’ which must be used to present an iframe containing the credit card entry form. If you append a ‘return_url’ parameter to the billing_url (ie. https://billing.url?return_url=https://my.site/success.html), then the iframe will redirect to your return_url upon success.

Creates a new user account.

Arguments:

  • (String) promo_code

    <see note> The promo code value that should be used to create the account.

  • (Number) price_id

    <see note> The id of the price that should be used to create the account.

  • (Number) fee_id

    <see note> The id of the fee (price) that should be used to create the account (depricated: use price_id).

  • (Number) offer_id

    <see note> The id of the offer that should be used to create the account. This param should only be included for offers that have a single fee (price).

Example Request:

Create new account with promo_code
[POST] https://service_name.synctv.com/rest/v1/accounts?promo_code=HJ48H9&account[email]=john_doe@myservice.com&account[password]=123abc&account[password_confirmation]=123abc&account[terms_accepted]=true
Create new account with price_id
[POST] https://service_name.synctv.com/rest/v1/accounts?price_id=1987&account[email]=john_doe@myservice.com&account[password]=123abc&account[password_confirmation]=123abc&account[terms_accepted]=true
Create new account with offer_id
[POST] https://service_name.synctv.com/rest/v1/accounts?offer_id=1023&account[email]=john_doe@myservice.com&account[password]=123abc&account[password_confirmation]=123abc&account[terms_accepted]=true

Request Fields:

  • (String) account[email]

    The email address of the new user (e.g. john_smith@gmail.com). This value is used to identify the user account on login.

  • (String) account[password]

    The password for the account. This value is used validate the user account on login.

  • (String) account[password_confirmation]

    Confirmation of the password. Value must match password.

  • (Boolean) account[terms_accepted]

    ‘true’ indicates acceptance of service terms.

  • (String) account[first_name]

    <optional> First name of user.

  • (String) account[last_name]

    <optional> Last name of user.

  • (String <standard, test, press>) account[account_type]

    <optional> The type of account to create. Default: ‘standard’.

Example Response:

<ssap>
  <account>
    <id>100</id>
    <created_at>Aug 30, 2011 01:20AM</created_at>
    <account_status>active</account_status>
    <account_type>standard</account_type>
    <billing_status>no_card_on_file</billing_status>
    <terms_accepted>true</terms_accepted>
    <receive_news_email>false</receive_news_email>
    <disable_billing>true</disable_billing>
    <first_name/>
    <last_name/>
    <email>john_doe@myservice.com</email>
    <phone_number/>
    <content_access_code/>
    <offer_id/>
    <street1/>
    <street2/>
    <city/>
    <state_prov/>
    <postal_code/>
    <country/>
    <epg_eid/>
    <epg_etoken/>
    <epg_packages/>
  </account>
  <response>
    <count>1</count>
    <code>1</code>
    <message>Successfully completed.</message>
  </response>
  <billing_url>https://example.billing.url</billing_url>
  <version>0.6</version>
</ssap>
  • - (Object) update(method = PUT, url = '/rest/v1/accounts/:id OR /rest/v1/account')

Url:

  • [PUT] /rest/v1/accounts/:id (admin access)
  • [PUT] /rest/v1/account (user access)
Note:

This action requires a cookie session with either admin or user rights. See the documentation for REST Sessions for more information.

Note:

For admin access use ’/rest/v1/accounts/:id’. For user access use ’/rest/v1/account’.

Updates a user account.

Arguments:

  • (String) promo_code

    A new promo code that should be applied to the account.

  • (Number) offer_id

    The id of a new offer that should be applied to the account.

  • (Number) price_id

    The id of a new price that should be applied to the account.

Example Request:

Update account with a new email address
[PUT] https://service_name.synctv.com/rest/v1/accounts/100?account[email]=marry_doe@myservice.com

Update account with a new price
[PUT] https://service_name.synctv.com/rest/v1/accounts/100?price_id=1987

Update account with a new promo code
[PUT] https://service_name.synctv.com/rest/v1/accounts/100?promo_code=BZ39H6

Request Fields:

  • (String) account[email]

    The new email address of the user (e.g. john_smith@gmail.com).

  • (String) account[password]

    The new password for the account.

  • (String) account[password_confirmation]

    Confirmation of the password. Value must match password.

  • (Boolean) account[terms_accepted]

    Indicates acceptance of service terms.

  • (String) account[first_name]

    New first name of user.

  • (String) account[last_name]

    New last name of user.

  • (String) account[account_type]

    The type of account [values: standard, test, press].

Example Response:

See response for #create action
  • - (Object) reset_passord(method = GET, url = '/rest/v1/accounts/reset_password')

Url:

  • [GET] /rest/v1/accounts/reset_password
Note:

Details regarding the use of this action are pending.

Resets the password of a user account.