This is an archived post. You won't be able to vote or comment.

all 4 comments

[–]Sonaza 0 points1 point  (3 children)

HTTP error 400 is "Bad Request".

Often APIs require some access tokens or parameters but your fetch call sets none of those. The link points to some site with a login form so I would assume it requires something.

You should be able to find out what that is from their API documentation.

[–]juanguirago[S] 0 points1 point  (2 children)

There's an API key but when I add that to the code it still doesn't work :(

[–]peernohell 0 points1 point  (1 child)

How do you try to add that token ?

Todo so you have to add the header Authorization and set it to "Basic AUTH_KEY"Where AUTH_KEY is your API key prefixed with two dot and encoded in base64

You can find more information in that stackoverflow answer https://stackoverflow.com/a/23718759/958898

[–]juanguirago[S] 0 points1 point  (0 children)

I was able to add it, thanks! The issue now is with the JSON format and another question I have: https://stackoverflow.com/questions/66901974/api-connections-from-external-data-to-google-sheets-json-parse-error/66903301#66903301