State

State represents the current view of the host OnSong app.

Check state

URL/api/<auth_token>/state
MethodHEAD
Version1.0

Description

Determines if the state has change since last checked. Use this method when polling the server to avoid unnecessary requests.

Path arguments

Name Type Description Required
auth_token string The authentication token used to authenticate the request. Required

Response

This call contains no data. The developer should check the Last-Modified header for a change.

View state

URL/api/<auth_token>/state
MethodGET
Version1.0

Description

Displays the current state of the host.

Path arguments

Name Type Description Required
auth_token string The authentication token used to authenticate the request. Required

Response

Returns the State Object representing the current state of the host.

Change state

URL/api/<auth_token>/state
MethodPOST
Version1.0

Description

Changes the state of the host. Use for changes songs and scroll positions.

Path arguments

Name Type Description Required
auth_token string The authentication token used to authenticate the request. Required

Body

Include the properties of the State Object which you want to change.

Response

Returns an object containing the properties that were changed.

{
    "/state/song": "7FB03044-C4CB-4820-997F-5E0A35E144F2",
    "/state/position": 0.75
}