Qik.ly APIs provide a way to do more with the video links associated with a Qik video. These APIs are accessible throgh JSON-RPC and REST interfaces.
Interfaces
JSON-RPC
Entry point: http://qik.ly/api/jsonrpc
Request should be encoded in JSON and POSTed to that URL in body of request. Response for that request comes JSON-encoded.
Example 1:
Request
POST /api/jsonrpc HTTP/1.0
Host: qik.ly
{"method": "qik.ly.expand", "params": ["http:]}
POST /api/jsonrpc HTTP/1.0
Host: qik.ly
{"method": "qik.ly.expand", "params": ["http:]}
{"fault": "QikJSONRPCError", "faultCode": 2009, "faultString": "Passed URL is invalid: 'http:}
REST
REST-like API, entry point is http://qik.ly/api/ , append method name delimited with slashes instead of dots without "qik.ly" part, for example: http://qik.ly/api/expand stands for qik.ly.expand. Request parameters could be transferred in URL for GET request, or in POST body urlencoded, as usual. Response comes always JSON-encoded, errors are reported as HTTP errors.
GET /api/expand?url=http:Host: qik.ly
Methods
qik.ly.expand
Expands a qik.ly video URL to a the regular qik.com/video/* link
Synopsis: qik.ly.expand(url)
Inputs:
Param |
Type |
Description |
url |
string |
qik.ly short URL |
Returns:
Type |
Description |
string |
qik.com video URL of the format qik.com/video/number
|
Example: http://qik.ly/examples/qikly/expand.html
click here for Illustration
Simple HTTP
Just follow URL, e.g. http://qik.ly/Jya . This should result in HTTP 301 redirect to actual qik.com link or 404 Not Found if no such stream exists (or if stream is private).
POST /api/jsonrpc HTTP/1.0
Host: qik.ly
{"method": "qik.ly.expand", "params": ["http:]}
GET /api/expand?url=http:Host: qik.ly
qik.ly.shorten
Shorten qik.com/video/* link into short qik.ly link.
Synopsis: qik.ly.shorten(url)
Input:
Param |
Type |
Description |
url |
string |
qik.com video url |
Returns:
Type |
Description |
string |
qik.ly shortened URL
|
Example: http://qik.ly/examples/qikly/shorten.html
POST /api/jsonrpc HTTP/1.0
Host: qik.ly
{"method": "qik.ly.shorten", "params": ["http:]}
GET /api/shorten?url=http:Host: qik.ly
Thumbnail
Get thumbnail for qik video uploaded using qik.ly link.
Example: http://qik.ly/examples/qikly/expand.html
qik.ly.info
Get information about stream from qik.ly link.
Synopsis: qik.ly.info(url)
Input:
Param
|
Type
|
Description
|
url
|
str |
To get short qik.ly url, e.g. http://qik.ly/JueP
|
Return:
Type
|
Description
|
dict
|
To get detailed information about stream: title, duration, embed code, user, etc. |
Embedding
Embedding Flash Player with qik.ly video can be done in two ways:
-
Put <script src="http://qik.ly/QacL.js" type="text/javascript"></script> into HTML code. Just add ".js" to qik.ly link to get JavaScript embedding code.
-
Load content of http://qik.ly/QacL.html (just add ".html" to qik.ly link) into any HTML container with AJAX call to get video loaded dynamically into your page.
Examples: http://qik.ly/examples/qikly/embed.html , http://qik.ly/examples/qikly/expand.html
Comments (0)
You don't have permission to comment on this page.