Developer Centre
Platform LoginStatus
  • Getting started
    • Integration types
    • Generating an authentication token
    • Using basic authentication
  • Applicants
    • Creating an applicant
    • Generating a verification link
    • Uploading documents to an applicant
      • Supported Documents and Types
    • Requesting to start the verification process
  • Applicant Results
    • Retrieving applicant verification results
      • Understanding applicant rejection labels
      • Setting up a webhook
    • Downloading verified documents
  • Entities
    • Check types and coverage
    • Creating an entity
    • Generating a verification link
    • Uploading documents to an entity
      • Supported Documents and Types
    • Linking a UBO to an entity
    • Requesting to start the verification process
  • Entity Results
    • Retrieving entity verification results
      • Understanding entity rejection labels
      • Setting up a webhook
    • Retrieving entity ownership structures
    • Retrieving entity questionnaire answers
  • Anti-Money Laundering
    • Retrieving AML results
  • Database Verification
    • Applicants
      • Verifying applicant identity data
    • Entities
      • Verifying entity information
  • Pages
    • Overview
    • Creating a Page
    • Verifying with Pages
  • Domain Names
    • Overview
    • Linking your domain
  • Flow Logic
    • Overview
  • Workspaces
    • Switching Workspaces
  • Modules
Powered by GitBook
On this page

Was this helpful?

  1. Getting started

Using basic authentication

Instead of sending account details as body parameters, you can use basic authentication to generate a bearer token instead.

Before calling other endpoints, you need to generate an Authorization Bearer token. To retrieve your token using basic auth, simply send your account credentials in base64 encoded format within the header.

The format should be Basic email:password where email:password are encoded.


Generate a bearer token using basic authentication

POST /api-basic-auth

Generate a token for use with other endpoints.

Header

Name
Value

Content-Type

multipart/form-data

Authorization

Basic (base64 string)

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 = 'example@personr.co';
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);
    });
const email = 'example@personr.co';
const password = 'example123';

const credentials = btoa(`${email}:${password}`);

const headers = new Headers();
headers.append('Authorization', `Basic ${credentials}`);
headers.append('Content-Type', 'application/json');

fetch('https://enterprise.personr.co/api/1.1/wf/api-basic-auth', {
    method: 'POST',
    headers: headers
})
.then(response => response.json())
.then(data => {
    console.log('Response:', data);
})
.catch(error => {
    console.error('Error:', error);
});
require "uri"
require "net/http"
require "base64"

email = "example@personr.co"
password = "example123"

credentials = Base64.strict_encode64("#{email}:#{password}")

url = URI("https://enterprise.personr.co/api/1.1/wf/api-basic-auth")

https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Authorization"] = "Basic #{credentials}"

response = https.request(request)
puts response.read_body
import requests
import base64

email = 'example@personr.co'
password = 'example123'

credentials = base64.b64encode(f'{email}:{password}'.encode()).decode()

url = "https://enterprise.personr.co/api/1.1/wf/api-basic-auth"

headers = {
    'Authorization': f'Basic {credentials}'
}

response = requests.post(url, headers=headers)

print(response.text)

Response

{
  "status": "success",
  "response": {
    "token": "1670035114445x631333625381113500",
    "user_id": "1665086295388x405886519539808060",
    "expires": 31536000
  }
}
{
    "statusCode": 400,
    "reason": "INVALID_LOGIN_CREDENTIALS",
    "message": "We didn’t find an account with those login credentials",
    }

In the response, you'll receive:

  • Your bearer token

  • Your unique user id

  • The expiration time of your token, expressed in seconds

Remember to include your token in the header of every subsequent API call, in the format Authorization: Bearer YOUR_TOKEN

Don't forget to set up a workflow to renew your token before it expires.

PreviousGenerating an authentication tokenNextCreating an applicant

Last updated 10 months ago

Was this helpful?