Connect User to NOX with Supplier OAuth
curl --request POST \
--url https://auth.nox.energy/manufacturers/suppliers \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"manufacturer_user_id": "mfr_user_123",
"device_ids": [
"device_001",
"device_002"
],
"redirect_url": "https://manufacturer-app.com/callback",
"language": "en"
}
'import requests
url = "https://auth.nox.energy/manufacturers/suppliers"
payload = {
"manufacturer_user_id": "mfr_user_123",
"device_ids": ["device_001", "device_002"],
"redirect_url": "https://manufacturer-app.com/callback",
"language": "en"
}
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({
manufacturer_user_id: 'mfr_user_123',
device_ids: ['device_001', 'device_002'],
redirect_url: 'https://manufacturer-app.com/callback',
language: 'en'
})
};
fetch('https://auth.nox.energy/manufacturers/suppliers', 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/manufacturers/suppliers",
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([
'manufacturer_user_id' => 'mfr_user_123',
'device_ids' => [
'device_001',
'device_002'
],
'redirect_url' => 'https://manufacturer-app.com/callback',
'language' => 'en'
]),
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/manufacturers/suppliers"
payload := strings.NewReader("{\n \"manufacturer_user_id\": \"mfr_user_123\",\n \"device_ids\": [\n \"device_001\",\n \"device_002\"\n ],\n \"redirect_url\": \"https://manufacturer-app.com/callback\",\n \"language\": \"en\"\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/manufacturers/suppliers")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"manufacturer_user_id\": \"mfr_user_123\",\n \"device_ids\": [\n \"device_001\",\n \"device_002\"\n ],\n \"redirect_url\": \"https://manufacturer-app.com/callback\",\n \"language\": \"en\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://auth.nox.energy/manufacturers/suppliers")
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 \"manufacturer_user_id\": \"mfr_user_123\",\n \"device_ids\": [\n \"device_001\",\n \"device_002\"\n ],\n \"redirect_url\": \"https://manufacturer-app.com/callback\",\n \"language\": \"en\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"timestamp": 1703123456,
"data": {
"link_token": "abc123def456ghi789",
"link_url": "https://auth.sandbox.nox.energy/?token=abc123def456&connection_type=manufacturer",
"expires_at": 1703124056,
"manufacturer": "Daikin",
"manufacturer_user_id": "mfr_user_123",
"nox_user_id": "550e8400-e29b-41d4-a716-446655440000",
"device_ids": [
"device_001",
"device_002"
]
}
}{
"success": false,
"timestamp": 1703123456,
"error": "Missing API key",
"error_code": "missing_api_key",
"message": "Missing API key"
}{
"success": false,
"timestamp": 1703123456,
"error": "Missing API key",
"error_code": "missing_api_key",
"message": "Missing API key"
}Deprecated
Connect User to NOX with Supplier OAuth
deprecated
Connects a manufacturer user to NOX with the intent of linking them to an energy supplier via OAuth. Creates or updates the subscriber record and returns a link_url where the user should be redirected to complete the supplier OAuth flow.
POST
/
manufacturers
/
suppliers
Connect User to NOX with Supplier OAuth
curl --request POST \
--url https://auth.nox.energy/manufacturers/suppliers \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"manufacturer_user_id": "mfr_user_123",
"device_ids": [
"device_001",
"device_002"
],
"redirect_url": "https://manufacturer-app.com/callback",
"language": "en"
}
'import requests
url = "https://auth.nox.energy/manufacturers/suppliers"
payload = {
"manufacturer_user_id": "mfr_user_123",
"device_ids": ["device_001", "device_002"],
"redirect_url": "https://manufacturer-app.com/callback",
"language": "en"
}
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({
manufacturer_user_id: 'mfr_user_123',
device_ids: ['device_001', 'device_002'],
redirect_url: 'https://manufacturer-app.com/callback',
language: 'en'
})
};
fetch('https://auth.nox.energy/manufacturers/suppliers', 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/manufacturers/suppliers",
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([
'manufacturer_user_id' => 'mfr_user_123',
'device_ids' => [
'device_001',
'device_002'
],
'redirect_url' => 'https://manufacturer-app.com/callback',
'language' => 'en'
]),
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/manufacturers/suppliers"
payload := strings.NewReader("{\n \"manufacturer_user_id\": \"mfr_user_123\",\n \"device_ids\": [\n \"device_001\",\n \"device_002\"\n ],\n \"redirect_url\": \"https://manufacturer-app.com/callback\",\n \"language\": \"en\"\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/manufacturers/suppliers")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"manufacturer_user_id\": \"mfr_user_123\",\n \"device_ids\": [\n \"device_001\",\n \"device_002\"\n ],\n \"redirect_url\": \"https://manufacturer-app.com/callback\",\n \"language\": \"en\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://auth.nox.energy/manufacturers/suppliers")
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 \"manufacturer_user_id\": \"mfr_user_123\",\n \"device_ids\": [\n \"device_001\",\n \"device_002\"\n ],\n \"redirect_url\": \"https://manufacturer-app.com/callback\",\n \"language\": \"en\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"timestamp": 1703123456,
"data": {
"link_token": "abc123def456ghi789",
"link_url": "https://auth.sandbox.nox.energy/?token=abc123def456&connection_type=manufacturer",
"expires_at": 1703124056,
"manufacturer": "Daikin",
"manufacturer_user_id": "mfr_user_123",
"nox_user_id": "550e8400-e29b-41d4-a716-446655440000",
"device_ids": [
"device_001",
"device_002"
]
}
}{
"success": false,
"timestamp": 1703123456,
"error": "Missing API key",
"error_code": "missing_api_key",
"message": "Missing API key"
}{
"success": false,
"timestamp": 1703123456,
"error": "Missing API key",
"error_code": "missing_api_key",
"message": "Missing API key"
}Authorizations
API key for authentication. You can also use 'Authorization: ApiKey YOUR_KEY' header.
Body
application/json
The manufacturer's unique identifier for the user
Example:
"mfr_user_123"
URL where the user will be redirected after completing the supplier OAuth flow
Example:
"https://manufacturer-app.com/callback"
Optional list of device IDs to associate with this connection
Example:
["device_001", "device_002"]
Language code for the OAuth redirect page UI (e.g., 'en', 'nl', 'fr')
Example:
"en"
⌘I