As per the documentation, If you have more than one call to make within a certain period of time, we recommend that you create a session and pass the session ID with each request. To represent the session in the API, use the workbook-session-id: {session-id}
header. By doing so, you can use the Excel APIs in the most efficient way.
As a best practice, Please follow the below steps:
- Create a session.
POST https://graph.microsoft.com/v1.0/me/drive/items/{id}/workbook/createSession
Content-type: application/json
{
"persistChanges": true
}
2. Perform all the action (Populate it with data)
3. Close the session after all the requests are completed.
POST https://graph.microsoft.com/v1.0/me/drive/items/{id}/workbook/closeSession
Content-type: application/json
workbook-session-id:
{session-id}
{}
4. Now, the downloaded file will have the latest data.
Hope this helps.
If the answer is helpful, please click Accept Answer and kindly upvote. If you have any further questions about this answer, please click Comment.