Skip to main content

The APi I am trying to connect to requires a header “authorization” “basic xxxxxxx” (where “xxxx” is a generated token).

 

When I select basic authentcation it requires a user and password, selecting API key allows me to add  the two fields that were used to generate the token needed in authorization header. Neither work.

 

How do I go about setting up an API connection that just uses an authorization header as indicated above?

Hi @antonvh - Are you building a custom app?


Yes I am,


@antonvh - Basic authentication requires that you calculate the base64 representation of `${username}:${password}` combination. This will be handled automatically for you if you set your authentication type to “basic”. You can leave the input fields empty.

Check out this example if you’re building a CLI app: https://github.com/zapier/zapier-platform-example-app-basic-auth/blob/master/authentication.js#L18


Thanks for the prompt response.

The API I am connecting to uses a “subdomain” field and “api key” to construct the base64 token and not user and password. I tried putting the domain string in the user field and the api token in the password field but it doesn’t work. There might be something else wrong so if the way I am doing it (user = domain and pw = api key) then I will have to dig deeper.

 


@antonvh - Ok, so in order to make sure this is the correct way to construct the Authorization header, have you tried to authenticate using the username = domain and password = API key in something like Postman? Do you mind to share a link to the API documentation?


Hi @antonvh!

Just wanted to check on this to see if the responses by @ikbelkirasan had helped you out, or whether you still needed some assistance here. Please let us know :)