Мы подготовили новую версию сайта, которую уже сейчас можно посмотреть по ссылке https://apiok.ru
Все ваши замечания и предложения по новой версии присылайте на api-support@ok.ru X
Skip to end of metadata
Go to start of metadata

General information

All API methods are available through GET and POST requests.
Every method is available under 2 urls :

Server Address is passed to the Web applications in "api_server" parameter.
method can't be passed as an attachment in photo upload methods, but must be passed as query parameter only.
While it is recommended to use "api_server" parameter, you can use the default address for non session requests : http://api.odnoklassniki.ru/.

See Application parameters for the full list of parameters passed to the application

Common request parameters

Name

Required

Type

Description

application_key

Yes

String

The application key associated with the calling application. If you specify the API key in your client, you don't need to pass it with every call.

call_id

No

Long

The request's sequence number.

sig

Yes

String

An MD5 hash of the current request and your secret key, as described in the Authentication and Authorization section .

format

No

String

Format of method response, can be JSON ot XML. If not specified, HTTP Accept header will be used to determine the format (application/xml or applcation/json).

session_key

-

String

The session key of the logged in user. Session key can be required, optional or prohibited depending on method.

Data protection

  • User, group, album and other ID's are returned as String (this can be changed by request). User IDs for different applications are not the same by default.

Response format

Response can be obtained in one of the two following formats: XML or JSON, as was mentioned above. If not specified, HTTP Accept header will be used to determine the format (application/xml or application/json)

There is a certain subtlety that one should keep in mind when calling methods that return lists of data. If the list returned by the method is empty then:

  • XML response format: the tag will not contain any elements within itself.
  • JSON response format: will return null.

If server can't handle query, you will receive message with error. See Error handling.

In some cases application must specify callback URL. See REST API - callbacks

Support

Application can specify the support URL to report issues directly from the portal help screen.
User will be redirected to this URL with the following parameters:

Name

Type

Description

application_key

String

The application key associated with the application.

uid

String

ID of user, reporting the problem

name

String

Full name of user, reporting the problem

first_name

String

First name of user, reporting the problem

last_name

String

Last name of user, reporting the problem

Labels
  • None