Timeout error 504 - Graph API

%3CLINGO-SUB%20id%3D%22lingo-sub-1219376%22%20slang%3D%22en-US%22%3ETimeout%20error%20504%20-%20Graph%20API%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1219376%22%20slang%3D%22en-US%22%3E%3CP%3EI'm%20using%20MS%20Graph%20API%20to%20retrieve%2Fcreate%2Fedit%20data%20from%20sharepoint%20list.%20Sometime%20it%20returns%20504%20-%20Timeout%20error%20and%20it's%20unpredictable.%20Here%20is%20an%20example%20request%20i%20use%20(Javascript%20is%20the%20language%20i%20use)%3A%3C%2FP%3E%3CDIV%3E%3CSPAN%3Eaxios%3C%2FSPAN%3E%3CSPAN%3E.%3C%2FSPAN%3E%3CSPAN%3Epost%3C%2FSPAN%3E%3CSPAN%3E(%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3E%60%3CA%20href%3D%22https%3A%2F%2Fgraph.microsoft.com%2Fv1.0%2Fsites%2F%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fgraph.microsoft.com%2Fv1.0%2Fsites%2F%3C%2FA%3E%3C%2FSPAN%3E%3CSPAN%3E%24%7B%3C%2FSPAN%3E%3CSPAN%3EsiteId%3C%2FSPAN%3E%3CSPAN%3E%7D%3C%2FSPAN%3E%3CSPAN%3E%2Flists%2F%3C%2FSPAN%3E%3CSPAN%3E%24%7B%3C%2FSPAN%3E%3CSPAN%3ElistId%3C%2FSPAN%3E%3CSPAN%3E%7D%3C%2FSPAN%3E%3CSPAN%3E%2Fitems%60%3C%2FSPAN%3E%3CSPAN%3E%2C%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3E%7B%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3Efields%3C%2FSPAN%3E%3CSPAN%3E%3A%3C%2FSPAN%3E%3CSPAN%3E%20%7B%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3ETitle%3A%20'Hello'%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%3E%7D%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3E%7D%2C%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3E%7B%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%3Eheaders%3C%2FSPAN%3E%3CSPAN%3E%3A%3C%2FSPAN%3E%3CSPAN%3E%20%7B%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3EAuthorization%3A%20Bearer%20token%2C%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3E'content-type'%3C%2FSPAN%3E%3CSPAN%3E%3A%3C%2FSPAN%3E%20%3CSPAN%3E'application%2Fjson'%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3E%7D%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3E%7D%3C%2FSPAN%3E%3C%2FDIV%3E%3CP%3E%26nbsp%3BDid%20i%20miss%20somehting%20when%20sending%20request%3F%20Or%20how%20i%20can%20avoid%20this%20error%20as%20much%20as%20possible%3F%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-1219376%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EDeveloper%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EMicrosoft%20Teams%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E
Frequent Visitor

I'm using MS Graph API to retrieve/create/edit data from sharepoint list. Sometime it returns 504 - Timeout error and it's unpredictable. Here is an example request i use (Javascript is the language i use):

axios.post(
`https://graph.microsoft.com/v1.0/sites/${siteId}/lists/${listId}/items`,
{
fields: {
Title: 'Hello' }
},
headers: {
Authorization: Bearer token,
'content-type': 'application/json'
}
}

 Did i miss somehting when sending request? Or how i can avoid this error as much as possible?

0 Replies