Authenticate your API calls by including your secret key in the Authorization header of every request you make. You can manage your API keys from the dashboard .
Secure your secret key
Do not commit your secret keys to git, or use them in client-side code.
Authorization headers should be in the following format: Authorization: YOUR SECRET_KEY
All API requests must be made over HTTPS. Calls made over plain HTTP will fail. API requests without authentication will also fail.
Authentication Steps
Install HTTP Client
You need to install axios if you are using Node.js and requests if you are using Python.
$ npm install axios
$ pip install requests
Import required libraries
Before you get started, you need to import the required libraries for languages specified below.
const axios = require(‘axios’)
import requests
import json
Set configuration variables
You would also need to set all the configuration variables needed to make a HTTP request. Replace Authorization: YOUR SECRET_KEY
with the secret key that you get from the B54 dashboard .
const headers = {
‘Content-Type’: ‘application/json’,
‘Authorization’: ‘ <YOUR SECRET KEY>’
}
var config = {
method: 'METHOD',// Enter request type here: GET, POST,PUT, DELETE
url: 'http://api.b54.co/api/customer_partners/....',
headers: {
'Content-Type': 'application/json',
'Authorization': '{{YOUR SECRET KEY}}'
}
};
url = "https://api.b54.co/api/customer_partners/..."
headers = {
'Content-Type': 'application/json',
'Authorization': 'Bearer {{YOUR SECRET KEY}}'
}