I
I
igorbvik2017-01-08 20:25:41
Python
igorbvik, 2017-01-08 20:25:41

Why does the VK API users.getSubscriptions method not work with multiple arguments?

Good day.
There was a problem while writing the algorithm. Using the users.getSubscriptions method, I want to get a list of the user's subscriptions. If there are no arguments when calling the method, the terminal returns a list of subscriptions of the account from which the login was made. When executing a program with more arguments than 0, the terminal throws the following error:
Traceback (most recent call last):
File "pyvkapi", line 23, in
tar_subs = api.users.getSubscriptions(tar_id)
TypeError: __call__() takes exactly 1 argument (2 given)

Code itself:

import vk

""" VK INIT INFO """
app_id = '12345678'
my_id = '1234567'
my_email = 'email'
my_password = 'password'

""" STARTING VK INIT """
print("START")
session = vk.AuthSession(app_id, my_email, my_password)
api = vk.API(session)

""" LOOKING FOR SUBSCRIPTIONS """
tar_id = '123456'
tar_subs = api.users.getSubscriptions(tar_id)
print(tar_subs)

print("END")

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
igorbvik, 2017-01-08
@igorbvik

Sayonji @Sayonji
api.users.getSubscriptions(user_id=tar_id) not working?
Posted 35 minutes ago
Reply
igorbvik @igorbvik
Sayonji: problem solved, thanks!
Just posted
Reply

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question