REST reference
Resolve cigar text
Resolve supplied cigar text to ranked Boxpressd catalog candidates.
POST
/
v1
/
cigars
/
resolve
Resolve cigar text
curl --request POST \
--url https://api.example.com/v1/cigars/resolve \
--header 'Content-Type: application/json' \
--header 'x-boxpressd-key: <x-boxpressd-key>' \
--data '
{
"query": "<string>",
"name": "<string>",
"brand": "<string>",
"limit": 123
}
'import requests
url = "https://api.example.com/v1/cigars/resolve"
payload = {
"query": "<string>",
"name": "<string>",
"brand": "<string>",
"limit": 123
}
headers = {
"x-boxpressd-key": "<x-boxpressd-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>', 'Content-Type': 'application/json'},
body: JSON.stringify({query: '<string>', name: '<string>', brand: '<string>', limit: 123})
};
fetch('https://api.example.com/v1/cigars/resolve', 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/cigars/resolve",
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([
'query' => '<string>',
'name' => '<string>',
'brand' => '<string>',
'limit' => 123
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"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/cigars/resolve"
payload := strings.NewReader("{\n \"query\": \"<string>\",\n \"name\": \"<string>\",\n \"brand\": \"<string>\",\n \"limit\": 123\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-boxpressd-key", "<x-boxpressd-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/cigars/resolve")
.header("x-boxpressd-key", "<x-boxpressd-key>")
.header("Content-Type", "application/json")
.body("{\n \"query\": \"<string>\",\n \"name\": \"<string>\",\n \"brand\": \"<string>\",\n \"limit\": 123\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/v1/cigars/resolve")
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["Content-Type"] = 'application/json'
request.body = "{\n \"query\": \"<string>\",\n \"name\": \"<string>\",\n \"brand\": \"<string>\",\n \"limit\": 123\n}"
response = http.request(request)
puts response.read_bodyUse resolution when you have imperfect text rather than a Boxpressd public ID.
The response contains
string
required
Your developer application key.
string
Combined search text from 2 through 200 characters. Either
query or name is required.string
Cigar name. Either
query or name is required.string
Optional brand name used for ranking and filtering.
integer
default:"5"
Number of candidates from 1 through 10.
curl "https://api.boxpressd.com/v1/cigars/resolve" \
--request POST \
--header "content-type: application/json" \
--header "x-boxpressd-key: $BOXPRESSD_DEVELOPER_API_KEY" \
--data '{"brand":"Drew Estate","name":"Liga Privada No. 9"}'
match, ordered candidates, and a resolved boolean. The API does not currently return a confidence score.⌘I
Resolve cigar text
curl --request POST \
--url https://api.example.com/v1/cigars/resolve \
--header 'Content-Type: application/json' \
--header 'x-boxpressd-key: <x-boxpressd-key>' \
--data '
{
"query": "<string>",
"name": "<string>",
"brand": "<string>",
"limit": 123
}
'import requests
url = "https://api.example.com/v1/cigars/resolve"
payload = {
"query": "<string>",
"name": "<string>",
"brand": "<string>",
"limit": 123
}
headers = {
"x-boxpressd-key": "<x-boxpressd-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>', 'Content-Type': 'application/json'},
body: JSON.stringify({query: '<string>', name: '<string>', brand: '<string>', limit: 123})
};
fetch('https://api.example.com/v1/cigars/resolve', 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/cigars/resolve",
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([
'query' => '<string>',
'name' => '<string>',
'brand' => '<string>',
'limit' => 123
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"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/cigars/resolve"
payload := strings.NewReader("{\n \"query\": \"<string>\",\n \"name\": \"<string>\",\n \"brand\": \"<string>\",\n \"limit\": 123\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-boxpressd-key", "<x-boxpressd-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/cigars/resolve")
.header("x-boxpressd-key", "<x-boxpressd-key>")
.header("Content-Type", "application/json")
.body("{\n \"query\": \"<string>\",\n \"name\": \"<string>\",\n \"brand\": \"<string>\",\n \"limit\": 123\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/v1/cigars/resolve")
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["Content-Type"] = 'application/json'
request.body = "{\n \"query\": \"<string>\",\n \"name\": \"<string>\",\n \"brand\": \"<string>\",\n \"limit\": 123\n}"
response = http.request(request)
puts response.read_body