Answer the question
In order to leave comments, you need to log in
How to access stored procedures through the VK API?
Good day. I wrote an application for sorting subscribers. For the same purpose, I created a small stored procedure on the side of VKontakte:
// VKScript
return API.users.search({
"sex":Args.sex,
"age_from":Args.minAge,
"age_to":Args.maxAge,
"group_id":Args.groupId,
"count":Args.count,
"offset": Args.offset
})[email protected];
var_dump(json_decode(file_get_contents("https://api.vk.com/method/execute.SearchUsersBy?sex={$sex}&minAge={$minAge}&maxAge={$maxAge}&count={$count}&groupId={$groupId}&v=5.130&access_token=МОЙ_СЕРВИСНЫЙ_КЛЮЧ_ДОСТУПА")));
https://api.vk.com/method/execute.SearchUsersBy?sex=2&minAge=15&maxAge=16&count=&groupId=&v=5.130&access_token=МОЙ_СЕРВИСНЫЙ_КЛЮЧ_ДОСТУПА
error JSON returned:{"error":{"error_code":28,"error_msg":"Application authorization failed: method is unavailable with service token.","request_params":[{"key":"sex","value":"2"},{"key":"minAge","value":"15"},{"key":"maxAge","value":"16"},{"key":"count","value":""},{"key":"groupId","value":""},{"key":"v","value":"5.130"},{"key":"method","value":"execute.SearchUsersBy"},{"key":"oauth","value":"1"}]}}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question