Determine timezone based on location using Here APIs - here-api

I want to get get the timezone of a location (lat/long) using the here REST APIs. I know there is a Google timezone API to do this, but I couldn't see any timezone information in any "Reverse Geocoding" API responses for the here REST APIs.

For reverse geocoding you need to add additional parameter locationattributes=tz to the request. Example request:
https://reverse.geocoder.cit.api.here.com/6.2/reversegeocode.json
?prox=50.112,8.683,100
&mode=retrieveAddresses
&app_id=xxx
&app_code=yyy
&gen=9
&locationattributes=tz
You can find a full description of available input parameters by link: https://developer.here.com/rest-apis/documentation/geocoder/topics/resource-reverse-geocode.html

Related

Is there an endpoint to batch get urn:li:digitalmediaAsset in the LinkedIn API?

We are doing a rest/posts?author={MY_ORG} request against the LinkedIn Api (version 202211). Some of the posts returned contain content referenced with urn:li:digitalmediaAsset for which we need the download URL.
When I encounter urn:li:image or urn:li:video I can do a BATCH get to fetch additional details about the assets. I'd like to do the same thing for urn:li:digitalmediaAsset. I haven't seen an endpoint for that - does it exist?
I understand, that I can use a projection here but, I'd like to align with the code that I have for images and videos if the endpoint exists. In other words, I am looking for an alternative to using projections.

Authenticating for findsequence service requests HERE Maps API

I'm attempting to make a GET request from the HERE Maps API service FindSequence. I noticed that in the docs, it includes three authentication parameters: app_id, app_code, apiKey. The docs insinuate that there is an option to use an app_id and app_code combination or an apiKey alone. This makes sense because elsewhere in the HERE Maps docs, it's noted that the old pattern was to use app_id and app_code but that has been recently deprecated and now one is supposed to use apiKey alone. In fact, you can not even generate an app_code anymore in the HERE developer projects dashboard.
So I attempted to make a request with the apiKey but I got an authentication error that demanded the app_id and app_code:
`curl --location --request GET "https://wse.api.here.com/2/findsequence.json?apiKey=[apiKey]`
{"faultCode":"s74149e0f-5b37-41b1-bf25-0d5f93e06938","responseCode":"400","message":"The request is missing the app_id and app_code parameters. They must both be passed as query parameters. If you do not have app_id and app_code, please obtain them through your customer representative or at http://developer.here.com/myapps."}
It's my understanding that freemium accounts do not have customer reps. I've asked for technical help and they send me to Stack Overflow. I followed the url http://developer.here.com/myapps but it redirects to https://developer.here.com/projects. There is no way to obtain the app_code from this url, as far as I can see.
My question is:
1) Do I need to supply an app_code? If not, how do I make a request without one? If I do need an app_code, how do I obtain one?
2) If app_codes can no longer be obtained, is there another service or another version of this service I should be using to calculate the optimal route sequence with given waypoint locations?
With the API key, you need to make sure to query the newer endpoints, in *.hereapi.com.
So the following request should work better:
curl --location --request GET "https://wse.ls.hereapi.com/2/findsequence.json?apiKey=[apiKey]&param1=value1&...

Injecting an api key to google script's UrlFetchApp for an HTTP Request

The Problem
Hi. I'm trying to use Google Script's "UrlFetchApp" function to pull data from an email marketing tool (Klaviyo). Klaviyo's documentation, linked here, provides an API endpoint via an HTTP request.
I'm trying to use Google Script's "UrlFetchApp" to pull data from Klaviyo's API. Unfortunately, Klaviyo requires a key parameter in order to access data, but Google doesn't document if (or where) I can add a custom parameter (note, it should look something like: "api_key=xxxxxxxxxxxxxxxx". Note, it's quite easy for me to pull data into my terminal using the api_key parameter, but ideally I'd have it pulled via google scripts and added to a google sheet appropriately. If I can get JSON into google scripts, I can work with the data to output it how i want.
KLAVIYO'S EXAMPLE REQUEST FOR TERMINAL
curl https://a.klaviyo.com/api/v1/metrics -G \
-d api_key=XX_XXXXXXXXXXXXXXX
THIS OUTPUTS CORRECT DATA IN JSON
Note: My ultimate end goal is to pipe the data into Google data studio on a recurring basis for reporting. I thought i'd get the data into a csv for download / upload into google data studio on a recurring basis. If I'm thinking about this the wrong way, let me know.
Regarding the -G flag, from the curl man pages (emphasis mine):
When used, this option will make all data specified with -d, --data,
--data-binary or --data-urlencode to be used in an HTTP GET request instead of the POST request that otherwise would be used. The data
will be appended to the URL with a '?' separator.
Given that the default HTTP method for UrlFetchApp.fetch() is "GET", your request will be very simple:
UrlFetchApp.fetch("https://a.klaviyo.com/api/v1/metrics?api_key=XX_XXXXXXXXXXXXXXX");

Retrieve roadnames separated by each state HEREapi

Is it possible to use calculateroute in HERE api to retrieve roadnames/roadnumbers parsed by each state the route travels through?
Routing API request gives the maneuverattributes(roadname, roadnumber) from origin to destination.
Please refer following link for detailed explanation as per your use case
developer.here.com/documentation/routing/topics/resource-calculate-route.html

Clockify API in PBI

Does anyone know how to call the Clockify API in Power Bi?
I just cant seem to get it right. I have read through the Clockify API documentation and the I cant transpose the code in Power Bi.
let
Source = Json.Document(Web.Contents("https://api.clockify.me/api/",
[Headers=[Accept="application/json", #"x-api-key"="xxxxxxxxxx"]])),
messages = Source[messages]
in
Source
So I don't know PBI but one issue I think I see with your call is the "Headers" should include a "Content-Type" - "application/json" header. You don't need the "Accept" header. And you might have shortened it, but your endpoint URL needs an actual endpoint - https://api.clockify.me/api/ won't return anything. Instead you should test trying to get the workspace information, for example, which I think would look something like this:
let
Source = Json.Document(Web.Contents("https://api.clockify.me/api/workspaces/",
[Headers=[#"x-api-key"="xxxxxxxxxx"]])),
messages = Source[messages]
in
Source
This one doesn't need the content-type header because it's just a GET request. I don't know how PBI creates different types of requests, but certain requests need to be GET requests, while others need to be POST/PUT/DELETE/etc.
did you get around this? there is no support on official website of clockify as for now, but it seems that it could be done by the clockify API but same as your code it does not run.

Resources