/experimental/marketing-solutions/audiences/recommend-segments
curl --request POST \
--url https://api.criteo.com/experimental/marketing-solutions/audiences/recommend-segments \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"data": {
"attributes": {
"brief": "<string>",
"advertiserId": "<string>",
"nbSegments": 5,
"segmentStatusToRecommend": "new",
"segmentTypesToRecommend": []
},
"type": "RecommendSegmentsRequest"
}
}
'import requests
url = "https://api.criteo.com/experimental/marketing-solutions/audiences/recommend-segments"
payload = { "data": {
"attributes": {
"brief": "<string>",
"advertiserId": "<string>",
"nbSegments": 5,
"segmentStatusToRecommend": "new",
"segmentTypesToRecommend": []
},
"type": "RecommendSegmentsRequest"
} }
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({
data: {
attributes: {
brief: '<string>',
advertiserId: '<string>',
nbSegments: 5,
segmentStatusToRecommend: 'new',
segmentTypesToRecommend: []
},
type: 'RecommendSegmentsRequest'
}
})
};
fetch('https://api.criteo.com/experimental/marketing-solutions/audiences/recommend-segments', 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.criteo.com/experimental/marketing-solutions/audiences/recommend-segments",
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([
'data' => [
'attributes' => [
'brief' => '<string>',
'advertiserId' => '<string>',
'nbSegments' => 5,
'segmentStatusToRecommend' => 'new',
'segmentTypesToRecommend' => [
]
],
'type' => 'RecommendSegmentsRequest'
]
]),
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.criteo.com/experimental/marketing-solutions/audiences/recommend-segments"
payload := strings.NewReader("{\n \"data\": {\n \"attributes\": {\n \"brief\": \"<string>\",\n \"advertiserId\": \"<string>\",\n \"nbSegments\": 5,\n \"segmentStatusToRecommend\": \"new\",\n \"segmentTypesToRecommend\": []\n },\n \"type\": \"RecommendSegmentsRequest\"\n }\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.criteo.com/experimental/marketing-solutions/audiences/recommend-segments")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"data\": {\n \"attributes\": {\n \"brief\": \"<string>\",\n \"advertiserId\": \"<string>\",\n \"nbSegments\": 5,\n \"segmentStatusToRecommend\": \"new\",\n \"segmentTypesToRecommend\": []\n },\n \"type\": \"RecommendSegmentsRequest\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.criteo.com/experimental/marketing-solutions/audiences/recommend-segments")
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 \"data\": {\n \"attributes\": {\n \"brief\": \"<string>\",\n \"advertiserId\": \"<string>\",\n \"nbSegments\": 5,\n \"segmentStatusToRecommend\": \"new\",\n \"segmentTypesToRecommend\": []\n },\n \"type\": \"RecommendSegmentsRequest\"\n }\n}"
response = http.request(request)
puts response.read_body{
"data": [
{
"attributes": {
"alreadyCreated": true,
"description": "<string>",
"segmentType": "affinity",
"advertiserId": "<string>",
"affinityConfiguration": {
"country": "<string>",
"customCategoryIds": [
"<string>"
],
"customCategoryNames": [
"<string>"
],
"lookbackDays": 123,
"numberOfEvents": 123,
"targetingCategoryIds": [
"<string>"
],
"targetingCategoryNames": [
"<string>"
]
},
"behavioralConfiguration": {
"category": "seasonal",
"country": "<string>",
"endDate": "<string>",
"startDate": "<string>"
},
"dataProviderId": "<string>",
"inMarketConfiguration": {
"brandDesc": [
"<string>"
],
"brandIds": [
"<string>"
],
"brandNames": [
"<string>"
],
"buyingPower": [
"<string>"
],
"country": "<string>",
"interestIds": [
"<string>"
],
"interestNames": [
"<string>"
],
"priceRange": [
"<string>"
],
"gender": "<string>"
},
"locationConfiguration": {
"geoDivisions": [
{}
],
"pointsOfInterest": [
{}
],
"radiusInKm": 123,
"registryType": "<string>",
"partnerId": "<string>",
"userGroupId": "<string>"
},
"lookalikeConfiguration": {
"country": "<string>",
"seedSegmentId": "<string>",
"targetSize": 123
},
"segmentId": "<string>",
"segmentName": "<string>",
"size": 123
},
"type": "SegmentRecommendation"
}
],
"errors": [
{
"detail": "<string>",
"title": "<string>"
}
],
"warnings": [
{
"detail": "<string>",
"title": "<string>"
}
]
}/experimental/marketing-solutions/audiences/recommend-segments
Recommend audience segments for MarketingSolutions from a freeform brief.
POST
/
experimental
/
marketing-solutions
/
audiences
/
recommend-segments
/experimental/marketing-solutions/audiences/recommend-segments
curl --request POST \
--url https://api.criteo.com/experimental/marketing-solutions/audiences/recommend-segments \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"data": {
"attributes": {
"brief": "<string>",
"advertiserId": "<string>",
"nbSegments": 5,
"segmentStatusToRecommend": "new",
"segmentTypesToRecommend": []
},
"type": "RecommendSegmentsRequest"
}
}
'import requests
url = "https://api.criteo.com/experimental/marketing-solutions/audiences/recommend-segments"
payload = { "data": {
"attributes": {
"brief": "<string>",
"advertiserId": "<string>",
"nbSegments": 5,
"segmentStatusToRecommend": "new",
"segmentTypesToRecommend": []
},
"type": "RecommendSegmentsRequest"
} }
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({
data: {
attributes: {
brief: '<string>',
advertiserId: '<string>',
nbSegments: 5,
segmentStatusToRecommend: 'new',
segmentTypesToRecommend: []
},
type: 'RecommendSegmentsRequest'
}
})
};
fetch('https://api.criteo.com/experimental/marketing-solutions/audiences/recommend-segments', 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.criteo.com/experimental/marketing-solutions/audiences/recommend-segments",
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([
'data' => [
'attributes' => [
'brief' => '<string>',
'advertiserId' => '<string>',
'nbSegments' => 5,
'segmentStatusToRecommend' => 'new',
'segmentTypesToRecommend' => [
]
],
'type' => 'RecommendSegmentsRequest'
]
]),
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.criteo.com/experimental/marketing-solutions/audiences/recommend-segments"
payload := strings.NewReader("{\n \"data\": {\n \"attributes\": {\n \"brief\": \"<string>\",\n \"advertiserId\": \"<string>\",\n \"nbSegments\": 5,\n \"segmentStatusToRecommend\": \"new\",\n \"segmentTypesToRecommend\": []\n },\n \"type\": \"RecommendSegmentsRequest\"\n }\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.criteo.com/experimental/marketing-solutions/audiences/recommend-segments")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"data\": {\n \"attributes\": {\n \"brief\": \"<string>\",\n \"advertiserId\": \"<string>\",\n \"nbSegments\": 5,\n \"segmentStatusToRecommend\": \"new\",\n \"segmentTypesToRecommend\": []\n },\n \"type\": \"RecommendSegmentsRequest\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.criteo.com/experimental/marketing-solutions/audiences/recommend-segments")
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 \"data\": {\n \"attributes\": {\n \"brief\": \"<string>\",\n \"advertiserId\": \"<string>\",\n \"nbSegments\": 5,\n \"segmentStatusToRecommend\": \"new\",\n \"segmentTypesToRecommend\": []\n },\n \"type\": \"RecommendSegmentsRequest\"\n }\n}"
response = http.request(request)
puts response.read_body{
"data": [
{
"attributes": {
"alreadyCreated": true,
"description": "<string>",
"segmentType": "affinity",
"advertiserId": "<string>",
"affinityConfiguration": {
"country": "<string>",
"customCategoryIds": [
"<string>"
],
"customCategoryNames": [
"<string>"
],
"lookbackDays": 123,
"numberOfEvents": 123,
"targetingCategoryIds": [
"<string>"
],
"targetingCategoryNames": [
"<string>"
]
},
"behavioralConfiguration": {
"category": "seasonal",
"country": "<string>",
"endDate": "<string>",
"startDate": "<string>"
},
"dataProviderId": "<string>",
"inMarketConfiguration": {
"brandDesc": [
"<string>"
],
"brandIds": [
"<string>"
],
"brandNames": [
"<string>"
],
"buyingPower": [
"<string>"
],
"country": "<string>",
"interestIds": [
"<string>"
],
"interestNames": [
"<string>"
],
"priceRange": [
"<string>"
],
"gender": "<string>"
},
"locationConfiguration": {
"geoDivisions": [
{}
],
"pointsOfInterest": [
{}
],
"radiusInKm": 123,
"registryType": "<string>",
"partnerId": "<string>",
"userGroupId": "<string>"
},
"lookalikeConfiguration": {
"country": "<string>",
"seedSegmentId": "<string>",
"targetSize": 123
},
"segmentId": "<string>",
"segmentName": "<string>",
"size": 123
},
"type": "SegmentRecommendation"
}
],
"errors": [
{
"detail": "<string>",
"title": "<string>"
}
],
"warnings": [
{
"detail": "<string>",
"title": "<string>"
}
]
}Authorizations
The access token received from the authorization server in the OAuth 2.0 flow.
Body
application/json
Request to recommend audience segments from a freeform brief.
The request attributes wrapped in a JSON:API-style data object.
Show child attributes
Show child attributes
Was this page helpful?