Try PBworks for yourself
View
 

Getting Started

Page history last edited by Andrey Smirnov 2 years, 10 months ago

 


 

What's an API?

The acronym "API" stands for "Application Programming Interface". An API is just a defined way for a program to accomplish a task, usually retrieving or modifying data. In Qik's case, we provide APs to embed Qik and develop applications, websites, widgets that interact with Qik. Programs talk to the Qik API over HTTP, the same protocol that your browser uses to visit and interact with web pages. 

 

Qik API Overview

Qik has 2 styles of APIs.

 

JSON-RPC

Entry point: /api/jsonrpc

JSON-RPC implementation follows specification in some areas, but it's better to supply an example of full HTTP communcation between client and Qik Engine:

 

Request

POST /api/jsonrpc

Host : engine.stage.qik.com

Content-Type:  application/json; charset=UTF-8

Content-Length: 46

{"method": "qik.session.create", "params": []}

 

 

Response:

Content-Type: text/json 


["a56c1603-1fbb-4140-8b35-8c36abbd8b27"]


This conversation over JSON-RPC means that client reqiests remote call of method qik.session.create, passing zero parameter ("params" is an empty array). Server returns string result "a56c1603-1fbb-4140-8b35-8c36abbd8b27" (result is at element zero of the returned array).

 

REST

Currently the REST-like APIs are available for the Qik.ly APIs. 

 

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:

 

Request:

GET /api/expand/?URL=http://qik.ly/Jya  HTTP/1.0

Host: qik.ly

 

Response:

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

 

Qik API keys

 

Most Qik API calls require developer keys. Those that are public are marked explicitly as open. API keys can be requested by sending an email to api@qik.com.

 

Every API call accepts key as parameter apikey: JSON-RPC API and REST HTTP GET methods accept apikey as GET parameter, for example entry point to JSON-RPC API should look like: http://engine.qik.com/api/jsonrpc?apikey=xxxxxxx, where xxxxxx is your API key. REST HTTP POST methods accept API key as GET or POST parameter.

 

Qik API examples

 

Qik API comes with examples built on top of this API. These examples source code is released under public domain, you may use this code whatever you like.

 

HTML/JavaScript examples

 

Examples are built on top of Prototype (http://prototypejs.org/) JavaScript library. If you run this examples in Firefox browser with Firebug extension enabled, you can see all API interaction in Firebug console window.

 

 

All these examples use Push APIs and Video APIs.

 

 

Comments (0)

You don't have permission to comment on this page.