Create
curl --request POST \
--url https://third-party.etrnl.app/v1/url-groups \
--header 'API-Key: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"customUrl": "<string>",
"appName": "<string>"
}
'import requests
url = "https://third-party.etrnl.app/v1/url-groups"
payload = {
"name": "<string>",
"customUrl": "<string>",
"appName": "<string>"
}
headers = {
"API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({name: '<string>', customUrl: '<string>', appName: '<string>'})
};
fetch('https://third-party.etrnl.app/v1/url-groups', 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://third-party.etrnl.app/v1/url-groups",
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([
'name' => '<string>',
'customUrl' => '<string>',
'appName' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"API-Key: <api-key>",
"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://third-party.etrnl.app/v1/url-groups"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"customUrl\": \"<string>\",\n \"appName\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("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://third-party.etrnl.app/v1/url-groups")
.header("API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"customUrl\": \"<string>\",\n \"appName\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://third-party.etrnl.app/v1/url-groups")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"customUrl\": \"<string>\",\n \"appName\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
success: true,
err: '',
group: {
name: "New Group",
appName: "ETRNL",
organizationId: 33,
creationDate: "2023-09-26T18:44:59.000Z",
customUrl: "https://example.com/{tagId}/?enc={enc}&cmac={cmac}&eCode={eCode}"
}
}
URL Groups
Create
POST
/
v1
/
url-groups
Create
curl --request POST \
--url https://third-party.etrnl.app/v1/url-groups \
--header 'API-Key: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"customUrl": "<string>",
"appName": "<string>"
}
'import requests
url = "https://third-party.etrnl.app/v1/url-groups"
payload = {
"name": "<string>",
"customUrl": "<string>",
"appName": "<string>"
}
headers = {
"API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({name: '<string>', customUrl: '<string>', appName: '<string>'})
};
fetch('https://third-party.etrnl.app/v1/url-groups', 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://third-party.etrnl.app/v1/url-groups",
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([
'name' => '<string>',
'customUrl' => '<string>',
'appName' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"API-Key: <api-key>",
"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://third-party.etrnl.app/v1/url-groups"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"customUrl\": \"<string>\",\n \"appName\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("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://third-party.etrnl.app/v1/url-groups")
.header("API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"customUrl\": \"<string>\",\n \"appName\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://third-party.etrnl.app/v1/url-groups")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"customUrl\": \"<string>\",\n \"appName\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
success: true,
err: '',
group: {
name: "New Group",
appName: "ETRNL",
organizationId: 33,
creationDate: "2023-09-26T18:44:59.000Z",
customUrl: "https://example.com/{tagId}/?enc={enc}&cmac={cmac}&eCode={eCode}"
}
}
This endpoint can be used to create a new URL configuration that can then be programmed into multiple tags.
Defining the URL
A custom URL can be defined by writing out your URL and wrapping 4 of the required parameters in curly braces ”{}”.Custom URL Params
- tagId - The ETRNL unique ID of the tag
- enc - The encrypted message generated by the tag
- cmac - he CMAC integrity data generated by the tag (Only required if tamper detection is not enabled)
- tt - The encrypted tag tamper status generated by the tag. (Only required if tamper detection is enabled)
- eCode - A KDF input parameter used for key decyrption
Examples
- Custom URL
- Tag generated URL
https://exmaple.com/{tagId}/?enc={enc}&cmac={cmac}&eCode={eCode}
https://exmaple.com/1/?enc=C038A76FAB26F1FBBBDA23FC0904C10A&cmac=E064A56067FB63F8&eCode=B08CF3C4910833F226A260D397CAB992
The custom URL params can only be used as a query parameter, or a URL slug.
Tag Tamper
For tag tamper URLs, you cannot include the cmac value as the tt message includes both the cmac and the encrypted tamper status. So the custom URL would look something like: https://exmaple.com/{tagId}/?enc={enc}&tt={tt}&eCode={eCode}Headers
string
required
Your organization’s private API key.
JSON Request Body
string
required
The name of your custom URL group.
string
required
The custom URL definition that will be programmed into the tags.
string
required
This is the service that’s used to add the custom URL.
The custom URL group will show up in the programmer as [APP Name] - Name.
{
success: true,
err: '',
group: {
name: "New Group",
appName: "ETRNL",
organizationId: 33,
creationDate: "2023-09-26T18:44:59.000Z",
customUrl: "https://example.com/{tagId}/?enc={enc}&cmac={cmac}&eCode={eCode}"
}
}