curl --request POST \
--url https://api.extole.io/v1/components/{component_id}/settings/component-reference-list/{setting_name}/add \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"component_ids": [
"component_id"
],
"variant": "variant"
}
'import requests
url = "https://api.extole.io/v1/components/{component_id}/settings/component-reference-list/{setting_name}/add"
payload = {
"component_ids": ["component_id"],
"variant": "variant"
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({component_ids: ['component_id'], variant: 'variant'})
};
fetch('https://api.extole.io/v1/components/{component_id}/settings/component-reference-list/{setting_name}/add', 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.extole.io/v1/components/{component_id}/settings/component-reference-list/{setting_name}/add",
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([
'component_ids' => [
'component_id'
],
'variant' => 'variant'
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"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.extole.io/v1/components/{component_id}/settings/component-reference-list/{setting_name}/add"
payload := strings.NewReader("{\n \"component_ids\": [\n \"component_id\"\n ],\n \"variant\": \"variant\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<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.extole.io/v1/components/{component_id}/settings/component-reference-list/{setting_name}/add")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"component_ids\": [\n \"component_id\"\n ],\n \"variant\": \"variant\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.extole.io/v1/components/{component_id}/settings/component-reference-list/{setting_name}/add")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"component_ids\": [\n \"component_id\"\n ],\n \"variant\": \"variant\"\n}"
response = http.request(request)
puts response.read_body{
"description": "<string>",
"display_name": "<string>",
"name": "<string>",
"priority": "10",
"tags": [
"<string>"
],
"type": "COMPONENT_REFERENCE",
"boundary": {
"type": "ANCESTOR_TYPE",
"ancestor_type": "<string>"
},
"component_type": "<string>",
"lookup_strategy": {
"type": "CAMPAIGN_PATH"
},
"selectable_filters": [
{
"type": "COMPONENT_TYPE",
"component_type": "<string>"
}
],
"source": "INHERITED",
"unmatched_description": "<string>",
"values": {
"default": {},
"en": {}
}
}Add components to a component reference list
Adds the components in component_ids to the named COMPONENT_REFERENCE_LIST setting and captures them in the setting value, after the components already selected. Every stored entry is kept as it is, so a caller that sees only part of the selection - one campaign, one page of candidates - adds to it without reading it first and without dropping what it cannot see. Only the added components are checked for eligibility; naming a component that is already selected leaves the stored value unchanged, though the setting is still saved and a campaign version is still written. Returns the setting in the same shape as GET and PUT on the setting itself.
curl --request POST \
--url https://api.extole.io/v1/components/{component_id}/settings/component-reference-list/{setting_name}/add \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"component_ids": [
"component_id"
],
"variant": "variant"
}
'import requests
url = "https://api.extole.io/v1/components/{component_id}/settings/component-reference-list/{setting_name}/add"
payload = {
"component_ids": ["component_id"],
"variant": "variant"
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({component_ids: ['component_id'], variant: 'variant'})
};
fetch('https://api.extole.io/v1/components/{component_id}/settings/component-reference-list/{setting_name}/add', 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.extole.io/v1/components/{component_id}/settings/component-reference-list/{setting_name}/add",
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([
'component_ids' => [
'component_id'
],
'variant' => 'variant'
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"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.extole.io/v1/components/{component_id}/settings/component-reference-list/{setting_name}/add"
payload := strings.NewReader("{\n \"component_ids\": [\n \"component_id\"\n ],\n \"variant\": \"variant\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<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.extole.io/v1/components/{component_id}/settings/component-reference-list/{setting_name}/add")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"component_ids\": [\n \"component_id\"\n ],\n \"variant\": \"variant\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.extole.io/v1/components/{component_id}/settings/component-reference-list/{setting_name}/add")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"component_ids\": [\n \"component_id\"\n ],\n \"variant\": \"variant\"\n}"
response = http.request(request)
puts response.read_body{
"description": "<string>",
"display_name": "<string>",
"name": "<string>",
"priority": "10",
"tags": [
"<string>"
],
"type": "COMPONENT_REFERENCE",
"boundary": {
"type": "ANCESTOR_TYPE",
"ancestor_type": "<string>"
},
"component_type": "<string>",
"lookup_strategy": {
"type": "CAMPAIGN_PATH"
},
"selectable_filters": [
{
"type": "COMPONENT_TYPE",
"component_type": "<string>"
}
],
"source": "INHERITED",
"unmatched_description": "<string>",
"values": {
"default": {},
"en": {}
}
}Authorizations
Body
The components to add to this reference. Every component already selected stays selected, and naming one that is already selected changes nothing. Every added id must be eligible for this reference: inside the setting's boundary, carrying the required component types, and not excluded by a selectable filter.
The components to add to this reference. Every component already selected stays selected, and naming one that is already selected changes nothing. Every added id must be eligible for this reference: inside the setting's boundary, carrying the required component types, and not excluded by a selectable filter.
The setting value variant the selection is added to. Defaults to default.
Response
The setting after the components were added, in the same shape GET and PUT return.
Stored campaign component component reference variable definition. Fields description and unmatched_description are unevaluated and appear in buildtime-evaluatable form.
The description as configured: a literal value, or an expression (type:string) when defined dynamically. Buildtime expressions use CampaignBuildtimeContext.
"10"
COMPONENT_REFERENCE, COMPONENT_REFERENCE_LIST Boundary that limits where selectable components are resolved from.
- ANCESTOR_TYPE
- PATH
Show child attributes
Show child attributes
Component type that can be selected by this variable.
Lookup strategy used to match selectable components.
- CAMPAIGN_PATH
- EXPRESSION
Show child attributes
Show child attributes
Filters that narrow the components available for selection.
- COMPONENT_TYPE
- EXPRESSION
- FACET
Show child attributes
Show child attributes
Where this setting takes its value from. LOCAL uses the values stored on this component. INHERITED uses the same-named setting of the nearest ancestor component that is not itself INHERITED. PARAMETER uses the same-named parameter of the socket this component is installed into. For an INHERITED setting, values shows what is stored on this component, not the value in effect; the built setting reports that.
INHERITED, LOCAL, PARAMETER Description shown when a saved reference no longer matches a selectable component. Buildtime expressions use CampaignBuildtimeContext.
Open map of setting values keyed by value key. There is no fixed or maximum number of keys. Any string key may be present; each value uses the same shape for this setting's type. The properties listed here are common examples only and are not required.
Show child attributes
Show child attributes
Was this page helpful?
