Reputation: 53
I try to use the Time Zone REST API, and no matter what arguments I use and what coordinate I check, it does not return the expected data, and in all cases I get the result below:
Response:
{
"authenticationResultCode":"ValidCredentials",
"brandLogoUri":"http:\/\/dev.virtualearth.net\/Branding\/logo_powered_by.png",
"copyright":"Copyright © 2021 Microsoft and its suppliers. All rights reserved. This API cannot be accessed and the content and any results may not be used, reproduced or transmitted in any manner without express written permission from Microsoft Corporation.",
"resourceSets":[
{
"estimatedTotal":1,
"resources":[
{
"__type":"RESTTimeZone:http:\/\/schemas.microsoft.com\/search\/local\/ws\/rest\/v1",
"timeZoneAtLocation":[
]
}
]
}
],
"statusCode":200,
"statusDescription":"OK",
"traceId":"55590586fc5b4183865c58af24845970|DU00000D6E|0.0.0.1|Ref A: 3D98A80E080A45289BEC315D7EE37BDA Ref B: DB3EDGE1522 Ref C: 2021-04-23T14:04:29Z"
}
This is not a Transaction Usage limit issue, I just recently signed up for the service. I tried using other REST API services (such as Elevations API) and it did work.
Please enlighten my eyes and explain to me what is wrong.
Upvotes: 0
Views: 362
Reputation: 36
It looks like your requesting url is wrong, just remove "point=" from your query would work. https://dev.virtualearth.net/REST/v1/TimeZone/40.7844503,-73.528732?datetime=2021-04-23T00:00:00Z&includeDstRules=true&key=API_KEY
{
"authenticationResultCode": "ValidCredentials",
"brandLogoUri": "http://dev.virtualearth.net/Branding/logo_powered_by.png",
"copyright": "Copyright © 2021 Microsoft and its suppliers. All rights reserved. This API cannot be accessed and the content and any results may not be used, reproduced or transmitted in any manner without express written permission from Microsoft Corporation.",
"resourceSets": [
{
"estimatedTotal": 1,
"resources": [
{
"__type": "RESTTimeZone:http://schemas.microsoft.com/search/local/ws/rest/v1",
"timeZone": {
"genericName": "Eastern Standard Time",
"abbreviation": "EST",
"ianaTimeZoneId": "America/New_York",
"windowsTimeZoneId": "Eastern Standard Time",
"utcOffset": "-5:00",
"convertedTime": {
"localTime": "2021-04-22T20:00:00",
"utcOffsetWithDst": "-4:00",
"timeZoneDisplayName": "Eastern Daylight Time",
"timeZoneDisplayAbbr": "EDT"
},
"dstRule": {
"dstStartMonth": "Mar",
"dstStartDateRule": "Sun>=8",
"dstStartTime": "2:00",
"dstAdjust1": "1:00",
"dstEndMonth": "Nov",
"dstEndDateRule": "Sun>=1",
"dstEndTime": "2:00",
"dstAdjust2": "0"
}
}
}
]
}
],
"statusCode": 200,
"statusDescription": "OK",
"traceId": "2fd8f869974046f182ac948253e83de9|HK00000C07|0.0.0.1"
}
You can find more details and examples in https://learn.microsoft.com/en-us/bingmaps/rest-services/timezone/find-time-zone
Upvotes: 2