Authenticating on the API
Authenticate Apara API requests by creating a Basic Authentication header from your API credentials.
Step 1: Get API Credentials (From Apara Portal)
-
Sign in to the Apara Portal.
-
Copy your USERNAME.
-
Copy your PASSWORD.
These credentials are required for every authenticated API request.
Step 2: Authenticate a request
-
Combine your credentials in the format USERNAME:PASSWORD.
Example:
aparaUser:aparaPass -
Encode the combined string in Base64.
Using:
const axios = require("axios"); const username = "aparaUser"; const password = "aparaPass"; const encoded = Buffer.from${username}:${password}).toString("base64"); axios.get("https://sandbox-api.aparatech.io/v3/config/supported-currencies", { headers: { Authorization: Basic ${encoded}, "Content-Type": "application/json" } }) .then(res => console.log(res.data)) .catch(err => console.error(err.response?.data));import requests import base64 username = "aparaUser" password = "aparaPass" credentials = f"{username}:{password}" encoded = base64.b64encode(credentials.encode()).decode() url = "https://sandbox-api.aparatech.io/v3/config/supported-currencies" headers = { "Authorization": f"Basic {encoded}", "Content-Type": "application/json" } response = requests.get(url, headers=headers) print(response.json())Expected output: YXBhcmFVc2VyOmFwYXJhUGFzcw==
-
Add the encoded value to the Authorization header with the Basic prefix.
Authorization: Basic YXBhcmFVc2VyOmFwYXJhUGFzcw== -
Send your API request with the Authorization header.
Example:
curl -X GET "https://sandbox-api.aparatech.io/v3/config/supported-currencies" \ -H "Authorization: Basic YXBhcmFVc2VyOmFwYXJhUGFzcw==" \ -H "Content-Type: application/json"
The response depends on the endpoint you call, but every authenticated request must include the same Basic Authentication header format.
Was this page helpful?
Last updated today
Built with Documentation.AI