Authentication

You can generate an API key here.

Intelliprint API uses account-level API keys to authenticate you to your account. There are no separate API keys for test mode. Instead, when you want to create a test Print Job, just set the testmode parameter to true.

Provide your API key in the Authorization header as HTTP Bearer auth.

Example

curl https://api.rnbdata.uk/v1/prints \
-u key_EXAMPLE:
#The colon prevents curl from asking for a password.

Code Examples in Other Languages

Here are code examples in various programming languages for authenticating with the API:

Python

import requests

api_key = "key_EXAMPLE"
headers = {
    "Authorization": f"Bearer {api_key}"
}

response = requests.post("https://api.rnbdata.uk/v1/prints", headers=headers)

print(response.json())

JavaScript

const axios = require("axios");

const api_key = "key_EXAMPLE";
const headers = {
    Authorization: `Bearer ${api_key}`
};

axios
    .post("https://api.rnbdata.uk/v1/prints", {}, { headers })
    .then((response) => {
        console.log(response.data);
    })
    .catch((error) => {
        console.error(error);
    });

PHP

$curl = curl_init();

$api_key = "key_EXAMPLE";
$headers = [
    "Authorization: Bearer " . $api_key
];

curl_setopt_array($curl, [
    CURLOPT_URL => "https://api.rnbdata.uk/v1/prints",
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_ENCODING => "",
    CURLOPT_MAXREDIRS => 10,
    CURLOPT_TIMEOUT => 0,
    CURLOPT_FOLLOWLOCATION => true,
    CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
    CURLOPT_CUSTOMREQUEST => "POST",
    CURLOPT_HTTPHEADER => $headers,
]);

$response = curl_exec($curl);

curl_close($curl);
echo $response;
Was this article helpful?

Related Articles