Bring your best ideas to the AI Use Case Contest! Enter to win 40 hours of expert engineering support and bring your vision to life using the powerful combination of Alteryx + AI. Learn more now, or go straight to the submission form.
Start Free Trial

Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.
SOLVED

An error occurred when connecting to the API using POST with the download tool (403error)

HIDEAKI-SHIIHARA
6 - Meteoroid

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"

5 REPLIES 5
gawa
16 - Nebula
16 - Nebula

@HIDEAKI-SHIIHARA 

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.

 

HIDEAKI-SHIIHARA
6 - Meteoroid

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).

apathetichell
20 - Arcturus

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.
AkimasaKajitani
17 - Castor
17 - Castor

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.

HIDEAKI-SHIIHARA
6 - Meteoroid

Thanks to your advice I was able to solve it!

Thank you to everyone else.

Labels
Top Solution Authors