L
L
Le-han2020-09-28 22:48:42
Python
Le-han, 2020-09-28 22:48:42

Error: User must grant an access to permission 'VALUABLE_ACCESS?

I was given the rights (wrote by mail to classmates)
When I do, I run the code. I get the error

odnoklassniki.api.OdnoklassnikiError: Error(code: '10', description: 'PERMISSION_DENIED : User must grant an access to permission 'VALUABLE_ACCESS'', ​​method: 'users.getInfo', params: '{'uids': 51518587535530 , 'fields': 'name'}')

import odnoklassniki
import requests

client_key = "---"
client_secret = "--"
access_token = "---"
user_id = 51518587535530
ok = odnoklassniki.Odnoklassniki(client_key, client_secret, access_token)
print(ok.users.getInfo(uids=user_id, fields='name'))

Answer the question

In order to leave comments, you need to log in

2 answer(s)
V
Valery Mamontov, 2020-09-29
@vmamontov

Le-han , firstly, there is no user with this id in classmates.
Try to execute your code by adding any id with an existing user.
For example, with this - 456544469248

K
kalapanga, 2020-09-29
@kalapanga

On the method description page in the test form, does the request work or not?
If it does not work, then double-check the entered data and if everything is correct, then contact the technical support of classmates. Let them see if all the requested rights are really granted.
If it works, then the Python library is not working. Contact its author or repair it yourself if you know how.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question