Azure Maps Route Directions - Bad Request - azure

Can anyone possible tell me what is wrong with this coordinate: -21.186924,-41.224376
google maps says it's ok!
Azure API Returns Bad Request!
https://atlas.microsoft.com/route/directions/json?api-version=1&subscription-key=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX&query=-21.156265,-41.2771530:-21.186924,-41.224376&routeRepresentation=polyline&travelMode=car&&view=Auto&computeBestOrder=true
Message:
{
"error": {
"code": "400 BadRequest",
"message": "Bad request: one or more parameters were incorrectly specified or are mutually exclusive."
}
}

Your coordinates are in the Atlantic ocean. Note that Azure Maps aligns with the GIS standard of "longitude, latitude" which aligns with "x, y", while Google Maps uses "latitude, longitude"

Related

How do you update your profile picture using Microsoft Graph API?

I'm experimenting on Microsoft Graph API to update the profile picture.
Although there is a documentation about it (See Link Here: https://learn.microsoft.com/en-us/graph/api/profilephoto-update?view=graph-rest-1.0&tabs=javascript), I can't seem to understand it.
I tried sending a random data to see if something would work, however I can only get the GET Method to work but somehow trying to make the PUT Method work returns an error.
{
"error": {
"code": "ErrorInsufficientPermissionsInAccessToken",
"message": "Exception of type 'Microsoft.Fast.Profile.Core.Exception.ProfileAccessDeniedException' was thrown.",
"innerError": {
"date": "2022-04-15T07:10:11",
"request-id": "********-****-****-****-************",
"client-request-id": "********-****-****-****-************"
}
}
}
Basically the two concerns are:
How to use the PUT Method for updating the profile picture using Microsoft Graph API
Why am I receiving the error as if I'm not allowed to update?
Is it because I'm doing the PUT Method incorrectly?
Is it because I need some sort of subscription to use the API?

Azure Maps Route Directions Error Returns Bad Request

Can anyone possible tell me what is wrong with this lat,lng: 54.575972,-1.235028 google maps says it's ok! ref:
https://www.google.com/maps/place/54%C2%B034'33.5%22N+1%C2%B014'06.1%22W/#54.5759722,-1.2372165,17z/data=!3m1!4b1!4m5!3m4!1s0x0:0x0!8m2!3d54.575972!4d-1.235028
Azure API Returns Bad Request!
https://atlas.microsoft.com/route/directions/json?subscription-key=XXXXXXXXXXXXXXXXXXXXX&api-version=1.0&query=52.042250,-0.780480:54.575972,-1.235028
Message:
{
"error": {
"code": "400 BadRequest",
"message": "Bad request: one or more parameters were incorrectly specified or are mutually exclusive."
}
}
The team found the issue. The road segment that the coordinate was snapping to was classified as a walking road, and thus the routing service wasn't able to calculate the route. The road has been reclassified and should be updated in the platform within the next couple of weeks. Thanks for the feedback.

Graph Delta API for groups returning 400 "Resource not found for the segment 'contacts'."

I develop an integration with Azure Ad which supports incremental synchronisations of users and groups.
It worked fine for quite a long time, but recently some (not all) of my customers started encountering one specific error.
For a request like:
GET https://graph.microsoft.com/v1.0/groups/delta?$skiptoken=<TOKEN_FROM_PREVIOUS_SYNCRHONISATION>
The API returns a response with status code 400 and body:
"error": {
"code": "BadRequest",
"message": "Resource not found for the segment 'contacts'.",
"innerError": {
"request-id": "<SOME-REQUEST-ID>",
"date": "2019-02-27T20:01:16"
}
}
I want to point out that this error occurs for some specific customers and I was not able to reproduce it on my environment.
Could someone give me a hint or two what could be causing this error?
Make sure you are using skip tokens and delta tokens correctly.
You should only have a skip token when you get the next page of a delta response.
Later when you want to get changes, you have to use a delta token.
So $deltaToken instead of $skipToken.
Like the delta link here: https://learn.microsoft.com/en-us/graph/delta-query-events?view=graph-rest-1.0#sample-third-and-final-response
I have the exact same problem when I send a request to the following endpoint
GET https://graph.microsoft.com/v1.0/groups/delta?$select=id,displayName,description&$expand=members
However, it works if I remove the "$expand=members" parameter from the URI. Could that be what's causing it in your case too?
After couple of days, my customers stopped raising the issue, so I believe the problem was temporary and on Azure side.

Get document libraries for domain-my.sharepoint.com

I am trying to access the document libraries created by a user in their own domain-my.sharepoint.com, based on the documentation I inferred that the way to do it is
https://graph.microsoft.com/beta/sites/domain-my.sharepoint.com/drives
As drives map to document library(?)
I'm able to make this work with domain.sharepoint.com, but unable to make it work with domain-my.sharepoint.com
here is what it says:
{
"error": {
"code": "invalidRequest",
"message": "Provided id is not suitable for the current host",
"innerError": {
"request-id": "09c5722c-cfc3-4589-ba76-e57c44590d16",
"date": "2017-06-27T06:53:59"
}
}
}
Any help will be appreciated.
I believe what you're looking for is the OneDrive endpoint. You can access the current user's drive using https://graph.microsoft.com/v1.0/me/drive/
Another way to get what you want is via a request to:
https://domain-my.sharepoint.com/_api/v2.0/sites/domain-my.sharepoint.com/drives
Basically the /_api/v2.0/sites endpoints seems to support everything that is documented in the corresponding Graph API docs.

expand=fields($select=***,****) on the SharePoint Graph resource doesn't work and how about filtering?

I'm playing with the microsoft graph and especially the sharepoint beta api and i am constantly running into issues. I know its beta, but still;)
I'm getting out my expanded fields but i'm not able to select other than id.
/items?expand=fields(select=id) <-- works
/items?expand=fields(select=Title) <-- fails with response being
{
"error": {
"code": "invalidRequest",
"message": "The request is malformed or incorrect.",
"innerError": {
"request-id": "f460cded-46da-468c-a027-f027707a62fc",
"date": "2017-05-10T09:00:10"
}
}
}
Further on trying to filter the request with the request /items?expand=fields&$filter=fields/id eq '421' doesn't work and after a long period just returns a response without taken the filter into account.
Can someone respond if the experience the same or if my syntax is wrong or whatever would be nice. Thanks in advance. Ole Bergtun
i changed /items?expand=fields(select=Title) to /items?expand=fields(select%3DTitle) and it works for me.

Resources