Fail to download event attachments - microsoft-graph-api

I have an event with attachment which is about 50 MB.
Below requests are fine:
GET /users/{id}/events/{id}
GET /users/{id}/events/{id}/attachments/{id}?$select=name,size
{
"#odata.context": "https://graph.microsoft.com/v1.0/$metadata#users('u_id')/events('e_id')/attachments(name,size)",
"value": [
{
"#odata.type": "#microsoft.graph.fileAttachment",
"id": "a_id",
"name": "xxxx",
"size": 51564506
}
]
}
But when I want to get the content of this attachment:
GET /users/{id}/events/{id}/attachments/{id}
it returns
{
"error": {
"code": "ErrorMessageSizeExceeded",
"message": "The message exceeds the maximum supported size., The message exceeds the maximum supported size.",
"innerError": {
"request-id": "426c3bf3-eda8-40c8-afe6-9b83877a328c",
"date": "2018-10-24T02:31:48"
}
}
}
How could I deal with this?
Is it possible to increase the size limit of this API?
Thank you!

According to your describe, I suggest you should to limit your attachment size.
Also, Microsoft Graph currently has a 4MB limit. If you want to download large attachment, you need to write custom download logic which will like the breakpoint Continuingly and it doesn’t more than 30MB.
P.S. In general, the attachment size of main stream's mailbox are between 20MB and 30MB.
reference:
4MB total size of each REST request

Related

Getting MaxRequestDurationExceeded error when try to read the table range

When trying to get the range of the table using Graph API /items/{workbookId}/workbook/tables/{tableName}/range?$select=address, we are getting an error immediately with the following details
{
"error": {
"code": "MaxRequestDurationExceeded",
"message": "We're sorry. We couldn't finish what you asked us to do because it was taking too long.",
"innerError": {
"code": "gatewayTimeoutUncategorized",
"message": "The service wasn't able to complete the request within the time limit.",
"innerError": {
"code": "MaxRequestDurationExceeded",
"message": "We're sorry. We couldn't finish what you asked us to do because it was taking too long."
},
"date": "2023-01-06T14:45:21",
"request-id": "4b6b5b18-e879-451a-b480-107a29240f19",
"client-request-id": "4b6b5b18-e879-451a-b480-107a29240f19"
}
}
}
We have verified that data in the Excel is within the limits provided in this link
We have product that writes data to Excel on schedule. As part of that solution, we read the range of the table and clear it before writing. When we make a request to get range, it should return the proper range instead of error

Outlook contacts ErrorQuotaExceeded

I am making a script that generates contacts in Outlook with graph api v1.0 when my contact folder excedes 193 contacts I get this error message "ErrorQuotaExceeded". I think it is because there is a limite to how many contacts you can have in a folder, but I can't find any documentation that explains that limit if there is one.
I've tried to put contacts manualy through the outlook interface and it worked, but not through the graph interface.
I've tried putting a one minute delay after receiving this error message befor generating an other contact, but it still didn't work.
{
"id": "263",
"status": 403,
"headers": {
"Cache-Control": "private"
},
"body": {
"error": {
"code": "ErrorQuotaExceeded",
"message": "Cannot get ID from name.",
"innerError": {
"request-id": "a0b04607-53cb-45f1-92a3-22a5244c77cb",
"date": "2019-07-05T14:15:57"
}
}
}
}
I figured I was using "open extensions" which in return used "MAPI named property" and I exceeded de quota for the "MAPI named property"
Source

Youtube API: Get videos from autogenerated channels (like Music)

