Group messaging
Group messaging is a service for instant messages between OK group and it’s members developed on a base of Graph API.
Group messages are currently available for all our users on mobile and desktop version of OK. It is planned to add this feature in our native Android and iOS applications in nearest future.
Group moderators can communicate with group members on a desktop version of OK or by using Bot API.
Acquiring an access token
Specific access token must be acquired in order to use Bot API.
Access token is a special string that is used when invoking API methods on group’s behalf. It should be passed in a access_token parameter when working with API.
Group administrator can get this token on settings page of a group.
Follow this step to get your access token:
1. Open a «Settings» page of a group
2. Open a «Messages» section
3. Press a key «Generate access key» on the bottom of the page
4. Confirm your choice
5. Get a token and use it while working with API
Available methods
Bot API is based on Graph API
With Bot API you can do the following things:
- get information about all chats via method GET graph.user.chats;
- get information about a specific chat via method GET graph.user.chat;
- get direct link to a chat via method GET graph.chat.url;
- upload a file to a chat via method GET graph.user.fileUploadUrl;
- get specific chat’s messages via method GET graph.chat.messages;
- send new messages to group chats via method POST graph.chat.messages;
- subscribe to all new chat events via method POST graph.user.subscribe;
- unsubscribe from all new chat events via method POST graph.user.unsubscribe;
- view a list of current new events subscriptions via method GET graph.user.subscriptions.