Some of my customers are getting HTTP 429 errors from batch request.
I'm sending 20 request in a batch request:
{
"requests": [
{ "id": "1", "url": "/users/xxxxxx-xxx-xxx-xxx-xxx/drive", "method": "GET" },
{ "id": "2", "url": "/users//xxxxxx-xxx-xxx-xxx-xxy/drive", "method": "GET" }
//...
]
}
Microsoft Graph returns an HTTP 429 for some of the requests. For the normal HTTP requests (one by one), it returns the correct result.
Maybe the batch request has different logic for throttling limit?
Related
Is there any way to pass response object values from first request to second request as input parameters in graph batch request (2nd request is dependant on 1st request - graph/json-batching)
In the following request, the client is specifying that requests 1 should be run first, then request 2.
2nd Request need the id from the 1st Request's response as URL variable. What is the way to achieve it?
JSON
{
"requests": [
{
"id": "1",
"method": "GET",
"url": "/users/<upn>?$select=id"
},
{
"id": "2",
"dependsOn": [ "1" ],
"method": "GET",
"URL": "users/<id from the 1st request>/presence"
}
]
}
Yes, As #Tiny-wa said this is not possible as of now. There is already a feature request raised in the Microsoft Graph Feedback Forum, please upvote it so that the product team may implement it in future.
So, for now you need to make two separate requests, make first request and get response details and use it and make a second request.
I'm trying to share SharePoint directory so specific user invite the invite API endpoint from Microsoft Graph : https://learn.microsoft.com/en-us/graph/api/driveitem-invite
Every time I do the request, I'm receiving a "400 - Bad request" response.
Here is my request:
https://graph.microsoft.com/v1.0/sites/***/drives/***/items/***/invite
Here is the payload:
{
"requireSignIn": true,
"sendInvitation": false,
"roles": [
"read"
],
"recipients": [
{
"email": "***#***.***"
}
]
}
It used to work perfectly.
We implemented oauth2 microsoft graph integration using node sdk. Mostly we use it for reading and sending emails. We already have some customers using our integration, but there's one customer that we are not able to get / send emails from his account. we get a 404 for everything we try to do using his access/refresh token.
this is one example:
POST https://graph.microsoft.com/v1.0/users/me/sendMail
Content-type: application/json
Content-length: 512
{
"message": {
"subject": "...",
"body": {
"contentType": "Text",
"content": "..."
},
"toRecipients": [
{
"emailAddress": {
"address": "...#....com"
}
}
],
}
}
And the response we are getting is:
{
"statusCode": 404,
"code": "ResourceNotFound",
"message": "Resource could not be discovered.",
"requestId": "b5f8efca-53ff-4cf1-978e-c4f745fcbbc1",
"date": "2018 - 01 - 20 T23: 13: 27.000 Z",
"body": {
"code": "ResourceNotFound",
"message": "Resource could not be discovered.",
"innerError": {
"request-id": "b5f8efca-53ff-4cf1-978e-c4f745fcbbc1",
"date": "2018-01-20T23:13:27"
}
}
}
Looking for some similar issues, we found Office365 API returns 404 on GetCalendars on some accounts
where they say that the customer's mailbox might not be hosted in Office 365.There's a way to check using the requestId if this is the problem with our request? Or there's a way to find out without needing to ask the customer to try to sign in using OWA?
The URL https://graph.microsoft.com/v1.0/users/me/sendMail isn't correct. It should be https://graph.microsoft.com/v1.0/me/sendMail.
I'm running into a problem with status of a playlist. What I want to do is to get a playlist status without OAuth. But, it is only retrieved when I use playlists.list with OAuth.
When I send a request about a private playlist with playlists.list using API_KEY, it responses with:
GET https://www.googleapis.com/youtube/v3/playlists?part=id%2Csnippet%2Cstatus&id={PRIVATE_PLAYLIST_ID}&key={API_KEY}
{
"kind": "youtube#playlistListResponse",
"etag": "\"q5k97EMVGxODeKcDgp8gnMu79wM/zJL80hJ0IwMo5wddECFapC8I6Q4\"",
"pageInfo": {
"totalResults": 0,
"resultsPerPage": 5
},
"items": [
]
}
This doesn't give any clues the playlist is private or other status to me. If I figure it out through YouTube API, how should I do?
Use playlistItems.list instead of playlist.list.
It'll give kind of the indirect information. Even though it doesn't make sure a playlist is exactly private, I think it is useful just in case.
GET https://www.googleapis.com/youtube/v3/playlistItems?part=status&playlistId={PRIVATE_PLAYLIST_ID}&key={API_KEY}
{
"error": {
"errors": [
{
"domain": "youtube.playlistItem",
"reason": "playlistItemsNotAccessible",
"message": "The request is not properly authorized to retrieve the specified playlist.",
"locationType": "parameter",
"location": "playlistId"
}
],
"code": 403,
"message": "The request is not properly authorized to retrieve the specified playlist."
}
}
I'm trying to insert a node with a label using the rest API's batch endpoint.
The URL I'm hitting is: http://localhost:7474/db/data/batch
The payload is
[{"body": {"ConceptId": "78890", "Name": "This is a node"}, "to": "/node", "method": "POST"}, {"body": "Moo", "to": "{0}/labels", "method": "POST"}]
The 500 response body is:
<html><head><title>Error</title></head><body><p><pre>Illegal character in path at index 2: ./{0}/labels</pre></p><p><pre>IllegalArgumentException
at java.net.URI.create(URI.java:859)
at java.net.URI.resolve(URI.java:1043)
at org.neo4j.server.rest.batch.BatchOperations.calculateTargetUri(BatchOperations.java:104)
at org.neo4j.server.rest.batch.BatchOperations.performRequest(BatchOperations.java:193)
at org.neo4j.server.rest.batch.BatchOperations.parseAndPerform(BatchOperations.java:171)
at org.neo4j.server.rest.batch.NonStreamingBatchOperations.performBatchJobs(NonStreamingBatchOperations.java:48)
at org.neo4j.server.rest.web.BatchOperationService.batchProcess(BatchOperationService.java:126)
at org.neo4j.server.rest.web.BatchOperationService.performBatchOperations(BatchOperationService.java:76)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.neo4j.server.rest.transactional.TransactionalRequestDispatcher.dispatch(TransactionalRequestDispatcher.java:139)
at java.lang.Thread.run(Thread.java:724)</pre></p></body></html>
So far as I can tell, the syntax is correct, according to sources such as the Neo4j documentation and this StackOverflow question.
Can anyone help? I'm using 2.1.2, if that's relevant.
David,
You are missing the job id for the first action. Try this:
[{"id":0, "body": {"ConceptId": "78890", "Name": "This is a node"}, "to": "/node", "method": "POST"}, {"body": "Moo", "to": "{0}/labels", "method": "POST"}]
Without the "id":0 on the first action, the {0} in the second action can't be dereferenced.
Grace and peace,
Jim