| 
  • If you are citizen of an European Union member nation, you may not use this service unless you are at least 16 years old.

View
 

Qik-ly APIs

Page history last edited by Bhaskar Roy 12 years, 2 months ago

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://qik.ly/Jya"]}

Response
["http://qik.com/video/15944"] 

Example 2
Request
POST /api/jsonrpc HTTP/1.0
Host: qik.ly
{"method": "qik.ly.expand", "params": ["http://qik.ly/Jyb"]}

Response
{"fault": "QikJSONRPCError", "faultCode": 2009, "faultString": "Passed URL is invalid: 'http://qik.ly/Jyb'"} 

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.

 

Example 1
Request
GET /api/expand?url=http://qik.ly/Jya HTTP/1.0
Host: qik.ly

Response
"http://qik.com/video/15944" 

 

 


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).

JSON-RPC
Request
POST /api/jsonrpc HTTP/1.0
Host: qik.ly
{"method": "qik.ly.expand", "params": ["http://qik.ly/Jya"]}

Response
["http://qik.com/video/15944"]

REST
Request
GET /api/expand?url=http://qik.ly/Jya HTTP/1.0
Host: qik.ly
Response
"http://qik.com/video/15944"

 

 

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

 
JSON-RPC
Request
POST /api/jsonrpc HTTP/1.0
Host: qik.ly
{"method": "qik.ly.shorten", "params": ["http://qik.com/video/15944"]}

Response
["http://qik.ly/Jya"] 

REST
Request
GET /api/shorten?url=http://qik.com/video/15944 HTTP/1.0
Host: qik.ly

Response

"http://qik.ly/Jya"

 

 

Thumbnail

Get thumbnail for qik video uploaded using qik.ly link.

 

Example: http://qik.ly/examples/qikly/expand.html

 
Simple HTTP

Append ".jpg" to qik.ly URL, e.g. http://qik.ly/Jya.jpg .

   

 

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:

  1. 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.

  2. 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.