Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
import requests
import json
import base64
from oauthlib.oauth2 import BackendApplicationClient
from requests_oauthlib import OAuth2Session
from requests.auth import HTTPBasicAuth
with open('Postman.ionapi') as json_file:
data = json.load(json_file)
base_url = ''
url = base_url + "/as/token.oauth2"
data = {
'grant_type' : 'password',
'username' : data['saak'],
'password' : data['sask'],
'client_id' : data['ci'],
'client_secret' : data['cs'],
'scope' : '',
'redirect_uri' : 'https://localhost/'
r =, data=data)
respone = r.json()
url = ''
headers = {'Authorization': 'Bearer ' +respone["access_token"]}
r =, headers=headers)
response2 = r.json()
print (response2)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.