Skip to content

How to avoid multiple calls #483

Answered by baywet
maxklav asked this question in Q&A
Discussion options

You must be logged in to vote

Thanks for reaching out and sorry about the late answer.
This is a limitation of the API today. You will have to iterate over mail folders and messages to get attachments, and as far as I'm aware, there are no bulk export APIs for this specific scenario.
You can optimize the scenario by:

  1. filtering out messages without attachments
  2. only selecting fields you care about
    Not only this will reduce the quota being used on the service side, but it'll also reduce the payload in transit.

Here is an example on how to do that.

graphClient := msgraphsdk.NewGraphServiceClientWithCredentials(cred, scopes)

requestFilter := "hasAttachments eq true"

requestParameters := &graphconfig.ItemMessagesRequest…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by maxklav
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants