Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
11,436 questions
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Hello
I've been testing this endpoints locally, and everything works fine on localhost.
I deployed my backend and when I try to call the endpoint I now get this error.
Invalid tenant ID provided. You can locate your tenant ID by following the instructions here: https://learn.microsoft.com/partner-center/find-ids-and-domain-names
What do I need to do different?
I get the user access token with Auth JS on the frontend.
url = "https://graph.microsoft.com/v1.0/me/mailFolders"
headers = {
"Authorization": f"Bearer {g.access_token}",
}
response = requests.get(url, headers=headers)
if response.status_code != 200:
return {
"success": False,
"error": f"Error getting labels: {response.content}"
}, 400
transformed_data = [transform_labels(folder) for folder in response.json()['value']]
return transformed_data