The translation was generated automatically and may contain mistakes
VK Donate API
API VKontakte It allows you to get information about paid subscriptions and subscribers in communities that use VK Donat and also publish paid content in them.
For whom is this section
This section is for application developers who want to use the VKontakte API.. It will be easier if you are already familiar with API VKontakte The methods authorization and you know what it is VK Donat .
If you are already using VK Donat They figured out how to get access key to API VKontakte go to section Methods . If not, read the section first.. Preparation .
Preparation
- 1.
Connect VK Donat in the community settings.
- 2.
Create an app . The API can be used in any type of application. To get the API access key in the next step, you’ll need an application ID.
- 3.
Get it access key . The access key will need to be specified in all requests from the application (the “parameter
access_token). You can get it in many ways. It all depends on which rights of access you need and how you will send requests (on behalf of the user or community, on the client or server side).
Advice. Requests can be sent directly from documentation . You do not need to specify the application ID and access key, it is enough to enter your VKontakte account..
Methods
B. request You need to specify:
- •
- •
Parameters. Mandatory parameters:
access_token(Access key) andv(The API version). B. manual of Methods What version of the API does each method belong to, what other parameters does the method have, and what is needed rights of access . In the request, you need to specify the access key, the access rights of which correspond to the method.
Example
To find out if the user is a don (as we call the recipients of paid content in the community), send a request:
https://api.vk.ru/method/donut.isDon?owner_id=-1&access_token=42&v=5.131
In this example, replace -1 community identifier (with a minus sign), and 42 the user's access key.
Advice. Log into your VKontakte account and send a request directly from documentation .
Methods related to the work of VK Donat
Method | Result |
|---|---|
Whether the user is subscribed to paid content (whether it is a don). | |
Subscription cost, status, date of next payment. | |
User subscriptions. | |
A list of dons from among the user's friends. | |
List of community dons by user key (key must belong to at least the community editor) and by community key (see parameter filter ). | |
Publishes a recording on the wall for the Dons only. Allows you to set the time after which the record will appear for all subscribers, that is, it will become free (see the parameter donut_paid_duration ). | |
Changes the value of the parameter donut_paid_duration . |
Events
You can get information about events that are taking place in your community, through:
- •Callback API . We will send a notification of each new event to your server.
- •Bots Long Poll API . The queue of events is stored on the VKontakte servers, you get notifications whenever you want using requests.
Events related to the work of VK Donat
Name of event | What happened in the community |
|---|---|
The user signed up. | |
The user has extended the subscription. | |
The user's subscription has expired. | |
The user canceled the subscription. | |
The subscription price has changed. | |
The community leader withdrew the money. | |
Error in withdrawal of money. |
FAQ
Why do you need a VK Donat?
VK Donat allows community leaders to accept payments from subscribers.
Where else can I read about VK Donat?
B. community Community There are rules of Publication and a detailed FAQ, in which we told, for example, about payments .
Who are the Dons?
Dons are paid content recipients who subscribe to it using VK Donat.
What does the community ID look like?
A community identifier is an integer (ordinal number). For example, on the page of our official community is indicated ID: 192668858 . But when working with the API, the negative number -192668858 is used to distinguish the community ID from the user ID.
Why the Community Identifier: -1 ?
Users and communities are numbered in order, so the user and community can have the same ID. For example, there are user and community c ID: 1. If the method requires the user ID to be passed, the owner_id=1 (positive number), if the community identifier, then owner_id=-1 (Negative number).
Requests can be transmitted lang ?
Oh, yeah. Common API Parameters , can be used in all API VKontakte methods..
Can Free Content be Paid?
Not if it's already posted. You can if you have created it. postponed recording and it hasn't been published yet.
Is it possible to make paid content free?
Oh, yeah. Use the method wall.post in the request, specify the record identifier ( post_id ). Please note that in this case, a free copy of the paid entry will be created. But only one thing — to create more copies will not work.
I made a recording for the Dons, but then I decided to make it free early. Is it possible to change the time specified in donut_paid_duration?
Oh, yeah. To change the value donut_paid_duration (the time it takes for a paid entry to become free), you need to set a new value for this parameter using the method wall.edit . Note that when the time expires, a copy of the paid entry will appear.