I am getting an HTTP 503 status MSFT Graph API error when attempting to get a Sharepoint site that was successfully created by a Post with the Graph API.
I am using a Developer O365 subscription.
A Python application using the MSFT MSAL library for managing the authentication token is being used. I am able to successfully call other parts of the Graph API with the python app. When using the Graph Explorer logged into my account and with Site permissions I get a correct successful response. The python application worked for an hour or two after about 10-40 requests, but now is frozen in error with serviceNotAvailable.
The AD Application Permissions for the python client are:
- Directory.ReadWrite.All
- Group.Create
- Group.ReadWrite.All
- Sites.FullControl.All
- Sites.Manage.All
- Sites.Read.All
- Sites.ReadWrite.All
- User.Read
The endpoint I am calling GET with is: https://graph.microsoft.com/v1.0/sites/mydomain,some-uuid
The response headers I get are:
{
'Cache-Control': 'private',
'Content-Type': 'application/json',
'request-id': 'ff8256de-f833-4916-85c2-2ee229a68135',
'client-request-id': 'ff8256de-f833-4916-85c2-2ee229a68135',
'x-ms-ags-diagnostic': '{
"ServerInfo":{
"DataCenter":"North Central US",
"Slice":"SliceC",
"Ring":"3",
"ScaleUnit":"002",
"RoleInstance":"AGSFE_IN_3"}}',
'Strict-Transport-Security': 'max-age=31536000',
'Date': 'Wed, 04 Mar 2020 17:47:03 GMT',
'Content-Length': '306'
}
The response body is:
{
"error": {
"code": "serviceNotAvailable",
"message": "The service is not available. Try the request again after a delay. There may be a Retry-After header.",
"innerError": {
"request-id": "ff8256de-f833-4916-85c2-2ee229a68135",
"date": "2020-03-04T17:47:03"
}
}
}
I read in the MSFT docs that this is a throttling error for violating terms of use and that Graph Explorer is not subjected to throttling restrictions. I never get the "Retry-After" header.
Does anyone know how to get my API call to be successful? How to reset the throttling by MSFT? I might make 100 - 150 Graph API calls in an hour.