429 throttling even though I wait for each request to complete

%3CLINGO-SUB%20id%3D%22lingo-sub-2241842%22%20slang%3D%22en-US%22%3E429%20throttling%20even%20though%20I%20wait%20for%20each%20request%20to%20complete%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2241842%22%20slang%3D%22en-US%22%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20am%20using%20the%20Graph%20API%20in%20SPFx%20(MSGraphClient).%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20need%20to%20add%20events%20to%20a%20user%20calendar%20(usually%20between%2010%20and%2020%20for%20the%20month).%20Unfortunately%2C%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fgraph%2Fthrottling%23outlook-service-limits%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3Ethe%20throttling%20limit%20for%20events%20is%20only%204%3C%2FA%3E%20(!).%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ETo%20try%20and%20prevent%20concurrent%20events%2C%20I%20am%20executing%20the%20requests%20one%20at%20a%20time%2C%20with%20an%20await%20expression%3A%3C%2FP%3E%3CDIV%3E%3CDIV%3E%3CSPAN%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%3Efor%3C%2FSPAN%3E%3CSPAN%3E%26nbsp%3B(%3C%2FSPAN%3E%3CSPAN%3Elet%3C%2FSPAN%3E%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%3Ei%3C%2FSPAN%3E%3CSPAN%3E%26nbsp%3B%3D%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%3E0%3C%2FSPAN%3E%3CSPAN%3E%3B%26nbsp%3B%3C%2FSPAN%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nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B.%3C%2FSPAN%3E%3CSPAN%3Eapi%3C%2FSPAN%3E%3CSPAN%3E(%3C%2FSPAN%3E%3CSPAN%3E%22%2Fme%2Fevents%22%3C%2FSPAN%3E%3CSPAN%3E)%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B.%3C%2FSPAN%3E%3CSPAN%3Epost%3C%2FSPAN%3E%3CSPAN%3E(%7B%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%3E%22subject%22%3A...%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%26nbsp%3B%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3EThis%20doesn't%20work%2C%20I%20am%20still%20getting%20429%20throttling%20message%20even%20though%20the%20requests%20are%20not%20concurrent.%20What%20am%20I%20missing%20here%2C%20and%20what%20would%20be%20the%20proper%20way%20to%20handle%20the%20situation%3F%3C%2FSPAN%3E%3C%2FDIV%3E%3C%2FDIV%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-2241842%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EMicrosoft%20Graph%20Api%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3ESPFx%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2243557%22%20slang%3D%22en-US%22%3ERe%3A%20429%20throttling%20even%20though%20I%20wait%20for%20each%20request%20to%20complete%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2243557%22%20slang%3D%22en-US%22%3EI%20have%20created%20a%20SPFx%20package%20that%20re-creates%20the%20issue%3A%3CBR%20%2F%3E%3CA%20href%3D%22https%3A%2F%2Fgithub.com%2FPathToSharePoint%2FOutlook-Throttling%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3Ehttps%3A%2F%2Fgithub.com%2FPathToSharePoint%2FOutlook-Throttling%3C%2FA%3E%3CBR%20%2F%3E%3CBR%20%2F%3ENote%20that%20it%20requires%20Graph%20API%20permissions.%3C%2FLINGO-BODY%3E
Frequent Contributor

 

I am using the Graph API in SPFx (MSGraphClient).

 

I need to add events to a user calendar (usually between 10 and 20 for the month). Unfortunately, the throttling limit for events is only 4 (!).

 

To try and prevent concurrent events, I am executing the requests one at a time, with an await expression:

              for (let i = 0i < locks.lengthi++) {
                let lock = locks[i];
                await props.context.msGraphClientFactory.getClient()
                  .then((clientMSGraphClient:( void => {
                    client
                      .api("/me/events")
                      .post({
                        "subject":...
 
This doesn't work, I am still getting 429 throttling message even though the requests are not concurrent. What am I missing here, and what would be the proper way to handle the situation?
2 Replies

I have created a SPFx package that reproduces the issue:
https://github.com/PathToSharePoint/Outlook-Throttling

Note that it requires Graph API permissions.

Hi Christophe - The SPFx team actively monitors this Github repo for questions, so I suggest posting your inquiry there: https://github.com/SharePoint/sp-dev-docs