Difference between revisions of "REST Push API"
From A-SMIL.org
(Created) |
|||
Line 3: | Line 3: | ||
You may push SMIL scripts and media files into a player using a [http://en.wikipedia.org/wiki/Representational_state_transfer REST] API as documented below. | You may push SMIL scripts and media files into a player using a [http://en.wikipedia.org/wiki/Representational_state_transfer REST] API as documented below. | ||
− | == | + | == Naming == |
The REST API can be accessed via prefix | The REST API can be accessed via prefix | ||
Line 19: | Line 19: | ||
Content-Type: application/x-www-form-urlencoded;charset=UTF-8 | Content-Type: application/x-www-form-urlencoded;charset=UTF-8 | ||
− | + | grant_type=password&username=... | |
== Authentication == | == Authentication == | ||
Line 27: | Line 27: | ||
=== POST oauth2/token === | === POST oauth2/token === | ||
− | + | '''Input (application/x-www-form-urlencoded)''' | |
+ | |||
+ | {| class="wikitable" border="1" style="margin: 1em auto 1em auto" | ||
+ | |- | ||
+ | ! Parameter | ||
+ | ! Function | ||
+ | |- | ||
+ | | grant_type | ||
+ | | Must be "password" | ||
+ | |- | ||
+ | | username | ||
+ | | User name requesting access. Device default value is "admin" | ||
+ | |- | ||
+ | | password | ||
+ | | Password. Device default value is the empty string "" | ||
+ | |} | ||
+ | |||
+ | '''Output (application/json)''' | ||
+ | |||
+ | {| class="wikitable" border="1" style="margin: 1em auto 1em auto" | ||
+ | |- | ||
+ | ! Parameter | ||
+ | ! Function | ||
+ | |- | ||
+ | | access_token | ||
+ | | Authorization token for further API access | ||
+ | |- | ||
+ | | token_type | ||
+ | | Always "Bearer" | ||
+ | |- | ||
+ | | expires_in | ||
+ | | Number of seconds before the access_token expires | ||
+ | |} |
Revision as of 03:02, 17 October 2012
Applies to: IAdea XMP-2200, XMP-2300 media appliances
You may push SMIL scripts and media files into a player using a REST API as documented below.
Naming
The REST API can be accessed via prefix
http://(device_ip):8080/v2/
appended by API call. For example, for API
POST oauth2/token
the actual HTTP request should be sent to (device_ip) at port 8080, with content similar to:
POST /v2/oauth2/token HTTP/1.1 Host: (device_ip) Content-Type: application/x-www-form-urlencoded;charset=UTF-8 grant_type=password&username=...
Authentication
Before a remote client can access the player, it must authenticate itself by providing the access password set in the player.
POST oauth2/token
Input (application/x-www-form-urlencoded)
Parameter | Function |
---|---|
grant_type | Must be "password" |
username | User name requesting access. Device default value is "admin" |
password | Password. Device default value is the empty string "" |
Output (application/json)
Parameter | Function |
---|---|
access_token | Authorization token for further API access |
token_type | Always "Bearer" |
expires_in | Number of seconds before the access_token expires |