curl --request POST \
--url https://auth.nox.energy/v2/manufacturer/link-sessions \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"user_id": "manufacturer_user_id_123",
"redirect_url": "https://your-app.com/callback",
"language": "nl"
}
'import requests
url = "https://auth.nox.energy/v2/manufacturer/link-sessions"
payload = {
"user_id": "manufacturer_user_id_123",
"redirect_url": "https://your-app.com/callback",
"language": "nl"
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
user_id: 'manufacturer_user_id_123',
redirect_url: 'https://your-app.com/callback',
language: 'nl'
})
};
fetch('https://auth.nox.energy/v2/manufacturer/link-sessions', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://auth.nox.energy/v2/manufacturer/link-sessions",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'user_id' => 'manufacturer_user_id_123',
'redirect_url' => 'https://your-app.com/callback',
'language' => 'nl'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://auth.nox.energy/v2/manufacturer/link-sessions"
payload := strings.NewReader("{\n \"user_id\": \"manufacturer_user_id_123\",\n \"redirect_url\": \"https://your-app.com/callback\",\n \"language\": \"nl\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://auth.nox.energy/v2/manufacturer/link-sessions")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"user_id\": \"manufacturer_user_id_123\",\n \"redirect_url\": \"https://your-app.com/callback\",\n \"language\": \"nl\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://auth.nox.energy/v2/manufacturer/link-sessions")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"user_id\": \"manufacturer_user_id_123\",\n \"redirect_url\": \"https://your-app.com/callback\",\n \"language\": \"nl\"\n}"
response = http.request(request)
puts response.read_body{
"link_url": "https://auth.nox.energy/ui?token=abc123&language=nl",
"link_token": "abc123",
"language": "nl",
"redirect_url": "https://your-app.com/callback",
"manufacturer": "Acme Manufacturing",
"manufacturer_user_id": "manufacturer_user_id_123",
"created_at": 1703123456,
"expires_at": 1703124056,
"brand": "Acme Manufacturing",
"completed_at": 123
}{
"error": "user_id is required"
}{
"error": "Invalid API key"
}Create manufacturer link session
Create a new link session to connect a user of a manufacturer, with the intend to authenticate with the energy supplier. The returned link_url should be used to redirect the end-user to the NOX Authenticator UI.
curl --request POST \
--url https://auth.nox.energy/v2/manufacturer/link-sessions \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"user_id": "manufacturer_user_id_123",
"redirect_url": "https://your-app.com/callback",
"language": "nl"
}
'import requests
url = "https://auth.nox.energy/v2/manufacturer/link-sessions"
payload = {
"user_id": "manufacturer_user_id_123",
"redirect_url": "https://your-app.com/callback",
"language": "nl"
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
user_id: 'manufacturer_user_id_123',
redirect_url: 'https://your-app.com/callback',
language: 'nl'
})
};
fetch('https://auth.nox.energy/v2/manufacturer/link-sessions', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://auth.nox.energy/v2/manufacturer/link-sessions",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'user_id' => 'manufacturer_user_id_123',
'redirect_url' => 'https://your-app.com/callback',
'language' => 'nl'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://auth.nox.energy/v2/manufacturer/link-sessions"
payload := strings.NewReader("{\n \"user_id\": \"manufacturer_user_id_123\",\n \"redirect_url\": \"https://your-app.com/callback\",\n \"language\": \"nl\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://auth.nox.energy/v2/manufacturer/link-sessions")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"user_id\": \"manufacturer_user_id_123\",\n \"redirect_url\": \"https://your-app.com/callback\",\n \"language\": \"nl\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://auth.nox.energy/v2/manufacturer/link-sessions")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"user_id\": \"manufacturer_user_id_123\",\n \"redirect_url\": \"https://your-app.com/callback\",\n \"language\": \"nl\"\n}"
response = http.request(request)
puts response.read_body{
"link_url": "https://auth.nox.energy/ui?token=abc123&language=nl",
"link_token": "abc123",
"language": "nl",
"redirect_url": "https://your-app.com/callback",
"manufacturer": "Acme Manufacturing",
"manufacturer_user_id": "manufacturer_user_id_123",
"created_at": 1703123456,
"expires_at": 1703124056,
"brand": "Acme Manufacturing",
"completed_at": 123
}{
"error": "user_id is required"
}{
"error": "Invalid API key"
}Authorizations
API key assigned to the manufacturer.
Body
The manufacturer's internal user ID for the end-user.
"manufacturer_user_id_123"
Callback URL where the user is redirected after completing the flow. Must be a valid http(s) URL. When we redirect back we append a success query param so you can render the right state: on success ?success=true plus a base64-encoded data param (JSON with nox_user_id, supplier_user_id, brand, asset_type, device_ids, connected_at); on failure ?success=false. Any query params you include in the URL yourself are preserved.
"https://your-app.com/callback"
Language for the Authenticator UI.
nl, en, fr, es Response
Link session created successfully.
Full URL to redirect the end-user to the NOX Authenticator UI.
"https://auth.nox.energy/ui?token=abc123&language=nl"
Unique token identifying this link session.
"abc123"
Language for the Authenticator UI.
nl, en, fr, es The redirect URL that was provided.
"https://your-app.com/callback"
Name of the manufacturer (resolved from API key).
"Acme Manufacturing"
The manufacturer's user ID.
"manufacturer_user_id_123"
Unix timestamp when the session was created.
1703123456
Unix timestamp when the session expires (10 minutes after creation).
1703124056
The manufacturer's brand name (title-cased).
"Acme Manufacturing"
Unix timestamp when the session was completed. Always null on creation.