Authentication
Every request carries your API key as a bearer token.
Base URL
All endpoints live under https://naara.app/api/v1. The API is disabled by default; if every request returns 404, ask the operator to switch it on.
Send your key
Put the key in the Authorization header on every request. Keys look like 7|Xy8s... and are issued from your Developer area or by the operator.
- The full key is shown once, when you create it. Store it somewhere safe; afterwards only its last four characters are shown.
- A key belongs to an API client. Suspending the client, or your account, disables the key immediately.
- Never put a key in browser code or a mobile app. Call the API from your server.
Scopes
Each key is granted a subset of scopes. A call needs the scope shown on its endpoint, or it returns 403.
| Scope | Grants |
|---|---|
catalogue | Browse available plans |
quote | Get live prices |
order | Place orders (spends your balance) |
status | Read your order status |
Missing or invalid key
A missing or invalid key returns 401. A valid key without the needed scope returns 403.
curl https://naara.app/api/v1/catalogue \
-H "Authorization: Bearer $NAARA_KEY"
<?php
require 'vendor/autoload.php';
$client = new GuzzleHttp\Client(['base_uri' => 'https://naara.app/api/v1/']);
$response = $client->get('catalogue', [
'headers' => ['Authorization' => 'Bearer ' . getenv('NAARA_KEY')],
]);
echo $response->getBody();
const res = await fetch("https://naara.app/api/v1/catalogue", {
headers: {
Authorization: `Bearer ${process.env.NAARA_KEY}`,
},
});
console.log(await res.json());
import os
import requests
res = requests.get(
"https://naara.app/api/v1/catalogue",
headers={"Authorization": f"Bearer {os.environ['NAARA_KEY']}"},
)
print(res.json())
{
"message": "Unauthenticated."
}