Verify Authenticity
curl --request POST \
--url https://third-party.etrnl.app/v1/tags/verify-authenticity \
--header 'API-Key: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"tagId": 123,
"enc": "<string>",
"cmac": "<string>",
"tt": "<string>",
"eCode": "<string>"
}
'import requests
url = "https://third-party.etrnl.app/v1/tags/verify-authenticity"
payload = {
"tagId": 123,
"enc": "<string>",
"cmac": "<string>",
"tt": "<string>",
"eCode": "<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({
tagId: 123,
enc: '<string>',
cmac: '<string>',
tt: '<string>',
eCode: '<string>'
})
};
fetch('https://third-party.etrnl.app/v1/tags/verify-authenticity', 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/tags/verify-authenticity",
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([
'tagId' => 123,
'enc' => '<string>',
'cmac' => '<string>',
'tt' => '<string>',
'eCode' => '<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/tags/verify-authenticity"
payload := strings.NewReader("{\n \"tagId\": 123,\n \"enc\": \"<string>\",\n \"cmac\": \"<string>\",\n \"tt\": \"<string>\",\n \"eCode\": \"<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/tags/verify-authenticity")
.header("API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"tagId\": 123,\n \"enc\": \"<string>\",\n \"cmac\": \"<string>\",\n \"tt\": \"<string>\",\n \"eCode\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://third-party.etrnl.app/v1/tags/verify-authenticity")
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 \"tagId\": 123,\n \"enc\": \"<string>\",\n \"cmac\": \"<string>\",\n \"tt\": \"<string>\",\n \"eCode\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
success: true,
err: null,
exists: true,
authentic: true,
ctr: 12,
uid: "04C148EAC37180",
ttCurrStatus: null,
ttPermStatus: null,
lastAuthenticTimestamp: "2023-07-09T09:23:53.672Z",
lastAuthenticCtr: 11,
metadata: {
nftId: 'xxxxxxx'
}
}
Tags
Verify Authenticity
POST
/
v1
/
tags
/
verify-authenticity
Verify Authenticity
curl --request POST \
--url https://third-party.etrnl.app/v1/tags/verify-authenticity \
--header 'API-Key: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"tagId": 123,
"enc": "<string>",
"cmac": "<string>",
"tt": "<string>",
"eCode": "<string>"
}
'import requests
url = "https://third-party.etrnl.app/v1/tags/verify-authenticity"
payload = {
"tagId": 123,
"enc": "<string>",
"cmac": "<string>",
"tt": "<string>",
"eCode": "<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({
tagId: 123,
enc: '<string>',
cmac: '<string>',
tt: '<string>',
eCode: '<string>'
})
};
fetch('https://third-party.etrnl.app/v1/tags/verify-authenticity', 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/tags/verify-authenticity",
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([
'tagId' => 123,
'enc' => '<string>',
'cmac' => '<string>',
'tt' => '<string>',
'eCode' => '<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/tags/verify-authenticity"
payload := strings.NewReader("{\n \"tagId\": 123,\n \"enc\": \"<string>\",\n \"cmac\": \"<string>\",\n \"tt\": \"<string>\",\n \"eCode\": \"<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/tags/verify-authenticity")
.header("API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"tagId\": 123,\n \"enc\": \"<string>\",\n \"cmac\": \"<string>\",\n \"tt\": \"<string>\",\n \"eCode\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://third-party.etrnl.app/v1/tags/verify-authenticity")
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 \"tagId\": 123,\n \"enc\": \"<string>\",\n \"cmac\": \"<string>\",\n \"tt\": \"<string>\",\n \"eCode\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
success: true,
err: null,
exists: true,
authentic: true,
ctr: 12,
uid: "04C148EAC37180",
ttCurrStatus: null,
ttPermStatus: null,
lastAuthenticTimestamp: "2023-07-09T09:23:53.672Z",
lastAuthenticCtr: 11,
metadata: {
nftId: 'xxxxxxx'
}
}
You can use either the Public or Private API Key
Error Messages
- ctrBehind - The URL has expired and is no longer valid.
- uidMismatch - The encrypted UID did not match the UID stored in our database for the tag ID. The encrypted data was probably tampered with.
- cmacMismatch - CMAC signature check did not succeed. The CMAC was probably tampered with.
- doesNotExist - The tag ID is invalid and does not exist in our database.
- inactive - The tag has been marked as inactive in our database. This is probably a result of a tag that hasn’t been completely programmed.
- unauthorized - The tag does not belong to your organization.
Headers
JSON Request Body
The CMAC integrity data generated by the tag (Only required if tamper detection is not enabled)
The encrypted tag tamper status generated by the tag. (Only required if tamper detection is enabled)
{
success: true,
err: null,
exists: true,
authentic: true,
ctr: 12,
uid: "04C148EAC37180",
ttCurrStatus: null,
ttPermStatus: null,
lastAuthenticTimestamp: "2023-07-09T09:23:53.672Z",
lastAuthenticCtr: 11,
metadata: {
nftId: 'xxxxxxx'
}
}