Skip to content

Instantly share code, notes, and snippets.

Embed
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 = 'https://mingle-sso.eu1.inforcloudsuite.com:443/FELLOWCONSULTING_DEV'
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 = requests.post(url, data=data)
respone = r.json()
url = 'https://mingle-ionapi.eu1.inforcloudsuite.com/ionapi/metadata/v1/FELLOWCONSULTING_DEV/version'
headers = {'Authorization': 'Bearer ' +respone["access_token"]}
r = requests.post(url, 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.