I would like to use the download tool to connect to the API via POST and retrieve data, but the result is an error (HTTP/1.1 403 Forbidden). If I try the same settings with Excel VBA, it will succeed. Are there any issues specific to Alteryx?
<My Settings> *API key omitted.
url,apiKey,query,Content-Type,Accept
"https://www.mlit-data.jp/api/v1/","API-key","{""query"": ""{ municipalities { code name } }""}","application/json","application/json"
Solved! Go to Solution.
What if you convert 'query' parameter into blob, and send it as a blob data, instead of sending it as plain text? This is one of attempt I fail to connect API via Download tool as part of debug.
If possible, can you share detail error message, like 'Invalid API key', 'Invalid query' so we can drill down the issue you face.
Thank you for contacting us. I tried converting the query using Blob conversion, but the error persisted. I got the error HTTP/1.1 403 forbidden (same as the original error).
can you confirm that you have the set in your headers in your download tool?
Accept: application/json Accept-Language: ja,en-US;q=0.7,en;q=0.3 Accept-Encoding: gzip, deflate, br Content-Type: application/json
Also - I believe your payload should be url encoded or maybe like this?
'{"query": { "municipalities" { "code name" } }}'
I'd recommend checking it out in Postman to see how it looks there.
API is sometimes needed for the User-Agent. Designer doesn't add the User-Agent, so when the API needs User-Agent, you have to add it to Header section. It depends on the API.
Thanks to your advice I was able to solve it!
Thank you to everyone else.