General information
Disclaimer. Graph API is currently available only for groups. Read more about Graph API in groups here
Graph API is just another look on a our traditional HTTP-based API.
Essential differences between our Graph API and REST API are:
- no signature required;
- method’s logic and execution result could could be different for POST and GET requests;
- session token is not required. Access_token is used instead.
Graph API request is a combination of such components as:
- API server address ({api_server}). Current address: https://api.ok.ru/graph;
- nodes - basically an object on which an action is taken. I.e. /me - user;
- edges - optional parameter which stands as a link or a connection between nodes. I.e., user or group messages - /messages;
- fields - a list of object parameters used in a query. I.e., timestamp=0 - time when message was created;
- access_token - a token needed to access Graph API methods.
Graph API request URL considering all this looks like:
{api_server}/[node]/[edge]?access_token=[access_token]&field1=[value1]&field2=[value2]
In example:
https://api.ok.ru/graph/me/messages/chat:C3ecb9d02a600?access_token=tkn1souiIRv:CBAQMCGGABABABABA&to=0
Bot API
As a part of Graph API we’ve created a set of methods that we call Bot API which can be used to automate interaction between your group representative and your group members - read more.