Store LabelGrid credentials
curl --request PUT \
--url https://api.royalti.io/ddex/labelgrid/credentials \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"bearerToken": "lg_live_9f2a1c..."
}
'import requests
url = "https://api.royalti.io/ddex/labelgrid/credentials"
payload = { "bearerToken": "lg_live_9f2a1c..." }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({bearerToken: 'lg_live_9f2a1c...'})
};
fetch('https://api.royalti.io/ddex/labelgrid/credentials', 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://api.royalti.io/ddex/labelgrid/credentials",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'bearerToken' => 'lg_live_9f2a1c...'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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://api.royalti.io/ddex/labelgrid/credentials"
payload := strings.NewReader("{\n \"bearerToken\": \"lg_live_9f2a1c...\"\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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.put("https://api.royalti.io/ddex/labelgrid/credentials")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"bearerToken\": \"lg_live_9f2a1c...\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.royalti.io/ddex/labelgrid/credentials")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"bearerToken\": \"lg_live_9f2a1c...\"\n}"
response = http.request(request)
puts response.read_body{
"status": "success",
"message": "LabelGrid credentials saved",
"data": {
"providerSeeded": true,
"configured": true,
"isEnabled": true,
"credentialState": "absent",
"hasToken": true,
"tokenHint": "••••••••wxyz",
"tokenUpdatedAt": "2023-11-07T05:31:56Z",
"hasWebhookSecret": true,
"webhookSecretUpdatedAt": "2023-11-07T05:31:56Z"
}
}{
"success": false,
"error": {
"code": "<string>",
"message": "<string>",
"details": [
"<string>"
]
}
}{
"status": "error",
"message": "Unauthorized"
}{
"status": "error",
"message": "Resource not found"
}{
"status": "error",
"message": "Internal server error"
}{
"success": false,
"error": {
"code": "<string>",
"message": "<string>",
"details": [
"<string>"
]
}
}Labelgrid
Store LabelGrid credentials
Store this workspace’s LabelGrid Bearer token and/or webhook signing
PUT
/
ddex
/
labelgrid
/
credentials
Store LabelGrid credentials
curl --request PUT \
--url https://api.royalti.io/ddex/labelgrid/credentials \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"bearerToken": "lg_live_9f2a1c..."
}
'import requests
url = "https://api.royalti.io/ddex/labelgrid/credentials"
payload = { "bearerToken": "lg_live_9f2a1c..." }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({bearerToken: 'lg_live_9f2a1c...'})
};
fetch('https://api.royalti.io/ddex/labelgrid/credentials', 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://api.royalti.io/ddex/labelgrid/credentials",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'bearerToken' => 'lg_live_9f2a1c...'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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://api.royalti.io/ddex/labelgrid/credentials"
payload := strings.NewReader("{\n \"bearerToken\": \"lg_live_9f2a1c...\"\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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.put("https://api.royalti.io/ddex/labelgrid/credentials")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"bearerToken\": \"lg_live_9f2a1c...\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.royalti.io/ddex/labelgrid/credentials")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"bearerToken\": \"lg_live_9f2a1c...\"\n}"
response = http.request(request)
puts response.read_body{
"status": "success",
"message": "LabelGrid credentials saved",
"data": {
"providerSeeded": true,
"configured": true,
"isEnabled": true,
"credentialState": "absent",
"hasToken": true,
"tokenHint": "••••••••wxyz",
"tokenUpdatedAt": "2023-11-07T05:31:56Z",
"hasWebhookSecret": true,
"webhookSecretUpdatedAt": "2023-11-07T05:31:56Z"
}
}{
"success": false,
"error": {
"code": "<string>",
"message": "<string>",
"details": [
"<string>"
]
}
}{
"status": "error",
"message": "Unauthorized"
}{
"status": "error",
"message": "Resource not found"
}{
"status": "error",
"message": "Internal server error"
}{
"success": false,
"error": {
"code": "<string>",
"message": "<string>",
"details": [
"<string>"
]
}
}Description
secret. At least one ofbearerToken/webhookSecret is required;
supplying only one preserves the other. Values are encrypted at rest
(pgcrypto) — there is no plaintext credential path.
The response echoes only the masked LabelGridCredentialSummary —
never the value that was just stored.
Authorization:
- Required role:
owneronly
Code Examples
const response = await fetch('https://api.royalti.io/ddex/labelgrid/credentials', {
method: 'PUT',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify({
"bearerToken": "sample-bearerToken",
"webhookSecret": "sample-webhookSecret"
})
});
const data = await response.json();
console.log(data);
import requests
response = requests.put(
'https://api.royalti.io/ddex/labelgrid/credentials',
json={"bearerToken":"sample-bearerToken","webhookSecret":"sample-webhookSecret"}
)
data = response.json()
print(data)
curl -X PUT https://api.royalti.io/ddex/labelgrid/credentials \
-H "Content-Type: application/json" \
-d '{"bearerToken":"sample-bearerToken","webhookSecret":"sample-webhookSecret"}'
Authorizations
JWT Authorization header using the Bearer scheme. Format: "Bearer {token}"
Body
application/json
⌘I