Help

Upcoming database upgrades. Airtable functionality will be reduced for ~15 minutes at 06:00 UTC on Feb. 4 / 10:00 pm PT on Feb. 3. Learn more here

Basic authentication for vidaxl api

Topic Labels: API Scripting
215 2
cancel
Showing results for 
Search instead for 
Did you mean: 

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.

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