Is there any way to get the videos from autogenerated channels (like this one https://www.youtube.com/channel/UC-9-kyTW8ZkZNDHQJ6FgpwQ/videos) directly, without having to access all the playlists?
Using https://www.googleapis.com/youtube/v3/search?part=snippet&channelId=UC-9-kyTW8ZkZNDHQJ6FgpwQ&key=... gives me 0 items.
Gives me 0 Items
If you mean running the following exactly
https://www.googleapis.com/youtube/v3/search?part=snippet&channelId=UC-9-kyTW8ZkZNDHQJ6FgpwQ&key=
Returns the following error
{
"error": {
"errors": [
{
"domain": "usageLimits",
"reason": "keyInvalid",
"message": "Bad Request"
}
],
"code": 400,
"message": "Bad Request"
}
}
That is because you have neglected to add an API key on the end.
Try testing in the query explorer this seams to return quite a few no idea if its all of them.
GET https://www.googleapis.com/youtube/v3/search?part=snippet&channelId=UC-9-kyTW8ZkZNDHQJ6FgpwQ&maxResults=25&key={YOUR_API_KEY}
returns
"pageInfo": {
"totalResults": 786,
"resultsPerPage": 25
},
This apears to return a list of the playlists only for this user.
Update:
If you try and only request videos for this user you get 0 returned. This is not the case for any other user which i have tested.
GET https://www.googleapis.com/youtube/v3/search?part=snippet&channelId=UC-9-kyTW8ZkZNDHQJ6FgpwQ&maxResults=50&order=date&type=video&key={YOUR_API_KEY}
This leads me to believe that it is not possible to retrieve the videos for an autogenerated channel. I recommend either logging this as a bug or adding it as a feature request here. Personally i think its more a feature request.

Unable to filter messages by recipient in Microsoft Graph Api. One or more invalid nodes

I am trying to get a list of messages that are filtered by recipient from Microsoft Graph API. The url I am using for the request is:
https://graph.microsoft.com/beta/me/messages?$filter=toRecipients/any(r: r/emailAddress/address eq '[Email Address]')
But I am getting this is the response:
{
"error": {
"code": "ErrorInvalidUrlQueryFilter",
"message": "The query filter contains one or more invalid nodes.",
"innerError": {
"request-id": "7db712c3-e337-49d9-aa8d-4a5d350d8480",
"date": "2016-09-28T16:58:34"
}
}
}
A successful request should look like this (with a lot more data that I have omitted).
{
"#odata.context": "https://graph.microsoft.com/beta/$metadata#users('99999999-9999-9999-9999-999999999999')/messages",
"#odata.nextLink": "https://graph.microsoft.com/beta/me/messages?$skip=10",
"value": [
{
"toRecipients": [
{
"emailAddress": {
"name": "[Name]",
"address": "[Email Address]"
}
}
],
}
]
}
The request works if I remove the filter, and I am able to perform requests with simpler filters.
Is there a problem with my URL, or is there another way to make the request?
Another way to make the request might be to not use filter and use search instead, depending on exactly what you want (and you may have already tried this):
https://graph.microsoft.com/beta/me/messages?$search="to:[Email Address]"
After several hours looking for the solution, I found in the office365 documentation that the property toRecipients is not filterable:
https://msdn.microsoft.com/en-us/office/office365/api/complex-types-for-mail-contacts-calendar#MessageResource
I guess that it's the same in the graph api. So the only solution is using search.

Searching for HD videos using the YouTube API v3?

I am getting invalid combination of search filter error while retrieving the HD videos. this was the url - https://www.googleapis.com/youtube/v3/search?part=snippet&q=drama&videoDefinition=high&key={Developerkey}
Error report
{
"error": {
"errors": [
{
"domain": "youtube.search",
"reason": "invalidSearchFilter",
"message": "Invalid combination of search filters and/or restrictions.",
"locationType": "parameter",
"location": ""
}
],
"code": 400,
"message": "Invalid combination of search filters and/or restrictions."
}
}
Is it possible to retrieve HD videos? Please guide me. How can I get a response from this URL? Thanks
You also need to include the type=video query parameter, since filtering on high definition only makes sense when the results are limited to videos.
That being said, the error message that's returned isn't actually helpful, and I'll ask the engineering team to revise it so that it clarifies what's wrong.

Resources