Items
Create in bulk in temporal
Creates a list of items in the temporal index in a single bulk operation.
POST
/
api
/
v2
/
search_engines
/
{hashid}
/
indices
/
{name}
/
temp
/
items
/
_bulk
Create in bulk in temporal
curl --request POST \
--url https://{search_zone}-api.doofinder.com/api/v2/search_engines/{hashid}/indices/{name}/temp/items/_bulk \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
[
{
"title": "Adidas Originals Trefoil Hoodie",
"link": "https://woocommerce.doofinder.com/product/adidas-originals-trefoil-hoodie/",
"image_link": "https://woocommerce.doofinder.com/wp-content/uploads/2024/02/suda-6-scaled.jpg",
"id": "1234",
"color": "blue",
"price": 15.99,
"sale_price": 11.99,
"categories": [
"Clothes > Hoodie",
"Men > Hoodie"
]
}
]
'import requests
url = "https://{search_zone}-api.doofinder.com/api/v2/search_engines/{hashid}/indices/{name}/temp/items/_bulk"
payload = [
{
"title": "Adidas Originals Trefoil Hoodie",
"link": "https://woocommerce.doofinder.com/product/adidas-originals-trefoil-hoodie/",
"image_link": "https://woocommerce.doofinder.com/wp-content/uploads/2024/02/suda-6-scaled.jpg",
"id": "1234",
"color": "blue",
"price": 15.99,
"sale_price": 11.99,
"categories": ["Clothes > Hoodie", "Men > Hoodie"]
}
]
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify([
{
title: 'Adidas Originals Trefoil Hoodie',
link: 'https://woocommerce.doofinder.com/product/adidas-originals-trefoil-hoodie/',
image_link: 'https://woocommerce.doofinder.com/wp-content/uploads/2024/02/suda-6-scaled.jpg',
id: '1234',
color: 'blue',
price: 15.99,
sale_price: 11.99,
categories: ['Clothes > Hoodie', 'Men > Hoodie']
}
])
};
fetch('https://{search_zone}-api.doofinder.com/api/v2/search_engines/{hashid}/indices/{name}/temp/items/_bulk', 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://{search_zone}-api.doofinder.com/api/v2/search_engines/{hashid}/indices/{name}/temp/items/_bulk",
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([
[
'title' => 'Adidas Originals Trefoil Hoodie',
'link' => 'https://woocommerce.doofinder.com/product/adidas-originals-trefoil-hoodie/',
'image_link' => 'https://woocommerce.doofinder.com/wp-content/uploads/2024/02/suda-6-scaled.jpg',
'id' => '1234',
'color' => 'blue',
'price' => 15.99,
'sale_price' => 11.99,
'categories' => [
'Clothes > Hoodie',
'Men > Hoodie'
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: <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://{search_zone}-api.doofinder.com/api/v2/search_engines/{hashid}/indices/{name}/temp/items/_bulk"
payload := strings.NewReader("[\n {\n \"title\": \"Adidas Originals Trefoil Hoodie\",\n \"link\": \"https://woocommerce.doofinder.com/product/adidas-originals-trefoil-hoodie/\",\n \"image_link\": \"https://woocommerce.doofinder.com/wp-content/uploads/2024/02/suda-6-scaled.jpg\",\n \"id\": \"1234\",\n \"color\": \"blue\",\n \"price\": 15.99,\n \"sale_price\": 11.99,\n \"categories\": [\n \"Clothes > Hoodie\",\n \"Men > Hoodie\"\n ]\n }\n]")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<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://{search_zone}-api.doofinder.com/api/v2/search_engines/{hashid}/indices/{name}/temp/items/_bulk")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("[\n {\n \"title\": \"Adidas Originals Trefoil Hoodie\",\n \"link\": \"https://woocommerce.doofinder.com/product/adidas-originals-trefoil-hoodie/\",\n \"image_link\": \"https://woocommerce.doofinder.com/wp-content/uploads/2024/02/suda-6-scaled.jpg\",\n \"id\": \"1234\",\n \"color\": \"blue\",\n \"price\": 15.99,\n \"sale_price\": 11.99,\n \"categories\": [\n \"Clothes > Hoodie\",\n \"Men > Hoodie\"\n ]\n }\n]")
.asString();require 'uri'
require 'net/http'
url = URI("https://{search_zone}-api.doofinder.com/api/v2/search_engines/{hashid}/indices/{name}/temp/items/_bulk")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "[\n {\n \"title\": \"Adidas Originals Trefoil Hoodie\",\n \"link\": \"https://woocommerce.doofinder.com/product/adidas-originals-trefoil-hoodie/\",\n \"image_link\": \"https://woocommerce.doofinder.com/wp-content/uploads/2024/02/suda-6-scaled.jpg\",\n \"id\": \"1234\",\n \"color\": \"blue\",\n \"price\": 15.99,\n \"sale_price\": 11.99,\n \"categories\": [\n \"Clothes > Hoodie\",\n \"Men > Hoodie\"\n ]\n }\n]"
response = http.request(request)
puts response.read_body{
"results": [
{
"result": "updated",
"id": "1234"
}
],
"errors": false
}{
"error": {
"code": "bad_params",
"message": "Bad parameters error",
"details": [
{
"name": "language",
"fields": [
"language"
],
"reason": "is invalid"
}
]
}
}{
"error": {
"code": "not_authenticated",
"message": "Authentication required"
}
}{
"error": {
"code": "access_denied",
"message": "Access denied"
}
}{
"error": {
"code": "not_found",
"message": "Not found"
}
}{
"error": {
"code": "timeout",
"message": "Timeout error"
}
}{
"error": {
"code": "searchengine_locked",
"message": "Search engine is being processed"
}
}{
"error": {
"message": "Request body is too large"
}
}{
"error": {
"code": "too_many_requests",
"message": "Too many requests per second"
}
}{
"error": {
"code": "unexpected_error",
"message": "An unexpected error has ocurred"
}
}{
"error": {
"code": "service_unavailable",
"message": "An internal service required to complete the request failed"
}
}Authorizations
api_tokenjwt_token
Path Parameters
Body
application/json
Required array length:
1 - 100 elementsA numeric score boosting. It multiplies the natural score of the item for a search. For instance, if boost is greater than 1.0 the item will appear higher in the results. If it is lower than 1.0, it will appear lower. The minimum value is 0.0.
Required range:
x >= 0This field has special behaviour when Indice has product preset, categories
shall be specified as:
{
...
categories: [
'parent category > inner category > leaft category',
'other parent > other inner > other leaft'
]
}
This way, when using categories field in facets, it will work as expected. When Index has generic preset, this works as normal field but it should be string.
⌘I
Create in bulk in temporal
curl --request POST \
--url https://{search_zone}-api.doofinder.com/api/v2/search_engines/{hashid}/indices/{name}/temp/items/_bulk \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
[
{
"title": "Adidas Originals Trefoil Hoodie",
"link": "https://woocommerce.doofinder.com/product/adidas-originals-trefoil-hoodie/",
"image_link": "https://woocommerce.doofinder.com/wp-content/uploads/2024/02/suda-6-scaled.jpg",
"id": "1234",
"color": "blue",
"price": 15.99,
"sale_price": 11.99,
"categories": [
"Clothes > Hoodie",
"Men > Hoodie"
]
}
]
'import requests
url = "https://{search_zone}-api.doofinder.com/api/v2/search_engines/{hashid}/indices/{name}/temp/items/_bulk"
payload = [
{
"title": "Adidas Originals Trefoil Hoodie",
"link": "https://woocommerce.doofinder.com/product/adidas-originals-trefoil-hoodie/",
"image_link": "https://woocommerce.doofinder.com/wp-content/uploads/2024/02/suda-6-scaled.jpg",
"id": "1234",
"color": "blue",
"price": 15.99,
"sale_price": 11.99,
"categories": ["Clothes > Hoodie", "Men > Hoodie"]
}
]
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify([
{
title: 'Adidas Originals Trefoil Hoodie',
link: 'https://woocommerce.doofinder.com/product/adidas-originals-trefoil-hoodie/',
image_link: 'https://woocommerce.doofinder.com/wp-content/uploads/2024/02/suda-6-scaled.jpg',
id: '1234',
color: 'blue',
price: 15.99,
sale_price: 11.99,
categories: ['Clothes > Hoodie', 'Men > Hoodie']
}
])
};
fetch('https://{search_zone}-api.doofinder.com/api/v2/search_engines/{hashid}/indices/{name}/temp/items/_bulk', 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://{search_zone}-api.doofinder.com/api/v2/search_engines/{hashid}/indices/{name}/temp/items/_bulk",
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([
[
'title' => 'Adidas Originals Trefoil Hoodie',
'link' => 'https://woocommerce.doofinder.com/product/adidas-originals-trefoil-hoodie/',
'image_link' => 'https://woocommerce.doofinder.com/wp-content/uploads/2024/02/suda-6-scaled.jpg',
'id' => '1234',
'color' => 'blue',
'price' => 15.99,
'sale_price' => 11.99,
'categories' => [
'Clothes > Hoodie',
'Men > Hoodie'
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: <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://{search_zone}-api.doofinder.com/api/v2/search_engines/{hashid}/indices/{name}/temp/items/_bulk"
payload := strings.NewReader("[\n {\n \"title\": \"Adidas Originals Trefoil Hoodie\",\n \"link\": \"https://woocommerce.doofinder.com/product/adidas-originals-trefoil-hoodie/\",\n \"image_link\": \"https://woocommerce.doofinder.com/wp-content/uploads/2024/02/suda-6-scaled.jpg\",\n \"id\": \"1234\",\n \"color\": \"blue\",\n \"price\": 15.99,\n \"sale_price\": 11.99,\n \"categories\": [\n \"Clothes > Hoodie\",\n \"Men > Hoodie\"\n ]\n }\n]")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<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://{search_zone}-api.doofinder.com/api/v2/search_engines/{hashid}/indices/{name}/temp/items/_bulk")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("[\n {\n \"title\": \"Adidas Originals Trefoil Hoodie\",\n \"link\": \"https://woocommerce.doofinder.com/product/adidas-originals-trefoil-hoodie/\",\n \"image_link\": \"https://woocommerce.doofinder.com/wp-content/uploads/2024/02/suda-6-scaled.jpg\",\n \"id\": \"1234\",\n \"color\": \"blue\",\n \"price\": 15.99,\n \"sale_price\": 11.99,\n \"categories\": [\n \"Clothes > Hoodie\",\n \"Men > Hoodie\"\n ]\n }\n]")
.asString();require 'uri'
require 'net/http'
url = URI("https://{search_zone}-api.doofinder.com/api/v2/search_engines/{hashid}/indices/{name}/temp/items/_bulk")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "[\n {\n \"title\": \"Adidas Originals Trefoil Hoodie\",\n \"link\": \"https://woocommerce.doofinder.com/product/adidas-originals-trefoil-hoodie/\",\n \"image_link\": \"https://woocommerce.doofinder.com/wp-content/uploads/2024/02/suda-6-scaled.jpg\",\n \"id\": \"1234\",\n \"color\": \"blue\",\n \"price\": 15.99,\n \"sale_price\": 11.99,\n \"categories\": [\n \"Clothes > Hoodie\",\n \"Men > Hoodie\"\n ]\n }\n]"
response = http.request(request)
puts response.read_body{
"results": [
{
"result": "updated",
"id": "1234"
}
],
"errors": false
}{
"error": {
"code": "bad_params",
"message": "Bad parameters error",
"details": [
{
"name": "language",
"fields": [
"language"
],
"reason": "is invalid"
}
]
}
}{
"error": {
"code": "not_authenticated",
"message": "Authentication required"
}
}{
"error": {
"code": "access_denied",
"message": "Access denied"
}
}{
"error": {
"code": "not_found",
"message": "Not found"
}
}{
"error": {
"code": "timeout",
"message": "Timeout error"
}
}{
"error": {
"code": "searchengine_locked",
"message": "Search engine is being processed"
}
}{
"error": {
"message": "Request body is too large"
}
}{
"error": {
"code": "too_many_requests",
"message": "Too many requests per second"
}
}{
"error": {
"code": "unexpected_error",
"message": "An unexpected error has ocurred"
}
}{
"error": {
"code": "service_unavailable",
"message": "An internal service required to complete the request failed"
}
}