T
T
Ternick2020-09-22 21:33:28
Classmates
Ternick, 2020-09-22 21:33:28

How to receive/send messages on behalf of a group?

Installed the ok_api library.
Created a group, created an application, added an application to the group.
The essence of the task is in the header, for a start I decided to run a simple example.

from ok_api import OkApi


def main():
    """
        Простой запрос на примере метода friends.get с
        необязательным параметром типа сортировки
        (https://apiok.ru/dev/methods/rest/friends/friends.get)
    """

    ok = OkApi(access_token='OK_ACCESS_TOKEN',
               application_key='OK_APP_PUBLIC_TOKEN',
               application_secret_key='OK_APP_PRIVATE_TOKEN')

    response = ok.friends.get(sort_type='PRESENT')
    print(response.json())


if __name__ == '__main__':
    main()

Got this in response:
{'error_code': 100, 'error_msg': 'PARAM : Parameter access_token specified but application is not EXTERNAL', 'error_data': None}

How can my issue be resolved? Maybe it's worth installing another library, or did I overlook it somewhere in the application settings?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question