curl --request POST \
--url https://auth.nox.energy/v2/supplier/link-sessions \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"user_id": "supplier_user_id_123",
"redirect_url": "https://your-app.com/callback",
"language": "nl"
}
'import requests
url = "https://auth.nox.energy/v2/supplier/link-sessions"
payload = {
"user_id": "supplier_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: 'supplier_user_id_123',
redirect_url: 'https://your-app.com/callback',
language: 'nl'
})
};
fetch('https://auth.nox.energy/v2/supplier/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/supplier/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' => 'supplier_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/supplier/link-sessions"
payload := strings.NewReader("{\n \"user_id\": \"supplier_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/supplier/link-sessions")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"user_id\": \"supplier_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/supplier/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\": \"supplier_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",
"asset_type": "hp",
"redirect_url": "https://your-app.com/callback",
"supplier": "Acme Energy",
"supplier_user_id": "supplier_user_id_123",
"created_at": 1703123456,
"expires_at": 1703124056,
"brand": "alpha-ess",
"completed_at": 123
}{
"error": "Missing required fields: user_id, redirect_url"
}{
"error": "Invalid API key"
}Create supplier link session
Create a new link session to connect a user of an energy supplier, with the intend to authenticate with the device manufacturer. 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/supplier/link-sessions \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"user_id": "supplier_user_id_123",
"redirect_url": "https://your-app.com/callback",
"language": "nl"
}
'import requests
url = "https://auth.nox.energy/v2/supplier/link-sessions"
payload = {
"user_id": "supplier_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: 'supplier_user_id_123',
redirect_url: 'https://your-app.com/callback',
language: 'nl'
})
};
fetch('https://auth.nox.energy/v2/supplier/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/supplier/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' => 'supplier_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/supplier/link-sessions"
payload := strings.NewReader("{\n \"user_id\": \"supplier_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/supplier/link-sessions")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"user_id\": \"supplier_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/supplier/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\": \"supplier_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",
"asset_type": "hp",
"redirect_url": "https://your-app.com/callback",
"supplier": "Acme Energy",
"supplier_user_id": "supplier_user_id_123",
"created_at": 1703123456,
"expires_at": 1703124056,
"brand": "alpha-ess",
"completed_at": 123
}{
"error": "Missing required fields: user_id, redirect_url"
}{
"error": "Invalid API key"
}Authorizations
API key assigned to the supplier.
Body
The supplier's internal user ID for the end-user.
"supplier_user_id_123"
Device category for this link session. Determines which brands are available.
hp, pv 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"
Optionally pre-select a manufacturer brand. Must be a valid brand for the given asset_type.
alpha-ess, alpha-innotec, apsystems, atlantic, bosch, buderus, bulex, ctc, daikin, dewarmte, deye, enphase, felicity-solar, fox-ess, fronius, fujitsu, goodwe, growatt, hitachi, hoymiles, huawei, hyxipower, ilumen, ivt, ja-solar, jaspi, jinkosolar, kostal, lg, longi, midea, mitsubishi, nibe, panasonic, saj, samsung, saunier-duval, sanyo, sigenergy, sma, sofar, solaredge, solarman, solax, solis, solarwatt, sungrow, sunpower, talesun, thermia, thermor, toshiba, trinasolar, vaillant, victron, viessmann 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 Device category: hp (heat pump) or pv (PV solar inverter).
hp, pv The redirect URL that was provided.
"https://your-app.com/callback"
Name of the supplier (resolved from API key).
"Acme Energy"
The supplier's user ID.
"supplier_user_id_123"
Unix timestamp when the session was created.
1703123456
Unix timestamp when the session expires (10 minutes after creation).
1703124056
Pre-selected brand, if provided.
alpha-ess, alpha-innotec, apsystems, atlantic, bosch, buderus, bulex, ctc, daikin, dewarmte, deye, enphase, felicity-solar, fox-ess, fronius, fujitsu, goodwe, growatt, hitachi, hoymiles, huawei, hyxipower, ilumen, ivt, ja-solar, jaspi, jinkosolar, kostal, lg, longi, midea, mitsubishi, nibe, panasonic, saj, samsung, saunier-duval, sanyo, sigenergy, sma, sofar, solaredge, solarman, solax, solis, solarwatt, sungrow, sunpower, talesun, thermia, thermor, toshiba, trinasolar, vaillant, victron, viessmann Unix timestamp when the session was completed. Always null on creation.