Using basic authentication
Instead of sending account details as body parameters, you can use basic authentication to generate a bearer token instead.
Generate a bearer token using basic authentication
Header
Name
Value
Request
curl --location 'https://enterprise.personr.co/api/1.1/wf/api-basic-auth' \
-H "Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ="const axios = require('axios');
const base64 = require('base-64');
const email = '[email protected]';
const password = 'example123';
const credentials = base64.encode(`${email}:${password}`);
const config = {
headers: {
'Authorization': `Basic ${credentials}`
}
};
axios.get('https://enterprise.personr.co/api/1.1/wf/api-basic-auth', config)
.then(response => {
console.log('Response:', response.data);
})
.catch(error => {
console.error('Error:', error);
});{
"status": "success",
"response": {
"token": "bus|4242424242424x424242424242424242|4343434343434x434343434343434343",
"user_id": "4242424242424x424242424242424242",
"expires": 31536000
}
}{
"statusCode": 400,
"reason": "INVALID_LOGIN_CREDENTIALS",
"message": "We didn’t find an account with those login credentials",
}Last updated
Was this helpful?