Create custom audience
Name
Type
Required
Description
Query Parameters
Name
Type
Description
Headers
Name
Type
Description
{
"id": "23851054958460684"
}Last updated
{
"id": "23851054958460684"
}Last updated
"rule" :
{
"inclusions": {
"operator": "or",
"rules": [
{
"event_sources": [
{
"id": "814765166375068",
"type": "pixel"
}
],
"retention_seconds": 8400,
"filter": {
"operator": "and",
"filters": [
{
"field": "url",
"operator": "i_contains",
"value": "shoes"
}
]
}
}
]
}
}curl --location --request POST 'https://us-central1-appgregator.cloudfunctions.net/facebook/custom-audience?name=ft-4&connection_name=fbads-01&adaccount_id=act_1217648562383717' \
--header 'x-api-key: U2Fsd...' \
--header 'Content-Type: application/json' \
--data-raw '{
"name" : "My new CA",
"subtype" : "CUSTOM",
"description" : "People who bought from my website",
"customer_file_source" : "USER_PROVIDED_ONLY"
}'var axios = require('axios');
var data = JSON.stringify({
"name": "My new CA",
"subtype": "CUSTOM",
"description": "People who bought from my website",
"customer_file_source": "USER_PROVIDED_ONLY"
});
var config = {
method: 'post',
url: 'https://us-central1-appgregator.cloudfunctions.net/facebook/custom-audience?name=ft-4&connection_name=fbads-01&adaccount_id=act_1217648562383717',
headers: {
'x-api-key': 'U2Fsd...',
'Content-Type': 'application/json'
},
data : data
};
axios(config)
.then(function (response) {
console.log(JSON.stringify(response.data));
})
.catch(function (error) {
console.log(error);
});
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://us-central1-appgregator.cloudfunctions.net/facebook/custom-audience?name=ft-4&connection_name=fbads-01&adaccount_id=act_1217648562383717',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_POSTFIELDS =>'{
"name" : "My new CA",
"subtype" : "CUSTOM",
"description" : "People who bought from my website",
"customer_file_source" : "USER_PROVIDED_ONLY"
}',
CURLOPT_HTTPHEADER => array(
'x-api-key: U2Fsd...',
'Content-Type: application/json'
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;