Created
September 11, 2022 10:55
-
-
Save ritik1009/7d346a7af1a09f530d03fea804de842e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def get_long_lived_access_token(access_token = ''): | |
url = graph_url + 'access_token' | |
param = dict() | |
param['grant_type'] = 'ig_exchange_token' | |
param['client_secret'] = client_secret | |
param['access_token'] = access_token | |
response = requests.get(url=url,params=param) | |
response = response.json() | |
print("\n long_lived_token_response :-",response) | |
long_lived_access_token = response['access_token'] | |
expires_in = response['expires_in'] | |
return long_lived_access_token |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment