MICROSOFT GRAPH post ecel files and create link

FRUITSTOCK SARL 26 Reputation points
2022-02-18T15:51:30.737+00:00

I have a python script which loads 500 excel files (1,34Mo) on SharePoint. This script has always worked (1 year) until last week.

I suddenly received "Response 429" and Retry after 120s too many time.

Has workaround, I added more delay between each loading file (5s then10s) But 10s is to long for what I want and finally I reach a log out response [401] before and of process. I also adde retry after 120s but is too long for 500 files.

So now I need to find a way to avoid that Reponse 429 without wait to long time between each file The Sharepoint connection is done with delegated permission with user permission to take the token and after that I send post request file load on sharpoint folder.

The general process is a loop (250 iteration) : - posts 2 files on sharepoint - creates link to pickup shareable link I have the Microsoft 365 Business Standard licence.

Do you have any advise ? (related code bellow)

Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
12,002 questions
{count} votes

5 answers

Sort by: Most helpful
  1. Zehui Yao_MSFT 5,856 Reputation points
    2022-02-21T08:13:41.72+00:00

    Hello @FRUITSTOCK SARL , According to the documentation, backing off requests using the Retry-After delay is the fastest way to recover from throttling.

    176276-image.png


    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments

  2. FRUITSTOCK SARL 26 Reputation points
    2022-02-21T09:30:34.967+00:00

    Hello @Zehui Yao_MSFT ,

    This is what i did. But the delay is up to 120s (quiet long).

    So when I reach this 2 or 3 timesafter it's seems that I hit a session disconnection because I have a 502 reponse.

    I manage it as I can but my "real" question was why suddenly it happen ? I use it seens 1 year wihtout any 429 response.

    But thanks four your time.


  3. FRUITSTOCK SARL 26 Reputation points
    2022-02-24T21:24:25.097+00:00

    177628-capture-decran-2022-02-24-a-222247.png


  4. FRUITSTOCK SARL 26 Reputation points
    2022-02-24T21:25:39.537+00:00

    @ZehuiYaoMSFT177664-capture-decran-2022-02-24-a-221916.png


  5. FRUITSTOCK SARL 26 Reputation points
    2022-02-27T07:48:09.703+00:00

    File upload request

    178098-capture-decran-2022-02-27-a-084126.png

    Create Sharable link request

    178099-capture-decran-2022-02-27-a-084320.png


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.