Change Content ============== .. http:post:: /sk-api/v1/changeContent Change the content playing on a device. :reqheader Authorization: The client's :ref:`Authorization header `. :query deviceId: Unique identification number of the device to be updated. Only one of **deviceId** or **serialNumber** can be supplied. :query serialNumber: Serial number of the device to be updated. Only one of **deviceId** or **serialNumber** can be supplied. :query contentId: Unique identification number of the content item to be played. Only one of **contentId** or **contentName** can be supplied. :query 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 204 No Content: Content change request successfully issued to the device. :Response Data: None. :status 400 Bad Request: 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. :status 401 Unauthorized: Authorization headers invalid. :Response Data: - **message** -- Unauthorized for URL. :status 403 Forbidden: Something was wrong in the authentication headers. :Response Data: - **message** -- Insufficient permission. **Example request**: .. sourcecode:: http POST /sk-api/v1/content HTTP/1.1 **Example response**: .. sourcecode:: http HTTP/1.1 204 No Content **Example usage**: .. sourcecode:: python 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' )