Resource: Rest Sessions

Topics:

Actions

  • - (Object) create

Url:

  • [GET] /rest/v1/sessions/create?[arguments]

Establishes a cookie-based session with the web service. The session can be created with either admin or user access rights.

Arguments:

  • (String) device

    The id of the service web device

  • (String) admin

    The login email of the admin account (required for admin session)

  • (String) username

    The login email of the user account (required for user session)

  • (String) password

    The password of the admin/user account

Example Request:

[Admin Access]
The following URL initiates a admin-based session with the web service
https://service_name.synctv.com/rest/v1/sessions/create?device=urn:synctv:devices:web:11223344&admin=admin_name@gmail.com&password=admin_password

[User Access]
The following URL initiates a user-based session with the web service
https://service_name.synctv.com/rest/v1/sessions/create?device=urn:synctv:devices:web:11223344&username=user_name@gmail.com&password=user_password

Example Response:

[Admin Access]
<scbp>
  <admin>
    <first_name>John</first_name>
    <last_name>Smith</last_name>
    <email> admin_name@gmail.com </email>
    <id type="integer">48</id>
  </admin>
  <response>
    <code>1</code>
    <message>Successfully completed.</message>
    <count>1</count>
  </response>
  <session>9bd719d2a8e38f92ffd39f6234a02de0</session>
  <version>0.6</version>
</scbp>

[User Access]
<scbp>
  <account>
    <display_name>John</display_name>
    <email>user_name@synctv.com</email>
    <id type="integer">12345</id>
  </account>
  <response>
    <count>1</count>
    <code>1</code>
    <message>Successfully completed.</message>
  </response>
  <session>e350ceef42477e8b35fe2d772ccfe26e</session>
  <display_name>John</display_name>
  <version>0.6</version>
</scbp>

Response Fields:

  • (Tag) response

    Contains information about the response. A <code> value of 1 indicates success.

  • (Tag) admin/account

    Contains information about the admin/user account.

  • (Tag) session

    A unique session identifier. Can be ignored for cookie-based sessions.