Search Jobs
curl --request POST \
--url https://api.fabric.inc/v3/product-jobs/search \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"match": {
"name": {
"op": "IN",
"value": [
"blue"
]
},
"keyword": {
"op": "CONTAINS",
"value": "blue"
},
"createdAt": {
"op": "RANGE",
"fromValue": "2022-04-20T10:24:36.162Z",
"toValue": "2023-04-20T10:24:36.162Z"
},
"completedAt": {
"op": "RANGE",
"fromValue": "2022-04-20T10:24:36.162Z",
"toValue": "2023-04-20T10:24:36.162Z"
}
},
"sort": "+id,-type",
"offset": 2,
"limit": 10
}
'import requests
url = "https://api.fabric.inc/v3/product-jobs/search"
payload = {
"match": {
"name": {
"op": "IN",
"value": ["blue"]
},
"keyword": {
"op": "CONTAINS",
"value": "blue"
},
"createdAt": {
"op": "RANGE",
"fromValue": "2022-04-20T10:24:36.162Z",
"toValue": "2023-04-20T10:24:36.162Z"
},
"completedAt": {
"op": "RANGE",
"fromValue": "2022-04-20T10:24:36.162Z",
"toValue": "2023-04-20T10:24:36.162Z"
}
},
"sort": "+id,-type",
"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: {
name: {op: 'IN', value: ['blue']},
keyword: {op: 'CONTAINS', value: 'blue'},
createdAt: {
op: 'RANGE',
fromValue: '2022-04-20T10:24:36.162Z',
toValue: '2023-04-20T10:24:36.162Z'
},
completedAt: {
op: 'RANGE',
fromValue: '2022-04-20T10:24:36.162Z',
toValue: '2023-04-20T10:24:36.162Z'
}
},
sort: '+id,-type',
offset: 2,
limit: 10
})
};
fetch('https://api.fabric.inc/v3/product-jobs/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-jobs/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' => [
'name' => [
'op' => 'IN',
'value' => [
'blue'
]
],
'keyword' => [
'op' => 'CONTAINS',
'value' => 'blue'
],
'createdAt' => [
'op' => 'RANGE',
'fromValue' => '2022-04-20T10:24:36.162Z',
'toValue' => '2023-04-20T10:24:36.162Z'
],
'completedAt' => [
'op' => 'RANGE',
'fromValue' => '2022-04-20T10:24:36.162Z',
'toValue' => '2023-04-20T10:24:36.162Z'
]
],
'sort' => '+id,-type',
'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-jobs/search"
payload := strings.NewReader("{\n \"match\": {\n \"name\": {\n \"op\": \"IN\",\n \"value\": [\n \"blue\"\n ]\n },\n \"keyword\": {\n \"op\": \"CONTAINS\",\n \"value\": \"blue\"\n },\n \"createdAt\": {\n \"op\": \"RANGE\",\n \"fromValue\": \"2022-04-20T10:24:36.162Z\",\n \"toValue\": \"2023-04-20T10:24:36.162Z\"\n },\n \"completedAt\": {\n \"op\": \"RANGE\",\n \"fromValue\": \"2022-04-20T10:24:36.162Z\",\n \"toValue\": \"2023-04-20T10:24:36.162Z\"\n }\n },\n \"sort\": \"+id,-type\",\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-jobs/search")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"match\": {\n \"name\": {\n \"op\": \"IN\",\n \"value\": [\n \"blue\"\n ]\n },\n \"keyword\": {\n \"op\": \"CONTAINS\",\n \"value\": \"blue\"\n },\n \"createdAt\": {\n \"op\": \"RANGE\",\n \"fromValue\": \"2022-04-20T10:24:36.162Z\",\n \"toValue\": \"2023-04-20T10:24:36.162Z\"\n },\n \"completedAt\": {\n \"op\": \"RANGE\",\n \"fromValue\": \"2022-04-20T10:24:36.162Z\",\n \"toValue\": \"2023-04-20T10:24:36.162Z\"\n }\n },\n \"sort\": \"+id,-type\",\n \"offset\": 2,\n \"limit\": 10\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.fabric.inc/v3/product-jobs/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 \"name\": {\n \"op\": \"IN\",\n \"value\": [\n \"blue\"\n ]\n },\n \"keyword\": {\n \"op\": \"CONTAINS\",\n \"value\": \"blue\"\n },\n \"createdAt\": {\n \"op\": \"RANGE\",\n \"fromValue\": \"2022-04-20T10:24:36.162Z\",\n \"toValue\": \"2023-04-20T10:24:36.162Z\"\n },\n \"completedAt\": {\n \"op\": \"RANGE\",\n \"fromValue\": \"2022-04-20T10:24:36.162Z\",\n \"toValue\": \"2023-04-20T10:24:36.162Z\"\n }\n },\n \"sort\": \"+id,-type\",\n \"offset\": 2,\n \"limit\": 10\n}"
response = http.request(request)
puts response.read_body{
"data": [
{
"id": "877f1f77bcf86cd799439087",
"type": "ITEM_VARIANT_EXPORT",
"inputFileId": "327f1f77bcf86cd799439045",
"outputFiles": [
"507f1f77bcf86cd7994390163, 967f1f77bcf86cd799439058"
],
"errorFiles": [
"887f1f77bcf86cd799439011, 997f1f77bcf86cd799439074"
],
"progressTracker": {
"updatedAt": "2023-02-14T22:10:30.618Z",
"totalCount": 100000,
"processedCount": 40000,
"errorCount": 10
},
"status": "COMPLETED",
"statusMessage": "100% completed",
"additionalDetails": {
"itemsCreated": 10,
"itemsUpdated": 10,
"variantsCreated": 10,
"variantsUpdated": 10,
"bundlesCreated": 10,
"bundlesUpdated": 10,
"attributeCreated": 10,
"attributeUpdated": 10,
"categoriesCreated": 10,
"categoriesUpdated": 10,
"collectionCreated": 5,
"collectionUpdated": 10
},
"createdAt": "2021-09-14T22:10:30.618Z",
"completedAt": "2021-09-14T22:10:30.618Z",
"updatedBy": "test@email.com",
"updatedAt": "2021-09-14T22:10:30.618Z"
}
],
"offset": 5,
"limit": 10,
"count": 100
}{
"message": "Request is invalid",
"type": "Bad request",
"errors": [
{
"type": "CLIENT_ERROR",
"message": "Invalid request. Unable to find/create product"
}
]
}{
"type": "UNAUTHORIZED_ERROR",
"message": "Requester is unauthorized"
}{
"type": "REQUEST_DENIED",
"message": "User doesn't have the required permission"
}{
"type": "SERVER_ERROR",
"message": "Internal Server Error"
}Get List of Jobs
Search Jobs
Get a paginated list of jobs related to products and collections by specifying the request body. You need to specify the criteria for the search such as job id, type, status, collectionId, inputFileId.
POST
/
product-jobs
/
search
Search Jobs
curl --request POST \
--url https://api.fabric.inc/v3/product-jobs/search \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"match": {
"name": {
"op": "IN",
"value": [
"blue"
]
},
"keyword": {
"op": "CONTAINS",
"value": "blue"
},
"createdAt": {
"op": "RANGE",
"fromValue": "2022-04-20T10:24:36.162Z",
"toValue": "2023-04-20T10:24:36.162Z"
},
"completedAt": {
"op": "RANGE",
"fromValue": "2022-04-20T10:24:36.162Z",
"toValue": "2023-04-20T10:24:36.162Z"
}
},
"sort": "+id,-type",
"offset": 2,
"limit": 10
}
'import requests
url = "https://api.fabric.inc/v3/product-jobs/search"
payload = {
"match": {
"name": {
"op": "IN",
"value": ["blue"]
},
"keyword": {
"op": "CONTAINS",
"value": "blue"
},
"createdAt": {
"op": "RANGE",
"fromValue": "2022-04-20T10:24:36.162Z",
"toValue": "2023-04-20T10:24:36.162Z"
},
"completedAt": {
"op": "RANGE",
"fromValue": "2022-04-20T10:24:36.162Z",
"toValue": "2023-04-20T10:24:36.162Z"
}
},
"sort": "+id,-type",
"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: {
name: {op: 'IN', value: ['blue']},
keyword: {op: 'CONTAINS', value: 'blue'},
createdAt: {
op: 'RANGE',
fromValue: '2022-04-20T10:24:36.162Z',
toValue: '2023-04-20T10:24:36.162Z'
},
completedAt: {
op: 'RANGE',
fromValue: '2022-04-20T10:24:36.162Z',
toValue: '2023-04-20T10:24:36.162Z'
}
},
sort: '+id,-type',
offset: 2,
limit: 10
})
};
fetch('https://api.fabric.inc/v3/product-jobs/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-jobs/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' => [
'name' => [
'op' => 'IN',
'value' => [
'blue'
]
],
'keyword' => [
'op' => 'CONTAINS',
'value' => 'blue'
],
'createdAt' => [
'op' => 'RANGE',
'fromValue' => '2022-04-20T10:24:36.162Z',
'toValue' => '2023-04-20T10:24:36.162Z'
],
'completedAt' => [
'op' => 'RANGE',
'fromValue' => '2022-04-20T10:24:36.162Z',
'toValue' => '2023-04-20T10:24:36.162Z'
]
],
'sort' => '+id,-type',
'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-jobs/search"
payload := strings.NewReader("{\n \"match\": {\n \"name\": {\n \"op\": \"IN\",\n \"value\": [\n \"blue\"\n ]\n },\n \"keyword\": {\n \"op\": \"CONTAINS\",\n \"value\": \"blue\"\n },\n \"createdAt\": {\n \"op\": \"RANGE\",\n \"fromValue\": \"2022-04-20T10:24:36.162Z\",\n \"toValue\": \"2023-04-20T10:24:36.162Z\"\n },\n \"completedAt\": {\n \"op\": \"RANGE\",\n \"fromValue\": \"2022-04-20T10:24:36.162Z\",\n \"toValue\": \"2023-04-20T10:24:36.162Z\"\n }\n },\n \"sort\": \"+id,-type\",\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-jobs/search")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"match\": {\n \"name\": {\n \"op\": \"IN\",\n \"value\": [\n \"blue\"\n ]\n },\n \"keyword\": {\n \"op\": \"CONTAINS\",\n \"value\": \"blue\"\n },\n \"createdAt\": {\n \"op\": \"RANGE\",\n \"fromValue\": \"2022-04-20T10:24:36.162Z\",\n \"toValue\": \"2023-04-20T10:24:36.162Z\"\n },\n \"completedAt\": {\n \"op\": \"RANGE\",\n \"fromValue\": \"2022-04-20T10:24:36.162Z\",\n \"toValue\": \"2023-04-20T10:24:36.162Z\"\n }\n },\n \"sort\": \"+id,-type\",\n \"offset\": 2,\n \"limit\": 10\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.fabric.inc/v3/product-jobs/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 \"name\": {\n \"op\": \"IN\",\n \"value\": [\n \"blue\"\n ]\n },\n \"keyword\": {\n \"op\": \"CONTAINS\",\n \"value\": \"blue\"\n },\n \"createdAt\": {\n \"op\": \"RANGE\",\n \"fromValue\": \"2022-04-20T10:24:36.162Z\",\n \"toValue\": \"2023-04-20T10:24:36.162Z\"\n },\n \"completedAt\": {\n \"op\": \"RANGE\",\n \"fromValue\": \"2022-04-20T10:24:36.162Z\",\n \"toValue\": \"2023-04-20T10:24:36.162Z\"\n }\n },\n \"sort\": \"+id,-type\",\n \"offset\": 2,\n \"limit\": 10\n}"
response = http.request(request)
puts response.read_body{
"data": [
{
"id": "877f1f77bcf86cd799439087",
"type": "ITEM_VARIANT_EXPORT",
"inputFileId": "327f1f77bcf86cd799439045",
"outputFiles": [
"507f1f77bcf86cd7994390163, 967f1f77bcf86cd799439058"
],
"errorFiles": [
"887f1f77bcf86cd799439011, 997f1f77bcf86cd799439074"
],
"progressTracker": {
"updatedAt": "2023-02-14T22:10:30.618Z",
"totalCount": 100000,
"processedCount": 40000,
"errorCount": 10
},
"status": "COMPLETED",
"statusMessage": "100% completed",
"additionalDetails": {
"itemsCreated": 10,
"itemsUpdated": 10,
"variantsCreated": 10,
"variantsUpdated": 10,
"bundlesCreated": 10,
"bundlesUpdated": 10,
"attributeCreated": 10,
"attributeUpdated": 10,
"categoriesCreated": 10,
"categoriesUpdated": 10,
"collectionCreated": 5,
"collectionUpdated": 10
},
"createdAt": "2021-09-14T22:10:30.618Z",
"completedAt": "2021-09-14T22:10:30.618Z",
"updatedBy": "test@email.com",
"updatedAt": "2021-09-14T22:10:30.618Z"
}
],
"offset": 5,
"limit": 10,
"count": 100
}{
"message": "Request is invalid",
"type": "Bad request",
"errors": [
{
"type": "CLIENT_ERROR",
"message": "Invalid request. Unable to find/create product"
}
]
}{
"type": "UNAUTHORIZED_ERROR",
"message": "Requester is unauthorized"
}{
"type": "REQUEST_DENIED",
"message": "User doesn't have the required permission"
}{
"type": "SERVER_ERROR",
"message": "Internal Server Error"
}Authorizations
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.
Example:
"517fa9dfd42d8b00g1o3k312"
Body
application/json
Request for a job search.
Response
OK
Details of jobs
Was this page helpful?
