curl --request POST \
--url https://api.fabric.inc/v3/product-attributes/search \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"match": {
"id": {
"op": "IN",
"value": [
"blue"
]
},
"name": {
"op": "IN",
"value": [
"blue"
],
"locale": [
"en_US"
]
},
"description": {
"op": "IN",
"value": [
"blue"
]
},
"target": {
"op": "EQUALS",
"value": "PRODUCT"
},
"type": {
"op": "EQUALS",
"value": "TEXT"
},
"subType": {
"op": "EQUALS",
"value": "SINGLE"
},
"createdAt": {
"op": "RANGE",
"fromValue": "2022-04-20T10:24:36.162Z",
"toValue": "2023-04-20T10:24:36.162Z"
},
"updatedAt": {
"op": "RANGE",
"fromValue": "2022-04-20T10:24:36.162Z",
"toValue": "2023-04-20T10:24:36.162Z"
}
},
"sort": "+name,-isMandatory",
"offset": 2,
"limit": 10
}
'import requests
url = "https://api.fabric.inc/v3/product-attributes/search"
payload = {
"match": {
"id": {
"op": "IN",
"value": ["blue"]
},
"name": {
"op": "IN",
"value": ["blue"],
"locale": ["en_US"]
},
"description": {
"op": "IN",
"value": ["blue"]
},
"target": {
"op": "EQUALS",
"value": "PRODUCT"
},
"type": {
"op": "EQUALS",
"value": "TEXT"
},
"subType": {
"op": "EQUALS",
"value": "SINGLE"
},
"createdAt": {
"op": "RANGE",
"fromValue": "2022-04-20T10:24:36.162Z",
"toValue": "2023-04-20T10:24:36.162Z"
},
"updatedAt": {
"op": "RANGE",
"fromValue": "2022-04-20T10:24:36.162Z",
"toValue": "2023-04-20T10:24:36.162Z"
}
},
"sort": "+name,-isMandatory",
"offset": 2,
"limit": 10
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
match: {
id: {op: 'IN', value: ['blue']},
name: {op: 'IN', value: ['blue'], locale: ['en_US']},
description: {op: 'IN', value: ['blue']},
target: {op: 'EQUALS', value: 'PRODUCT'},
type: {op: 'EQUALS', value: 'TEXT'},
subType: {op: 'EQUALS', value: 'SINGLE'},
createdAt: {
op: 'RANGE',
fromValue: '2022-04-20T10:24:36.162Z',
toValue: '2023-04-20T10:24:36.162Z'
},
updatedAt: {
op: 'RANGE',
fromValue: '2022-04-20T10:24:36.162Z',
toValue: '2023-04-20T10:24:36.162Z'
}
},
sort: '+name,-isMandatory',
offset: 2,
limit: 10
})
};
fetch('https://api.fabric.inc/v3/product-attributes/search', 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.fabric.inc/v3/product-attributes/search",
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([
'match' => [
'id' => [
'op' => 'IN',
'value' => [
'blue'
]
],
'name' => [
'op' => 'IN',
'value' => [
'blue'
],
'locale' => [
'en_US'
]
],
'description' => [
'op' => 'IN',
'value' => [
'blue'
]
],
'target' => [
'op' => 'EQUALS',
'value' => 'PRODUCT'
],
'type' => [
'op' => 'EQUALS',
'value' => 'TEXT'
],
'subType' => [
'op' => 'EQUALS',
'value' => 'SINGLE'
],
'createdAt' => [
'op' => 'RANGE',
'fromValue' => '2022-04-20T10:24:36.162Z',
'toValue' => '2023-04-20T10:24:36.162Z'
],
'updatedAt' => [
'op' => 'RANGE',
'fromValue' => '2022-04-20T10:24:36.162Z',
'toValue' => '2023-04-20T10:24:36.162Z'
]
],
'sort' => '+name,-isMandatory',
'offset' => 2,
'limit' => 10
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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://api.fabric.inc/v3/product-attributes/search"
payload := strings.NewReader("{\n \"match\": {\n \"id\": {\n \"op\": \"IN\",\n \"value\": [\n \"blue\"\n ]\n },\n \"name\": {\n \"op\": \"IN\",\n \"value\": [\n \"blue\"\n ],\n \"locale\": [\n \"en_US\"\n ]\n },\n \"description\": {\n \"op\": \"IN\",\n \"value\": [\n \"blue\"\n ]\n },\n \"target\": {\n \"op\": \"EQUALS\",\n \"value\": \"PRODUCT\"\n },\n \"type\": {\n \"op\": \"EQUALS\",\n \"value\": \"TEXT\"\n },\n \"subType\": {\n \"op\": \"EQUALS\",\n \"value\": \"SINGLE\"\n },\n \"createdAt\": {\n \"op\": \"RANGE\",\n \"fromValue\": \"2022-04-20T10:24:36.162Z\",\n \"toValue\": \"2023-04-20T10:24:36.162Z\"\n },\n \"updatedAt\": {\n \"op\": \"RANGE\",\n \"fromValue\": \"2022-04-20T10:24:36.162Z\",\n \"toValue\": \"2023-04-20T10:24:36.162Z\"\n }\n },\n \"sort\": \"+name,-isMandatory\",\n \"offset\": 2,\n \"limit\": 10\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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.fabric.inc/v3/product-attributes/search")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"match\": {\n \"id\": {\n \"op\": \"IN\",\n \"value\": [\n \"blue\"\n ]\n },\n \"name\": {\n \"op\": \"IN\",\n \"value\": [\n \"blue\"\n ],\n \"locale\": [\n \"en_US\"\n ]\n },\n \"description\": {\n \"op\": \"IN\",\n \"value\": [\n \"blue\"\n ]\n },\n \"target\": {\n \"op\": \"EQUALS\",\n \"value\": \"PRODUCT\"\n },\n \"type\": {\n \"op\": \"EQUALS\",\n \"value\": \"TEXT\"\n },\n \"subType\": {\n \"op\": \"EQUALS\",\n \"value\": \"SINGLE\"\n },\n \"createdAt\": {\n \"op\": \"RANGE\",\n \"fromValue\": \"2022-04-20T10:24:36.162Z\",\n \"toValue\": \"2023-04-20T10:24:36.162Z\"\n },\n \"updatedAt\": {\n \"op\": \"RANGE\",\n \"fromValue\": \"2022-04-20T10:24:36.162Z\",\n \"toValue\": \"2023-04-20T10:24:36.162Z\"\n }\n },\n \"sort\": \"+name,-isMandatory\",\n \"offset\": 2,\n \"limit\": 10\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.fabric.inc/v3/product-attributes/search")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"match\": {\n \"id\": {\n \"op\": \"IN\",\n \"value\": [\n \"blue\"\n ]\n },\n \"name\": {\n \"op\": \"IN\",\n \"value\": [\n \"blue\"\n ],\n \"locale\": [\n \"en_US\"\n ]\n },\n \"description\": {\n \"op\": \"IN\",\n \"value\": [\n \"blue\"\n ]\n },\n \"target\": {\n \"op\": \"EQUALS\",\n \"value\": \"PRODUCT\"\n },\n \"type\": {\n \"op\": \"EQUALS\",\n \"value\": \"TEXT\"\n },\n \"subType\": {\n \"op\": \"EQUALS\",\n \"value\": \"SINGLE\"\n },\n \"createdAt\": {\n \"op\": \"RANGE\",\n \"fromValue\": \"2022-04-20T10:24:36.162Z\",\n \"toValue\": \"2023-04-20T10:24:36.162Z\"\n },\n \"updatedAt\": {\n \"op\": \"RANGE\",\n \"fromValue\": \"2022-04-20T10:24:36.162Z\",\n \"toValue\": \"2023-04-20T10:24:36.162Z\"\n }\n },\n \"sort\": \"+name,-isMandatory\",\n \"offset\": 2,\n \"limit\": 10\n}"
response = http.request(request)
puts response.read_body{
"data": [
{
"id": "64c1557de1f95e3214660ceb",
"name": "serialNumber",
"description": "Serial number which starts with the 1 and keeps incrementing 10 for the subsequent call",
"type": "SERIAL",
"target": "PRODUCT",
"isLocalizable": false,
"validation": {
"isMandatory": false,
"isManualOverwrite": false,
"formula": "",
"startWith": 1,
"increment": 10
},
"updatedAt": "2023-07-26T17:18:47.162Z",
"createdAt": "2023-07-26T17:18:47.162Z",
"updatedBy": "test@email.com"
},
{
"id": "64c1557ce1f95e3214660ce6",
"name": "isLive",
"description": "Boolean attribute to capture if the product is live.",
"type": "BOOLEAN",
"target": "PRODUCT",
"isLocalizable": false,
"validation": {
"isMandatory": true
},
"updatedAt": "2023-07-26T17:18:47.162Z",
"createdAt": "2023-07-26T17:18:47.162Z",
"updatedBy": "test@email.com"
},
{
"id": "64c1557be1f95e3214660ce1",
"name": "Date Attribute",
"description": "Attribute to capture date",
"type": "DATETIME",
"target": "PRODUCT",
"isLocalizable": false,
"validation": {
"isMandatory": false,
"dateFormat": "MM/DD/YYYY",
"formula": ""
},
"updatedAt": "2023-07-26T17:18:47.162Z",
"createdAt": "2023-07-26T17:18:47.162Z",
"updatedBy": "test@email.com"
},
{
"id": "64c1557be1f95e3214660c12",
"name": "percentage",
"description": "Attribute to capture percentage",
"type": "NUMBER",
"isLocalizable": false,
"target": "PRODUCT",
"validation": {
"isMandatory": false,
"isManualOverwrite": false,
"formula": "",
"isDecimal": true,
"max": 100,
"min": 0
},
"updatedAt": "2023-07-26T17:18:47.162Z",
"createdAt": "2023-07-26T17:18:47.162Z",
"updatedBy": "test@email.com"
},
{
"id": "64c1557be1f95e3214660cdc",
"name": "Weight in pounds",
"description": "Weight of the parcel in pounds",
"type": "NUMBER",
"isLocalizable": false,
"target": "PRODUCT",
"validation": {
"isMandatory": false,
"isManualOverwrite": false,
"formula": "(async ()=> parseFloat(await attribute('64c15579e1f95e3214660cce')) * 2.2)()",
"isDecimal": true
},
"updatedAt": "2023-07-26T17:18:47.162Z",
"createdAt": "2023-07-26T17:18:47.162Z",
"updatedBy": "test@email.com"
},
{
"id": "64c15579e1f95e3214660cce",
"name": "Weight",
"description": "Weight of the parcel",
"type": "NUMBER",
"isLocalizable": false,
"target": "PRODUCT",
"validation": {
"isMandatory": false,
"isManualOverwrite": false,
"formula": "",
"isDecimal": true
},
"updatedAt": "2023-07-26T17:18:47.162Z",
"createdAt": "2023-07-26T17:18:47.162Z",
"updatedBy": "test@email.com"
},
{
"id": "64c1557ae1f95e3214660cd9",
"name": "Age",
"description": "Attribute to capture age",
"type": "NUMBER",
"isLocalizable": false,
"target": "PRODUCT",
"validation": {
"isMandatory": false,
"isManualOverwrite": false,
"formula": "",
"isDecimal": false
},
"updatedAt": "2023-07-26T17:18:47.162Z",
"createdAt": "2023-07-26T17:18:47.162Z",
"updatedBy": "test@email.com"
},
{
"id": "64c15579e1f95e3214660abc",
"name": "MultiOption",
"description": "Color Attribute",
"isLocalizable": false,
"target": "PRODUCT",
"type": "OPTIONS",
"validation": {
"isMandatory": false,
"isManualOverwrite": false,
"subType": "MULTIPLE",
"acceptedValues": [
"Colour",
"Flavour"
]
},
"updatedAt": "2023-07-26T17:18:47.162Z",
"createdAt": "2023-07-26T17:18:47.162Z",
"updatedBy": "test@email.com"
},
{
"id": "64c15579e1f95e3214660cce",
"name": "MultiOption",
"description": "Color Attribute",
"isLocalizable": true,
"target": "PRODUCT",
"type": "OPTIONS",
"validation": {
"isMandatory": false,
"isManualOverwrite": false,
"subType": "MULTIPLE",
"localizedAcceptedValues": {
"en-GB": [
"Colour",
"Flavour"
],
"en-US": [
"Color",
"Flavor"
]
}
},
"localizedProperties": {
"en-GB": {
"name": "Multi-Option"
}
},
"updatedAt": "2023-07-26T17:18:47.162Z",
"createdAt": "2023-07-26T17:18:47.162Z",
"updatedBy": "test@email.com"
},
{
"id": "64c1557ae1f95e3214660dd3",
"name": "Color",
"description": "Color Attribute",
"isLocalizable": true,
"target": "PRODUCT",
"type": "TEXT",
"validation": {
"isMandatory": false,
"subType": "TEXT_AREA",
"formula": "",
"isManualOverwrite": false
},
"localizedProperties": {
"en-GB": {
"name": "Colour"
}
},
"updatedAt": "2023-07-26T17:18:47.162Z",
"createdAt": "2023-07-26T17:18:47.162Z",
"updatedBy": "test@email.com"
},
{
"id": "64c15577e1f95e3214660cbe",
"name": "Small Text example",
"isLocalizable": false,
"target": "PRODUCT",
"type": "TEXT",
"validation": {
"isMandatory": false,
"subType": "SMALL_TEXT",
"isManualOverwrite": false,
"formula": ""
},
"updatedAt": "2023-07-26T17:18:47.162Z",
"createdAt": "2023-07-26T17:18:47.162Z",
"updatedBy": "test@email.com"
}
],
"offset": 0,
"limit": 10,
"count": 10
}{
"message": "Request is invalid",
"type": "Bad request",
"errors": [
{
"type": "CLIENT_ERROR",
"message": "Invalid request. Check your parameters or request body."
}
]
}{
"message": "The requester is unauthorized",
"type": "UNAUTHORIZED_ERROR"
}{
"type": "REQUEST_DENIED",
"message": "User doesn't have the required permission"
}{
"type": "PAYLOAD_LIMIT_EXCEEDED_ERROR",
"message": "Payload exceeds maximum configured size"
}{
"type": "SERVER_ERROR",
"message": "Internal Server Error"
}Find Attributes
Searches for attributes using criteria such as name, creation or modification date, attribute type, and other filters.
curl --request POST \
--url https://api.fabric.inc/v3/product-attributes/search \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"match": {
"id": {
"op": "IN",
"value": [
"blue"
]
},
"name": {
"op": "IN",
"value": [
"blue"
],
"locale": [
"en_US"
]
},
"description": {
"op": "IN",
"value": [
"blue"
]
},
"target": {
"op": "EQUALS",
"value": "PRODUCT"
},
"type": {
"op": "EQUALS",
"value": "TEXT"
},
"subType": {
"op": "EQUALS",
"value": "SINGLE"
},
"createdAt": {
"op": "RANGE",
"fromValue": "2022-04-20T10:24:36.162Z",
"toValue": "2023-04-20T10:24:36.162Z"
},
"updatedAt": {
"op": "RANGE",
"fromValue": "2022-04-20T10:24:36.162Z",
"toValue": "2023-04-20T10:24:36.162Z"
}
},
"sort": "+name,-isMandatory",
"offset": 2,
"limit": 10
}
'import requests
url = "https://api.fabric.inc/v3/product-attributes/search"
payload = {
"match": {
"id": {
"op": "IN",
"value": ["blue"]
},
"name": {
"op": "IN",
"value": ["blue"],
"locale": ["en_US"]
},
"description": {
"op": "IN",
"value": ["blue"]
},
"target": {
"op": "EQUALS",
"value": "PRODUCT"
},
"type": {
"op": "EQUALS",
"value": "TEXT"
},
"subType": {
"op": "EQUALS",
"value": "SINGLE"
},
"createdAt": {
"op": "RANGE",
"fromValue": "2022-04-20T10:24:36.162Z",
"toValue": "2023-04-20T10:24:36.162Z"
},
"updatedAt": {
"op": "RANGE",
"fromValue": "2022-04-20T10:24:36.162Z",
"toValue": "2023-04-20T10:24:36.162Z"
}
},
"sort": "+name,-isMandatory",
"offset": 2,
"limit": 10
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
match: {
id: {op: 'IN', value: ['blue']},
name: {op: 'IN', value: ['blue'], locale: ['en_US']},
description: {op: 'IN', value: ['blue']},
target: {op: 'EQUALS', value: 'PRODUCT'},
type: {op: 'EQUALS', value: 'TEXT'},
subType: {op: 'EQUALS', value: 'SINGLE'},
createdAt: {
op: 'RANGE',
fromValue: '2022-04-20T10:24:36.162Z',
toValue: '2023-04-20T10:24:36.162Z'
},
updatedAt: {
op: 'RANGE',
fromValue: '2022-04-20T10:24:36.162Z',
toValue: '2023-04-20T10:24:36.162Z'
}
},
sort: '+name,-isMandatory',
offset: 2,
limit: 10
})
};
fetch('https://api.fabric.inc/v3/product-attributes/search', 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.fabric.inc/v3/product-attributes/search",
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([
'match' => [
'id' => [
'op' => 'IN',
'value' => [
'blue'
]
],
'name' => [
'op' => 'IN',
'value' => [
'blue'
],
'locale' => [
'en_US'
]
],
'description' => [
'op' => 'IN',
'value' => [
'blue'
]
],
'target' => [
'op' => 'EQUALS',
'value' => 'PRODUCT'
],
'type' => [
'op' => 'EQUALS',
'value' => 'TEXT'
],
'subType' => [
'op' => 'EQUALS',
'value' => 'SINGLE'
],
'createdAt' => [
'op' => 'RANGE',
'fromValue' => '2022-04-20T10:24:36.162Z',
'toValue' => '2023-04-20T10:24:36.162Z'
],
'updatedAt' => [
'op' => 'RANGE',
'fromValue' => '2022-04-20T10:24:36.162Z',
'toValue' => '2023-04-20T10:24:36.162Z'
]
],
'sort' => '+name,-isMandatory',
'offset' => 2,
'limit' => 10
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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://api.fabric.inc/v3/product-attributes/search"
payload := strings.NewReader("{\n \"match\": {\n \"id\": {\n \"op\": \"IN\",\n \"value\": [\n \"blue\"\n ]\n },\n \"name\": {\n \"op\": \"IN\",\n \"value\": [\n \"blue\"\n ],\n \"locale\": [\n \"en_US\"\n ]\n },\n \"description\": {\n \"op\": \"IN\",\n \"value\": [\n \"blue\"\n ]\n },\n \"target\": {\n \"op\": \"EQUALS\",\n \"value\": \"PRODUCT\"\n },\n \"type\": {\n \"op\": \"EQUALS\",\n \"value\": \"TEXT\"\n },\n \"subType\": {\n \"op\": \"EQUALS\",\n \"value\": \"SINGLE\"\n },\n \"createdAt\": {\n \"op\": \"RANGE\",\n \"fromValue\": \"2022-04-20T10:24:36.162Z\",\n \"toValue\": \"2023-04-20T10:24:36.162Z\"\n },\n \"updatedAt\": {\n \"op\": \"RANGE\",\n \"fromValue\": \"2022-04-20T10:24:36.162Z\",\n \"toValue\": \"2023-04-20T10:24:36.162Z\"\n }\n },\n \"sort\": \"+name,-isMandatory\",\n \"offset\": 2,\n \"limit\": 10\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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.fabric.inc/v3/product-attributes/search")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"match\": {\n \"id\": {\n \"op\": \"IN\",\n \"value\": [\n \"blue\"\n ]\n },\n \"name\": {\n \"op\": \"IN\",\n \"value\": [\n \"blue\"\n ],\n \"locale\": [\n \"en_US\"\n ]\n },\n \"description\": {\n \"op\": \"IN\",\n \"value\": [\n \"blue\"\n ]\n },\n \"target\": {\n \"op\": \"EQUALS\",\n \"value\": \"PRODUCT\"\n },\n \"type\": {\n \"op\": \"EQUALS\",\n \"value\": \"TEXT\"\n },\n \"subType\": {\n \"op\": \"EQUALS\",\n \"value\": \"SINGLE\"\n },\n \"createdAt\": {\n \"op\": \"RANGE\",\n \"fromValue\": \"2022-04-20T10:24:36.162Z\",\n \"toValue\": \"2023-04-20T10:24:36.162Z\"\n },\n \"updatedAt\": {\n \"op\": \"RANGE\",\n \"fromValue\": \"2022-04-20T10:24:36.162Z\",\n \"toValue\": \"2023-04-20T10:24:36.162Z\"\n }\n },\n \"sort\": \"+name,-isMandatory\",\n \"offset\": 2,\n \"limit\": 10\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.fabric.inc/v3/product-attributes/search")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"match\": {\n \"id\": {\n \"op\": \"IN\",\n \"value\": [\n \"blue\"\n ]\n },\n \"name\": {\n \"op\": \"IN\",\n \"value\": [\n \"blue\"\n ],\n \"locale\": [\n \"en_US\"\n ]\n },\n \"description\": {\n \"op\": \"IN\",\n \"value\": [\n \"blue\"\n ]\n },\n \"target\": {\n \"op\": \"EQUALS\",\n \"value\": \"PRODUCT\"\n },\n \"type\": {\n \"op\": \"EQUALS\",\n \"value\": \"TEXT\"\n },\n \"subType\": {\n \"op\": \"EQUALS\",\n \"value\": \"SINGLE\"\n },\n \"createdAt\": {\n \"op\": \"RANGE\",\n \"fromValue\": \"2022-04-20T10:24:36.162Z\",\n \"toValue\": \"2023-04-20T10:24:36.162Z\"\n },\n \"updatedAt\": {\n \"op\": \"RANGE\",\n \"fromValue\": \"2022-04-20T10:24:36.162Z\",\n \"toValue\": \"2023-04-20T10:24:36.162Z\"\n }\n },\n \"sort\": \"+name,-isMandatory\",\n \"offset\": 2,\n \"limit\": 10\n}"
response = http.request(request)
puts response.read_body{
"data": [
{
"id": "64c1557de1f95e3214660ceb",
"name": "serialNumber",
"description": "Serial number which starts with the 1 and keeps incrementing 10 for the subsequent call",
"type": "SERIAL",
"target": "PRODUCT",
"isLocalizable": false,
"validation": {
"isMandatory": false,
"isManualOverwrite": false,
"formula": "",
"startWith": 1,
"increment": 10
},
"updatedAt": "2023-07-26T17:18:47.162Z",
"createdAt": "2023-07-26T17:18:47.162Z",
"updatedBy": "test@email.com"
},
{
"id": "64c1557ce1f95e3214660ce6",
"name": "isLive",
"description": "Boolean attribute to capture if the product is live.",
"type": "BOOLEAN",
"target": "PRODUCT",
"isLocalizable": false,
"validation": {
"isMandatory": true
},
"updatedAt": "2023-07-26T17:18:47.162Z",
"createdAt": "2023-07-26T17:18:47.162Z",
"updatedBy": "test@email.com"
},
{
"id": "64c1557be1f95e3214660ce1",
"name": "Date Attribute",
"description": "Attribute to capture date",
"type": "DATETIME",
"target": "PRODUCT",
"isLocalizable": false,
"validation": {
"isMandatory": false,
"dateFormat": "MM/DD/YYYY",
"formula": ""
},
"updatedAt": "2023-07-26T17:18:47.162Z",
"createdAt": "2023-07-26T17:18:47.162Z",
"updatedBy": "test@email.com"
},
{
"id": "64c1557be1f95e3214660c12",
"name": "percentage",
"description": "Attribute to capture percentage",
"type": "NUMBER",
"isLocalizable": false,
"target": "PRODUCT",
"validation": {
"isMandatory": false,
"isManualOverwrite": false,
"formula": "",
"isDecimal": true,
"max": 100,
"min": 0
},
"updatedAt": "2023-07-26T17:18:47.162Z",
"createdAt": "2023-07-26T17:18:47.162Z",
"updatedBy": "test@email.com"
},
{
"id": "64c1557be1f95e3214660cdc",
"name": "Weight in pounds",
"description": "Weight of the parcel in pounds",
"type": "NUMBER",
"isLocalizable": false,
"target": "PRODUCT",
"validation": {
"isMandatory": false,
"isManualOverwrite": false,
"formula": "(async ()=> parseFloat(await attribute('64c15579e1f95e3214660cce')) * 2.2)()",
"isDecimal": true
},
"updatedAt": "2023-07-26T17:18:47.162Z",
"createdAt": "2023-07-26T17:18:47.162Z",
"updatedBy": "test@email.com"
},
{
"id": "64c15579e1f95e3214660cce",
"name": "Weight",
"description": "Weight of the parcel",
"type": "NUMBER",
"isLocalizable": false,
"target": "PRODUCT",
"validation": {
"isMandatory": false,
"isManualOverwrite": false,
"formula": "",
"isDecimal": true
},
"updatedAt": "2023-07-26T17:18:47.162Z",
"createdAt": "2023-07-26T17:18:47.162Z",
"updatedBy": "test@email.com"
},
{
"id": "64c1557ae1f95e3214660cd9",
"name": "Age",
"description": "Attribute to capture age",
"type": "NUMBER",
"isLocalizable": false,
"target": "PRODUCT",
"validation": {
"isMandatory": false,
"isManualOverwrite": false,
"formula": "",
"isDecimal": false
},
"updatedAt": "2023-07-26T17:18:47.162Z",
"createdAt": "2023-07-26T17:18:47.162Z",
"updatedBy": "test@email.com"
},
{
"id": "64c15579e1f95e3214660abc",
"name": "MultiOption",
"description": "Color Attribute",
"isLocalizable": false,
"target": "PRODUCT",
"type": "OPTIONS",
"validation": {
"isMandatory": false,
"isManualOverwrite": false,
"subType": "MULTIPLE",
"acceptedValues": [
"Colour",
"Flavour"
]
},
"updatedAt": "2023-07-26T17:18:47.162Z",
"createdAt": "2023-07-26T17:18:47.162Z",
"updatedBy": "test@email.com"
},
{
"id": "64c15579e1f95e3214660cce",
"name": "MultiOption",
"description": "Color Attribute",
"isLocalizable": true,
"target": "PRODUCT",
"type": "OPTIONS",
"validation": {
"isMandatory": false,
"isManualOverwrite": false,
"subType": "MULTIPLE",
"localizedAcceptedValues": {
"en-GB": [
"Colour",
"Flavour"
],
"en-US": [
"Color",
"Flavor"
]
}
},
"localizedProperties": {
"en-GB": {
"name": "Multi-Option"
}
},
"updatedAt": "2023-07-26T17:18:47.162Z",
"createdAt": "2023-07-26T17:18:47.162Z",
"updatedBy": "test@email.com"
},
{
"id": "64c1557ae1f95e3214660dd3",
"name": "Color",
"description": "Color Attribute",
"isLocalizable": true,
"target": "PRODUCT",
"type": "TEXT",
"validation": {
"isMandatory": false,
"subType": "TEXT_AREA",
"formula": "",
"isManualOverwrite": false
},
"localizedProperties": {
"en-GB": {
"name": "Colour"
}
},
"updatedAt": "2023-07-26T17:18:47.162Z",
"createdAt": "2023-07-26T17:18:47.162Z",
"updatedBy": "test@email.com"
},
{
"id": "64c15577e1f95e3214660cbe",
"name": "Small Text example",
"isLocalizable": false,
"target": "PRODUCT",
"type": "TEXT",
"validation": {
"isMandatory": false,
"subType": "SMALL_TEXT",
"isManualOverwrite": false,
"formula": ""
},
"updatedAt": "2023-07-26T17:18:47.162Z",
"createdAt": "2023-07-26T17:18:47.162Z",
"updatedBy": "test@email.com"
}
],
"offset": 0,
"limit": 10,
"count": 10
}{
"message": "Request is invalid",
"type": "Bad request",
"errors": [
{
"type": "CLIENT_ERROR",
"message": "Invalid request. Check your parameters or request body."
}
]
}{
"message": "The requester is unauthorized",
"type": "UNAUTHORIZED_ERROR"
}{
"type": "REQUEST_DENIED",
"message": "User doesn't have the required permission"
}{
"type": "PAYLOAD_LIMIT_EXCEEDED_ERROR",
"message": "Payload exceeds maximum configured size"
}{
"type": "SERVER_ERROR",
"message": "Internal Server Error"
}Authorizations
S2S access token (JWT) from fabric Identity service (during Login)
Headers
A header used by fabric to identify the tenant making the request. You must include tenant id in the authentication header for an API request to access any of fabric’s endpoints. You can retrieve the tenant id , which is also called account id, from Copilot. This header is required.
"517fa9dfd42d8b00g1o3k312"
Unique request ID
"263e731c-45c8-11ed-b878-0242ac120002"
Body
Request body for attribute search
Specification for matching attributes
Show child attributes
Show child attributes
Criteria to sort response. Sorting is supported only on createdAt, updatedAt, type, name and isMandatory. - refers to descending while + refers to ascending order
"+name,-isMandatory"
Number of records to skip before returning records. For example, offset=20, limit=10 returns records 21-30.
2
Maximum number of records per page
When no value is specified, default is 10.
10
Response
OK
Attribute details
Show child attributes
Show child attributes
Number of records to skip before returning records. For example, offset=20, limit=10 returns records 21-30.
5
Maximum number of records per page
10
Total number of records
100
Was this page helpful?
