Created
November 26, 2015 19:03
-
-
Save vl4dt/10fcbbb14779595f5c9c to your computer and use it in GitHub Desktop.
Azure AD Graph API call
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
Azure AD Graph API - INIT | |
request_id = str(uuid.uuid4()) | |
# url = 'https://graph.windows.net/{0}/{resource-path}?[query-parameters]' | |
url = 'https://graph.microsoft.com/me?v1.0' | |
tenant = 'lnodev.onmicrosoft.com' | |
headers = { | |
'User-Agent': 'python_tutorial/1.0', | |
'Accept': 'application/json', | |
'Authorization': 'Bearer %s' % token, | |
'Content-Type': 'application/json', | |
'client-request-id': request_id, | |
'return-client-request-id': 'true' | |
} | |
response = requests.post(url, headers=headers) | |
json_response = {"result": "An error occurred"} | |
json_response = response.json() | |
logging.info('GRAPH RESPONSE: %s' % response) | |
logging.info('GRAPH RESPONSE json: %s' % json_response) | |
Azure AD Graph API - END |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment