DEVELOPER API
Radbox allows third-party applications to add videos via an Application Programming Interface (API).
Application Registration
To get started, you will require to register your application with Radbox and obtain a developer key (referred as devKey).
If you already have registered your application, you can find your developer key from API key section in Application Details column on applications details page.
Authentication and Shared Parameters
Radbox API requires that user identification credential to be supplied as query arguments. For this purpose, each registered user has been assigned a unique api key. Registered users can find their API key from extras section from their Radbox account. This key will be referred as userKey.
REST API to add videos to Radbox
Use the below REST api to add video to a user's queue
http://api.radbox.me/video/add?url=url&dev=devKey&user=userKey&t=title
Parameters
Required
- url: Url to be parsed for videos
- devKey: developer key of the application.
- userKey: user api key for user identification
Optional
- t: Page title
Resulting status codes
Results will be passed in json format.
- 200: URL has been successfully parsed for videos and videos has been added to Radbox account.
- 400: Bad request like missing a required parameter.
- 403: Invalid parameters like userKey or devKey
- 503: for an unknown error or temporary unavailability
In case no video is found from the url sprecified, return code of 200 will be returned even though no video has been added to Radbox account.
Examples
Note: For devKey and userKey values '1234abcd' are used. Replace these values with actual values. devKey and userKey used other than '1234abcd' in this documentation should be assumed to be invalid.
Example 1: All Valid Parameters
API call
http://api.radbox.me/video/add?
url=http%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3Dr80GknSNZFQ
&userKey=1234abcd
&devKey=1234abcd
Result
{
"status": 200,
"video_urls": ["http://radbox.me/watch/video/355"],
"number_of_videos": 1
}
Example 2: Missing Requried Parameters
API call
http://api.radbox.me/video/add
Result
{
"status": 400,
"error_message":
[
"url is a required parameter.",
"devKey is a required parameter.",
"userKey is a required parameter."
]
}
Example 3: Invalid devKey and userKey
API call
http://api.radbox.me/video/add?
url=http%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DHGmRKSds9OY
&userKey=1234
&devKey=1234
Result
{
"status": 403,
"error_message":
[
"Invalid devKey - no registered application exists with the dev key passed.",
"Invalid userKey - no registered user exits with the user key passed."
]
}
Example 4: Multiple videos embedded on a single page
API call
http://api.radbox.me/video/add?
url=http%3A%2F%2Fmashable.com%2F2010%2F09%2F08%2Fsocial-media-tv%2F
&userKey=1234abcd
&devKey=1234abcd
Result
{
"status": 200,
"video_urls":
[
"http://radbox.me/watch/video/356",
"http://radbox.me/watch/video/357",
"http://radbox.me/watch/video/358",
"http://radbox.me/watch/video/359",
"http://radbox.me/watch/video/360"
],
"number_of_videos": 5
}