Skip to main content

index

Before interacting with Powernaut's APIs, it's essential to establish secure authentication and authorization.

The API uses JWT Bearer authentication.

info

This API is only available with TLS 1.2 or above (HTTPS).

Fetching an access token​

You need to fetch an access token by using the token endpoint, giving it your client ID and secret.

This endpoint uses basic access authentication. This means you need to generate the credentials by concatenating the client ID and secret with a colon (:) in between, then encoding the result with Base64.

import requests

url = "https://api.powernaut.io/v1/auth/token"

payload = {}
headers = {
'Accept': 'application/json',
'Authorization': 'Basic <credentials>'
}

response = requests.request("POST", url, headers=headers, data=payload)

print(response.text)
info

Given our private beta, credentials are currently only accessible upon request.

Send an email to us for early access.

Authenticating​

Each endpoint requires JWT Bearer authentication. The token should be included in the Authorization HTTP header, preceded with Bearer and a space.

Authorization: Bearer <token>

For example, to list all connection points:

import requests

url = "https://api.powernaut.io/v1/connect/connection-points?page=1&page_size=10"

payload = {}
headers = {
'Accept': 'application/json',
'Authorization': 'Bearer <token>'
}

response = requests.request("GET", url, headers=headers, data=payload)

print(response.text)