I am trying to update (PATCH) an existing Microsoft Planner task, to add one (1) checklist item to it. I am using Microsoft doc https://learn.microsoft.com/en-us/graph/api/plannertaskdetails-update?view=graph-rest-1.0&tabs=javascript as a reference, and I am using Postman to send the request.
{
"error": {
"code": "",
"message": "The If-Match header contains an invalid value.",
"innerError": {
"request-id": "7b50a25b-7c5a-443b-9a41-1b6314be4014",
"date": "2019-05-16T23:59:03"
}
}
}
As far as I can see, the If-Match key is built up exactly the same as how Microsoft's article used it.
I have found a somewhat similar article (https://powerusers.microsoft.com/t5/Connecting-To-Data/Custom-Connector-Graph-The-If-Match-header-must-be-specified-for/td-p/144092), but this person is filling in the If-Match value differently, and it doesn't work for me at all...
I reused the eTAG value from the response received after creating the task in the first place:
"#odata.etag": "W/\"JzEtVGFzayAgQEBAQEBAQEBAQEBAQEBARCc=\""
Does anyone have a clue what I am doing wrong here?
This is my PATCH:
https://graph.microsoft.com/v1.0/planner/tasks/n...................pYAM-DX/details
These are my headers:
Content-Type: application/json
Authorization: Bearer eyJ0eXAiOiJKV1QiLCJub..........
If-Match: W/"JzEtVGFzayAgQEBAQEBAQEBAQEBAQEBARCc="
This is my body:
{
"previewType": "checklist",
"checklist": {
"{{$guid}}":{
"#odata.type": "microsoft.graph.plannerChecklistItem",
"title": "Update task details",
"isChecked": false
}
}
}
I was expecting the If-Match key to be correct, as I have used the Microsoft article, but somehow it results in the error message:
"The If-Match header contains an invalid value."
I had similar problem. I used etag from task when updates Task details.
The Task and Task Details are different objects.
Check on - MS Graph doc
Get etag value from Task details of created task using:
GET https://graph.microsoft.com/v1.0/planner/tasks/{task-id}/details
Related
I am working on integrating GMB into some of our internal apps, and would like to set up to receive real-time notifications for reviews and questions.
I have created a topic, and a subscription with a valid URL.
The next step is to tell GMB to send the notifications to the topic, and I believe the endpoint is the one below. However, it is very vague about the parameters it wants.
This is the documentation
https://developers.google.com/my-business/reference/rest/v4/accounts/updateNotifications
It wants a "Notification Settings Resource Name" in the URL, but it's not explained anywhere what that actually is. I have tried every possible value, but always get a 404 error response with the message "Requested entity was not found."
Has anyone successfully set this up? What values does the "getNotifications" endpoint want, and where in the various dashboards can this be found or created?
Any help is much appreciated!
As mentioned in the comments, you need to send the accountId as part of the URL.
To find this, you will first need to send a GET request to
https://mybusiness.googleapis.com/v4/accounts
This will return something along the following lines:
{
"accounts": [
{
"name": "accounts/102647145453118950380",
"accountName": "Tom Spencer",
"type": "PERSONAL",
"state": {
"status": "UNVERIFIED",
"vettedStatus": "NOT_VETTED"
},
"profilePhotoUrl": "//lh3.googleusercontent.com/a-/AOh14GgPkuJj03DeCa1isBAJALY4eOl09WGYVFrM4mG5=s132"
},
]
}
You can see here that accounts/102647145453118950380 is returned in the name field. Take this field, and construct the following URL:
https://mybusiness.googleapis.com/v4/accounts/102647145453118950380/notifications
Send a PUT request to this URL, with a request body resembling the following:
{
"topicName": "projects/{projectId}/topics/{topicId}",
"notificationTypes": [
"NEW_REVIEW",
"UPDATED_REVIEW"
]
}
Assuming you have pub/sub setup as per the documentation, this should send a message to your topic/subscribers whenever a new review is created or a review is updated.
I am trying to update a value for data in D365FO with Patch method as below.
https://<URL>/data/DXCGeneralJournalAccountEntries(GeneralJournalAccountEntryRecId = 5637144584)
Body: {
"DXCAdeptiaProcessed": "2019-01-01T00:00:00Z"
}
error code that i am getting is
{
"Message": "No HTTP resource was found that matches the request URI
'/data/DXCGeneralJournalAccountEntries(GeneralJournalAccountEntryRecId = 5637144584)'. No route data was found for this request." }
Can you suggest why this error may be coming.
have you tried with putting ' around the identifier that you are using?
(GeneralJournalAccountEntryRecId = '5637144584')
It looks like the entity that you're trying to update is a custom entity and it may not have been exposed in the REST OData API.
If you submit a GET request to /Metadata/Entities you should be able to find the entity in the results. Here you can check the properties for that entity, it should look something like this:
{
"Name": "DXCGeneralJournalAccountEntries",
"PublicEntityName": "DXCGeneralJournalAccountEntries",
"PublicCollectionName": "DXCGeneralJournalAccountEntries",
"LabelId": "#SYS999999",
"DataServiceEnabled": true,
"DataManagementEnabled": true,
"EntityCategory": "Master",
"IsReadOnly": false
},
Otherwise the documentation might be able to help with exposing the entity: https://learn.microsoft.com/en-us/dynamics365/fin-ops-core/dev-itpro/data-entities/odata#exposing-odata-entities
I'm using the graph search method of the Microsoft Academic API to retrieve paper information using the following query:
POST https://westus.api.cognitive.microsoft.com/academic/v1.0/graph/search?mode=json
Content-Type: application/json
Host: westus.api.cognitive.microsoft.com
Ocp-Apim-Subscription-Key: my-api-key
{
"path": "/paper",
"paper": {
"select": [
"PublishYear",
"CitationCount",
"ConferenceSeriesID",
"JournalID",
"AuthorIDs",
"AffiliationIDs",
"AuthorSequenceNumbers",
"OriginalAffiliations",
"NormalizedAffiliations",
"Keywords",
"FieldOfStudyIDs",
"ReferenceIDs",
"CitationIDs",
"OriginalTitle",
"NormalizedTitle",
"DOI",
"OriginalVenue",
"NormalizedVenue"
],
"type": "Paper",
"id": [2059999322, 1993355715, ...]
}
}
For this query, I'm getting one of three responses: 200 OK, 500 internal error, or 503 unavailable (same query and same list of IDs). I just tried to run this query (with the two IDs I listed in the example) five times, out of that, I got 3 correct responses, and 2 errors. Is there something in my request that's causing this or is this an error in the service?
My second question is, is there a limit on how many IDs can I submit in one query? I tried to look for this information on the documentation page, but couldn't find anything (just a rate limit in terms of how many queries can be sent per time, but nothing related to query size).
EDIT:
Response I'm getting with error 500 (using the query above):
{
'Error':
{
'Message': 'Something went wrong, if the error continue please contact us',
'Code': 'InternalError'
}
}
Response that comes with error 503 is empty for me.
I think I found what the problem is. In case anyone ever has the same issue, it seems it's certain IDs that return an error. I narrowed my set of ~150k IDs to 20 which always fail. The trouble is if an erroneous ID gets mixed in a large batch of IDs which are fine, the whole request fails.
I am learning Rest web services using Postman extension of Chrome. I'm practicing it using Facebook API. I have a question about posting in FB.
URI used: https://graph.facebook.com/me/feed?
In the Body of the POST Method, I have given the following Json content
{
"message": "hello",
"access_token": "<a valid token>"
}
I am very sure that my access token is correct as when I append the access token and message with the above URI, the status gets posted successfully. Also when I use it as key-value pairs in 'x-wwww-form-urlencoded' section, it works fine.
But when I try to update the status using the Body of the POST method with the JSON content mentioned above, it tells
{ "error": { "message": "An active access token must be used to query information about the current user.", "type": "OAuthException", "code": 2500 } }
Is there any thing wrong in the format of the JSON content
I missed content-type=application/json
in the Header section.
Adding this solved the problem
Goal:
I want to specify privacy for posts, that are done through my application, when I post to a Page's wall, using Pagetoken.
Problem:
Using page token, I do post to URL "https://graph.facebook.com/me/feed"
with the following body —
{
"message": "from app with security after requesting a username",
"privacy": {
"description": "Amsterdam, Netherlands, Netherlands",
"value": "CUSTOM"
}
}
An receive such a terrible answer —
{
"error": {
"message": "(#100) Posts where the actor is a page cannot also include privacy.",
"type": "OAuthException"
}
}
Even through it is said in documentation, here - https://developers.facebook.com/docs/reference/api/page/#posts,
that Pages#post.privacy is supported.
And explicitly:
"The description field may contain a comma-separated lists of valid country, city and language if a Page's post targeting by location/language is specified."
Please help me out, what am I doing wrong?
I posted the bug in Facebook Developers Bug reporter tool
https://developers.facebook.com/bugs/238365492903384
Subscribe/Comment to push this for a reply
This looks like a documentation bug. I have attached a screenshot of the old version of the docs. Try using "targeting" with the same location format as:
https://developers.facebook.com/docs/adsapi/targeting_specs/
I've also requested a fix for the docs.