I am trying to access VK Api with scope of stats. manually i am able to generate access token, but that is going to expire in 24 hours. So i wanted to generate access token programatically. i tried in 2 ways mentioned as below.
first way:
import requests
response=requests.get('https://oauth.vk.com/authorize?client_id=myclientid&scope=stats&redirect_uri= myredirecturi& display=page&v=5.53&response_type=token ')
print r.url (my expectation is it should give that redirect url with access token, but that is returning url which i am passing as argument.)
second method:
import vk
session=vk.AuthSession(app_id='myappid', user_login='myusername', user_password='mypassword')
api = vk.API(session)
returning Vkauth error 'redirect_uri' mismatch. Can anyone suggest how to solve this and how to get access token automatically.