New API column

I have an API I would like to call data from however it requires the API key be located in a header, and not in the URL. Is that possible with the new API column in Glide?

If you are talking about the fetch API column then I think if you can’t pass the key as a parameter in the URL then it’s a no go.

You may have to write a Javascript snippet to fetch it.

Yes the fetch column is what I’m referring to. I’ll look up how to write JavaScript snippet. Any good resources you might know of out there on how to write the snippet?

You can try at the link

Code Snippet can be found below:

fetch('https://api.github.com/users/manishmshiva', {
  method: "GET",
  headers: {"Content-type": "application/json;charset=UTF-8"}
})
.then(response => response.json()) 
.then(json => console.log(json)); 
.catch(err => console.log(err));

Then you parse the response from json and return the value you need
2 Likes

You can try reading the good recommendation from Shantanu above, but carefully read your API to see how the credentials should be passed alongside the fetch request.

Next, and this might make it not work, is the CORS (Cross-Origin Resource Sharing) problem, but you can try first to know if a simple fetch would work.

2 Likes