Help

Re: Basic authentication for vidaxl api

1166 0
cancel
Showing results for 
Search instead for 
Did you mean: 
seidumohammed64
5 - Automation Enthusiast
5 - Automation Enthusiast

Hello, anyone availeble to help with basic authentication for vidaxl api. I am trying to get products data but really struggling with the authentication

 

// define the request url

let authUser = "some_email";
let authPass = "some_pass";
let authKey = authUser + authPass

let options = {
"method": "GET",
"headers": {
"Content-Type" : "application/json",
"Authorization" : "Basic " + authKey
}
}

let items = await remoteFetchAsync(base_url, options)
// let { data } = await items.json()
console.log(items)
2 Replies 2

Authentication issues are some of the hardest issues to troubleshoot. Each API provider can customize how it does authentication. Plus, the error messages tend to have very limited information since you are not able to authenticate as an approved user.

Your best bet is to look at the documentation for the API provider and/or contact their support.

On the other hand, if they indeed use basic authentication, you can try changing this line


let authKey = authUser + authPass

to 
let authKey = authUser + ":" + authPass

When writing code, even small character differences can matter.

seidumohammed64
5 - Automation Enthusiast
5 - Automation Enthusiast

Thanks @kuovonne I figured it out. I had the username and password so I used postman to get the data and then I used the code generator feature postman to generate the script for the authentication. Now I have been able to used it to generate the data in airtable