REST reference
Analyze cigar-band evidence
Use band appearance to discriminate among plausible cigar candidates.
POST
/
v1
/
ai
/
cigars
/
band
/
analyze
Analyze cigar-band evidence
curl --request POST \
--url https://api.example.com/v1/ai/cigars/band/analyze \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: <idempotency-key>' \
--header 'x-boxpressd-key: <x-boxpressd-key>' \
--data '
{
"fingerprint": {},
"candidates": [
{}
],
"expandSameBrand": true
}
'import requests
url = "https://api.example.com/v1/ai/cigars/band/analyze"
payload = {
"fingerprint": {},
"candidates": [{}],
"expandSameBrand": True
}
headers = {
"x-boxpressd-key": "<x-boxpressd-key>",
"Idempotency-Key": "<idempotency-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'x-boxpressd-key': '<x-boxpressd-key>',
'Idempotency-Key': '<idempotency-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({fingerprint: {}, candidates: [{}], expandSameBrand: true})
};
fetch('https://api.example.com/v1/ai/cigars/band/analyze', 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.example.com/v1/ai/cigars/band/analyze",
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([
'fingerprint' => [
],
'candidates' => [
[
]
],
'expandSameBrand' => true
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"Idempotency-Key: <idempotency-key>",
"x-boxpressd-key: <x-boxpressd-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://api.example.com/v1/ai/cigars/band/analyze"
payload := strings.NewReader("{\n \"fingerprint\": {},\n \"candidates\": [\n {}\n ],\n \"expandSameBrand\": true\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-boxpressd-key", "<x-boxpressd-key>")
req.Header.Add("Idempotency-Key", "<idempotency-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://api.example.com/v1/ai/cigars/band/analyze")
.header("x-boxpressd-key", "<x-boxpressd-key>")
.header("Idempotency-Key", "<idempotency-key>")
.header("Content-Type", "application/json")
.body("{\n \"fingerprint\": {},\n \"candidates\": [\n {}\n ],\n \"expandSameBrand\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/v1/ai/cigars/band/analyze")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-boxpressd-key"] = '<x-boxpressd-key>'
request["Idempotency-Key"] = '<idempotency-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"fingerprint\": {},\n \"candidates\": [\n {}\n ],\n \"expandSameBrand\": true\n}"
response = http.request(request)
puts response.read_bodyUse band analysis after fingerprinting when two or more candidates remain plausible. It compares the observed band palette and color roles with stored candidate fingerprints. It does not perform a general catalog search.
Fewer than two usable stored candidate fingerprints can return
string
required
Your developer application key with the
api.ai entitlement.string
required
A unique key for this credit-gated operation.
object
required
The complete object returned by the fingerprint endpoint.
object[]
required
From 1 through 20 plausible candidates. Each candidate requires
cigarId and can include brand, name, score, and prior evidence.boolean
Search a bounded set of stored fingerprints from the supplied brand when none of the supplied candidates has a credible color match.
const response = await fetch(
"https://api.boxpressd.com/v1/ai/cigars/band/analyze",
{
method: "POST",
headers: {
"x-boxpressd-key": process.env.BOXPRESSD_DEVELOPER_API_KEY,
"Idempotency-Key": crypto.randomUUID(),
"Content-Type": "application/json",
},
body: JSON.stringify({
fingerprint,
candidates: [
{
cigarId: 101,
brand: "Diesel",
name: "Unlimited",
score: 0.78,
},
{
cigarId: 102,
brand: "Diesel",
name: "Wicked",
score: 0.76,
},
],
expandSameBrand: true,
}),
},
);
const bandAnalysis = await response.json();
reference_fingerprints_pending. A strong conflict can return candidateSetMatch: false without inventing a replacement candidate.
Pass the complete response to Identify as stageResults.bandAnalysis. Visible printed cigar-name text remains stronger evidence when it conflicts with palette analysis.⌘I
Analyze cigar-band evidence
curl --request POST \
--url https://api.example.com/v1/ai/cigars/band/analyze \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: <idempotency-key>' \
--header 'x-boxpressd-key: <x-boxpressd-key>' \
--data '
{
"fingerprint": {},
"candidates": [
{}
],
"expandSameBrand": true
}
'import requests
url = "https://api.example.com/v1/ai/cigars/band/analyze"
payload = {
"fingerprint": {},
"candidates": [{}],
"expandSameBrand": True
}
headers = {
"x-boxpressd-key": "<x-boxpressd-key>",
"Idempotency-Key": "<idempotency-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'x-boxpressd-key': '<x-boxpressd-key>',
'Idempotency-Key': '<idempotency-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({fingerprint: {}, candidates: [{}], expandSameBrand: true})
};
fetch('https://api.example.com/v1/ai/cigars/band/analyze', 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.example.com/v1/ai/cigars/band/analyze",
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([
'fingerprint' => [
],
'candidates' => [
[
]
],
'expandSameBrand' => true
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"Idempotency-Key: <idempotency-key>",
"x-boxpressd-key: <x-boxpressd-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://api.example.com/v1/ai/cigars/band/analyze"
payload := strings.NewReader("{\n \"fingerprint\": {},\n \"candidates\": [\n {}\n ],\n \"expandSameBrand\": true\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-boxpressd-key", "<x-boxpressd-key>")
req.Header.Add("Idempotency-Key", "<idempotency-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://api.example.com/v1/ai/cigars/band/analyze")
.header("x-boxpressd-key", "<x-boxpressd-key>")
.header("Idempotency-Key", "<idempotency-key>")
.header("Content-Type", "application/json")
.body("{\n \"fingerprint\": {},\n \"candidates\": [\n {}\n ],\n \"expandSameBrand\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/v1/ai/cigars/band/analyze")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-boxpressd-key"] = '<x-boxpressd-key>'
request["Idempotency-Key"] = '<idempotency-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"fingerprint\": {},\n \"candidates\": [\n {}\n ],\n \"expandSameBrand\": true\n}"
response = http.request(request)
puts response.read_body