Change Content¶
-
POST
/sk-api/v1/changeContent
¶ Change the content playing on a device.
- Request Headers
Authorization – The client’s Authorization header.
- Query Parameters
deviceId – Unique identification number of the device to be updated. Only one of deviceId or serialNumber can be supplied.
serialNumber – Serial number of the device to be updated. Only one of deviceId or serialNumber can be supplied.
contentId – Unique identification number of the content item to be played. Only one of contentId or contentName can be supplied.
contentName – Name of the content item to be played. Ensure content name is unique within Skykit Content Manager. Only one of contentId or contentName can be supplied.
- Status Codes
Content change request successfully issued to the device.
- Response Data
None.
Request parameters invalid.
- Response Data
message – A human-readable message explaining what went wrong. May be caused by incorrect or nonexistent IDs, or duplicated content names in Content Manager.
Authorization headers invalid.
- Response Data
message – Unauthorized for URL.
Something was wrong in the authentication headers.
- Response Data
message – Insufficient permission.
Example request:
POST /sk-api/v1/content HTTP/1.1
Example response:
HTTP/1.1 204 No Content
Example usage:
from sign_jwt import make_headers # see: Authentication import requests BASE_URI = 'https://skykit-provisioning.appspot.com' CHANGE_CONTENT_ENDPOINT = 'sk-api/v1/changeContent' URI = '{}/{}'.format(BASE_URI, CHANGE_CONTENT_ENDPOINT) def change_content(device_id=None, serial_number=None, content_id=None, content_name=None): headers = make_headers() params = {} if device_id: params['deviceId'] = device_id elif serial_number: params['serialNumber'] = serial_number if content_id: params['contentId'] = content_id elif content_name: params['contentName'] = content_name response = requests.post(URI, params=params, headers=headers) response.raise_for_status() change_content( device_id='a4e9e20dc0614df99a86bc3223c7c6c4', content_name='sample_content' )