Disclaimer: I am really really new with Python and MSGraph
I have the folllowing response variable:
response = requests.get(
#url="https://graph.microsoft.com/v1.0/users",
url = f"https://graph.microsoft.com/v1.0/users?$count=true&$search={email_address}&$orderBy=displayName&$select=id,displayName,mail",
headers=headers,
)
#print(json.dumps(response.json(), indent=4))
print(response.text)
And the output is
{
"@odata.context": "https://graph.microsoft.com/v1.0/$metadata#users(id,displayName,mail)",
"@odata.count": 1,
"value": [
{
"id": "#######",
"displayName": "Firstname Lastname",
"mail": "******@domain.com"
}
]
}
or if I do the .txt
{"@odata.context":"https://graph.microsoft.com/v1.0/$metadata#users(id,displayName,mail)","@odata.count":1,"value":[{"id":"########","displayName":"Firstname Lastname","mail":"******@domain.com"}]}
I wonder how to read the different values, like displayName or mail and store them into a variable.
Thanks for your help