The translation was generated automatically and may contain mistakes
Module: 4. Development
Lesson 19. Working effectively with the API VKontakte
The main thing in the lesson
- •
VKontakte limits the frequency of API requests from mini-applications to their servers. When limits are exceeded, an error is returned..
"Too many requests per second". - •
One way to reduce the number of calls is to learn the parameters of API requests and, if possible, use a single request to change a group of values.
- •
The restrictions imposed depend on the type of access key used on the call. So another possible way is to send some of the API requests from the client side of the mini-application. These requests use a different kind of access key compared to the server side.
- •
The third way to reduce the number of calls is to use stored procedures . These are functions in the VKScript language that are stored and executed on VKontakte servers. You create stored procedures in setting up a mini-application . Each procedure can execute up to 25 requests, and is triggered by just one request.
- •
To complete the procedure, call the event
VKWebAppCallAPIMethodVK Bridge libraries in the client side of the mini-application or send the following request from the server side:POST https://api.vk.ru/method/execute.ИМЯ-ПРОЦЕДУРЫ - •
The results of the requests that are called in the stored procedure are not transmitted over the network, which saves traffic and increases the overall speed of the mini application.
- •
Requests within a single procedure can work sequentially or in parallel. Parallel execution greatly speeds up the execution of the procedure.
Useful links
- •
- •
- •
- •
- •
:::