Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

4MB total size of each REST request #18

Closed
twcarnahan opened this issue Feb 22, 2017 · 7 comments
Closed

4MB total size of each REST request #18

twcarnahan opened this issue Feb 22, 2017 · 7 comments
Assignees

Comments

@twcarnahan
Copy link

https://graph.microsoft.io/en-us/docs/api-reference/v1.0/api/message_post_attachments
Since there is currently a limit of 4MB on the total size of each REST request, this limits the size of the attachment you can add to under 4MB.

@twcarnahan
Copy link
Author

twcarnahan commented Feb 22, 2017

I just found this tiny bit of information out --- this makes graph useless for sending attachments --- Is there a way to change this or work around this? Wonder if I could just somehow use outlook api instead of graph to send?
https://outlook.office.com/api/v2.0/

Much appreciated, Tim:

@DianeD DianeD self-assigned this Feb 22, 2017
@twcarnahan
Copy link
Author

Can you ask if going through the effort creating an Outlook REST endpoint, would that have any conflicts with using "Microsoft.Graph" library; I guess the library Microsoft.Office365.OutlookServices-V2.0.
Is this the preferred solution when you want to use the "Send" functionality?
From reading, they seem so similar this is why I ask if I could just switch the REST endpoint for graph because it uses the same Token?
Much appreciate your concern and help with this direction on microsoftgraph concepts, Tim:

@DianeD
Copy link

DianeD commented Feb 23, 2017

Hi Tim. As you noted, Microsoft Graph currently has a 4MB limit. If you need to send larger file attachments, you could use the Outlook REST API, which has a limit of 150MB. I'm not very familiar with Outlook development but this tutorial should help. If your scenario depends on sending larger attachments and you're only using Outlook services, this might be your best option for now.

If you want to use both the Outlook REST endpoint and the Microsoft Graph endpoint, they require different access tokens so you'd need to obtain them separately.

If you want to use Microsoft Graph only, one workaround is to upload the file to OneDrive and then provide a sharing link in the message. Here's an UploadLargeFile C#/UWP snippet that you can base your file-upload method on.

@twcarnahan
Copy link
Author

Thank you for the feedback - it is appreciated. Tim:
Also, this is a good example c#/UWP snippet - appreciate your direction - Tim:

@twcarnahan
Copy link
Author

twcarnahan commented Feb 25, 2017

I would like to inquire if you have a sample of this One Drive "sharing" link --- Many thanks, Tim:

@DianeD
Copy link

DianeD commented Feb 27, 2017

Here's the docs that describe sharing links and options for creating and using them.

This test snippet in the client library creates an edit sharing link using the item path.

Or you can use the item id that's returned when you upload the file. This snippet uses the item id to create a view sharing link and then just gets the link URL from the returned Permission:

Permission permission = await graphClient.Me.Drive.Items[id].CreateLink("view").Request().PostAsync();
string url = permission.Link.WebUrl;

@DianeD
Copy link

DianeD commented Mar 31, 2017

Hi @twcarnahan . Closing this issue. Please reopen if you are still having problems. Thanks!

@DianeD DianeD closed this as completed Mar 31, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants