How to download a file attachment with golang sdk #443
arnaudlemaignen
started this conversation in
General
Replies: 1 comment 2 replies
-
This is a limitation of how the API is designed today.
This would roughly translate to this on the Go SDK attachmentValue, err := client.UsersById(emailUser).MessagesById(msgId).Attachments().GraphFileAttachmentById(attId).Value().Get(context.Background(), nil) But because this isn't modeled properly, it's not working as expected. rawUrl := "https://graph.microsoft.com/v1.0/users/userId/messages/messageId/attachments/attachmentId/$value"
builder := users.NewItemPhotoValueContentRequestBuilder(rawUrl, requestAdapter)
attachmentValue, err := builder.Get(context.Background(), nil) |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi
I dont find anywhere examples on how downloading a mail attachment using msgraph-sdk-go v0.56.0
I have access to the attachment as followed
attachment,err := client.UsersById(emailUser).MessagesById(msgId).AttachmentsById(attId).Get(context.Background(), nil)
but then I dont see any methods to extract the content of the attachment.
how can this be achieved?
many thanks in advance
Beta Was this translation helpful? Give feedback.
All reactions