affiliate-discovery
Create Affiliate Discovery Criteria Set
POST
/
v1
/
discovery
/
products
/
criteria-sets
Create Affiliate Discovery Criteria Set
curl --request POST \
--url https://api.example.com/v1/discovery/products/criteria-sets \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"id": "<string>",
"name": "<string>",
"query": "<string>",
"exclude_query": "<string>",
"criteria": [
{
"field": "any",
"operator": "not_like",
"value": "trail hiking"
}
]
}
'import requests
url = "https://api.example.com/v1/discovery/products/criteria-sets"
payload = {
"id": "<string>",
"name": "<string>",
"query": "<string>",
"exclude_query": "<string>",
"criteria": [
{
"field": "any",
"operator": "not_like",
"value": "trail hiking"
}
]
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
id: '<string>',
name: '<string>',
query: '<string>',
exclude_query: '<string>',
criteria: [{field: 'any', operator: 'not_like', value: 'trail hiking'}]
})
};
fetch('https://api.example.com/v1/discovery/products/criteria-sets', 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/discovery/products/criteria-sets",
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([
'id' => '<string>',
'name' => '<string>',
'query' => '<string>',
'exclude_query' => '<string>',
'criteria' => [
[
'field' => 'any',
'operator' => 'not_like',
'value' => 'trail hiking'
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-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/discovery/products/criteria-sets"
payload := strings.NewReader("{\n \"id\": \"<string>\",\n \"name\": \"<string>\",\n \"query\": \"<string>\",\n \"exclude_query\": \"<string>\",\n \"criteria\": [\n {\n \"field\": \"any\",\n \"operator\": \"not_like\",\n \"value\": \"trail hiking\"\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<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://api.example.com/v1/discovery/products/criteria-sets")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"id\": \"<string>\",\n \"name\": \"<string>\",\n \"query\": \"<string>\",\n \"exclude_query\": \"<string>\",\n \"criteria\": [\n {\n \"field\": \"any\",\n \"operator\": \"not_like\",\n \"value\": \"trail hiking\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/v1/discovery/products/criteria-sets")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"id\": \"<string>\",\n \"name\": \"<string>\",\n \"query\": \"<string>\",\n \"exclude_query\": \"<string>\",\n \"criteria\": [\n {\n \"field\": \"any\",\n \"operator\": \"not_like\",\n \"value\": \"trail hiking\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"name": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"query": "<string>",
"exclude_query": "<string>",
"criteria": [
{
"field": "any",
"operator": "not_like",
"value": "trail hiking"
}
],
"type": "affiliate_discovery_criteria_set"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Authorizations
Body
application/json
Pattern:
^[A-Za-z0-9][A-Za-z0-9_.-]{0,127}$Required string length:
1 - 200Minimum string length:
1Minimum string length:
1criteria
(AnyCriterion · object | NameDescriptionBrandCriterion · object | BrandCriterion · object | CategoryCriterion · object | ColorCriterion · object | ConditionCriterion · object | CountryCriterion · object | GenderCriterion · object | GenreCriterion · object | ManufacturerCriterion · object | MaterialCriterion · object | ModelCriterion · object | PublisherCriterion · object | SizeCriterion · object | SubtitleCriterion · object | TagsCriterion · object | CurrencyCriterion · object | OnSaleCriterion · object | SaleDiscountCriterion · object | RegularPriceCriterion · object | FinalPriceCriterion · object | SalePriceCriterion · object | ShipPriceCriterion · object | IdCriterion · object | BarcodeCriterion · object | SkuCriterion · object | MpnCriterion · object | AsinCriterion · object | MerchantIdCriterion · object | MerchantNameCriterion · object | SellerPartyCriterion · object | MerchantCategoryIdsCriterion · object | InStockCriterion · object | StockQuantityCriterion · object | AvailabilityCriterion · object)[]
- AnyCriterion
- NameDescriptionBrandCriterion
- BrandCriterion
- CategoryCriterion
- ColorCriterion
- ConditionCriterion
- CountryCriterion
- GenderCriterion
- GenreCriterion
- ManufacturerCriterion
- MaterialCriterion
- ModelCriterion
- PublisherCriterion
- SizeCriterion
- SubtitleCriterion
- TagsCriterion
- CurrencyCriterion
- OnSaleCriterion
- SaleDiscountCriterion
- RegularPriceCriterion
- FinalPriceCriterion
- SalePriceCriterion
- ShipPriceCriterion
- IdCriterion
- BarcodeCriterion
- SkuCriterion
- MpnCriterion
- AsinCriterion
- MerchantIdCriterion
- MerchantNameCriterion
- SellerPartyCriterion
- MerchantCategoryIdsCriterion
- InStockCriterion
- StockQuantityCriterion
- AvailabilityCriterion
Show child attributes
Show child attributes
Example:
{
"field": "any",
"operator": "not_like",
"value": "trail hiking"
}
Response
Successful Response
Pattern:
^[A-Za-z0-9][A-Za-z0-9_.-]{0,127}$Required string length:
1 - 200Minimum string length:
1Minimum string length:
1criteria
(AnyCriterion · object | NameDescriptionBrandCriterion · object | BrandCriterion · object | CategoryCriterion · object | ColorCriterion · object | ConditionCriterion · object | CountryCriterion · object | GenderCriterion · object | GenreCriterion · object | ManufacturerCriterion · object | MaterialCriterion · object | ModelCriterion · object | PublisherCriterion · object | SizeCriterion · object | SubtitleCriterion · object | TagsCriterion · object | CurrencyCriterion · object | OnSaleCriterion · object | SaleDiscountCriterion · object | RegularPriceCriterion · object | FinalPriceCriterion · object | SalePriceCriterion · object | ShipPriceCriterion · object | IdCriterion · object | BarcodeCriterion · object | SkuCriterion · object | MpnCriterion · object | AsinCriterion · object | MerchantIdCriterion · object | MerchantNameCriterion · object | SellerPartyCriterion · object | MerchantCategoryIdsCriterion · object | InStockCriterion · object | StockQuantityCriterion · object | AvailabilityCriterion · object)[]
- AnyCriterion
- NameDescriptionBrandCriterion
- BrandCriterion
- CategoryCriterion
- ColorCriterion
- ConditionCriterion
- CountryCriterion
- GenderCriterion
- GenreCriterion
- ManufacturerCriterion
- MaterialCriterion
- ModelCriterion
- PublisherCriterion
- SizeCriterion
- SubtitleCriterion
- TagsCriterion
- CurrencyCriterion
- OnSaleCriterion
- SaleDiscountCriterion
- RegularPriceCriterion
- FinalPriceCriterion
- SalePriceCriterion
- ShipPriceCriterion
- IdCriterion
- BarcodeCriterion
- SkuCriterion
- MpnCriterion
- AsinCriterion
- MerchantIdCriterion
- MerchantNameCriterion
- SellerPartyCriterion
- MerchantCategoryIdsCriterion
- InStockCriterion
- StockQuantityCriterion
- AvailabilityCriterion
Show child attributes
Show child attributes
Example:
{
"field": "any",
"operator": "not_like",
"value": "trail hiking"
}
Allowed value:
"affiliate_discovery_criteria_set"⌘I
Create Affiliate Discovery Criteria Set
curl --request POST \
--url https://api.example.com/v1/discovery/products/criteria-sets \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"id": "<string>",
"name": "<string>",
"query": "<string>",
"exclude_query": "<string>",
"criteria": [
{
"field": "any",
"operator": "not_like",
"value": "trail hiking"
}
]
}
'import requests
url = "https://api.example.com/v1/discovery/products/criteria-sets"
payload = {
"id": "<string>",
"name": "<string>",
"query": "<string>",
"exclude_query": "<string>",
"criteria": [
{
"field": "any",
"operator": "not_like",
"value": "trail hiking"
}
]
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
id: '<string>',
name: '<string>',
query: '<string>',
exclude_query: '<string>',
criteria: [{field: 'any', operator: 'not_like', value: 'trail hiking'}]
})
};
fetch('https://api.example.com/v1/discovery/products/criteria-sets', 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/discovery/products/criteria-sets",
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([
'id' => '<string>',
'name' => '<string>',
'query' => '<string>',
'exclude_query' => '<string>',
'criteria' => [
[
'field' => 'any',
'operator' => 'not_like',
'value' => 'trail hiking'
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-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/discovery/products/criteria-sets"
payload := strings.NewReader("{\n \"id\": \"<string>\",\n \"name\": \"<string>\",\n \"query\": \"<string>\",\n \"exclude_query\": \"<string>\",\n \"criteria\": [\n {\n \"field\": \"any\",\n \"operator\": \"not_like\",\n \"value\": \"trail hiking\"\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<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://api.example.com/v1/discovery/products/criteria-sets")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"id\": \"<string>\",\n \"name\": \"<string>\",\n \"query\": \"<string>\",\n \"exclude_query\": \"<string>\",\n \"criteria\": [\n {\n \"field\": \"any\",\n \"operator\": \"not_like\",\n \"value\": \"trail hiking\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/v1/discovery/products/criteria-sets")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"id\": \"<string>\",\n \"name\": \"<string>\",\n \"query\": \"<string>\",\n \"exclude_query\": \"<string>\",\n \"criteria\": [\n {\n \"field\": \"any\",\n \"operator\": \"not_like\",\n \"value\": \"trail hiking\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"name": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"query": "<string>",
"exclude_query": "<string>",
"criteria": [
{
"field": "any",
"operator": "not_like",
"value": "trail hiking"
}
],
"type": "affiliate_discovery_criteria_set"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}