curl --request POST \
--url https://api.extole.io/v2/campaigns/{campaignId}/controllers/{controllerId}/triggers/scores \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"cause_event_name": "cause_event_name",
"channel": "channel",
"component_ids": [
"component_id"
],
"component_references": [
{
"component_id": "component_id",
"socket_names": [
"socket_name"
]
}
],
"enabled": true,
"negated": true,
"parent_trigger_group_name": "parent_trigger_group_name",
"score_result": "FAIL",
"trigger_description": "trigger_description",
"trigger_name": "trigger_name",
"trigger_phase": "MATCHING"
}
'import requests
url = "https://api.extole.io/v2/campaigns/{campaignId}/controllers/{controllerId}/triggers/scores"
payload = {
"cause_event_name": "cause_event_name",
"channel": "channel",
"component_ids": ["component_id"],
"component_references": [
{
"component_id": "component_id",
"socket_names": ["socket_name"]
}
],
"enabled": True,
"negated": True,
"parent_trigger_group_name": "parent_trigger_group_name",
"score_result": "FAIL",
"trigger_description": "trigger_description",
"trigger_name": "trigger_name",
"trigger_phase": "MATCHING"
}
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({
cause_event_name: 'cause_event_name',
channel: 'channel',
component_ids: ['component_id'],
component_references: [{component_id: 'component_id', socket_names: ['socket_name']}],
enabled: true,
negated: true,
parent_trigger_group_name: 'parent_trigger_group_name',
score_result: 'FAIL',
trigger_description: 'trigger_description',
trigger_name: 'trigger_name',
trigger_phase: 'MATCHING'
})
};
fetch('https://api.extole.io/v2/campaigns/{campaignId}/controllers/{controllerId}/triggers/scores', 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/v2/campaigns/{campaignId}/controllers/{controllerId}/triggers/scores",
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([
'cause_event_name' => 'cause_event_name',
'channel' => 'channel',
'component_ids' => [
'component_id'
],
'component_references' => [
[
'component_id' => 'component_id',
'socket_names' => [
'socket_name'
]
]
],
'enabled' => true,
'negated' => true,
'parent_trigger_group_name' => 'parent_trigger_group_name',
'score_result' => 'FAIL',
'trigger_description' => 'trigger_description',
'trigger_name' => 'trigger_name',
'trigger_phase' => 'MATCHING'
]),
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/v2/campaigns/{campaignId}/controllers/{controllerId}/triggers/scores"
payload := strings.NewReader("{\n \"cause_event_name\": \"cause_event_name\",\n \"channel\": \"channel\",\n \"component_ids\": [\n \"component_id\"\n ],\n \"component_references\": [\n {\n \"component_id\": \"component_id\",\n \"socket_names\": [\n \"socket_name\"\n ]\n }\n ],\n \"enabled\": true,\n \"negated\": true,\n \"parent_trigger_group_name\": \"parent_trigger_group_name\",\n \"score_result\": \"FAIL\",\n \"trigger_description\": \"trigger_description\",\n \"trigger_name\": \"trigger_name\",\n \"trigger_phase\": \"MATCHING\"\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/v2/campaigns/{campaignId}/controllers/{controllerId}/triggers/scores")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"cause_event_name\": \"cause_event_name\",\n \"channel\": \"channel\",\n \"component_ids\": [\n \"component_id\"\n ],\n \"component_references\": [\n {\n \"component_id\": \"component_id\",\n \"socket_names\": [\n \"socket_name\"\n ]\n }\n ],\n \"enabled\": true,\n \"negated\": true,\n \"parent_trigger_group_name\": \"parent_trigger_group_name\",\n \"score_result\": \"FAIL\",\n \"trigger_description\": \"trigger_description\",\n \"trigger_name\": \"trigger_name\",\n \"trigger_phase\": \"MATCHING\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.extole.io/v2/campaigns/{campaignId}/controllers/{controllerId}/triggers/scores")
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 \"cause_event_name\": \"cause_event_name\",\n \"channel\": \"channel\",\n \"component_ids\": [\n \"component_id\"\n ],\n \"component_references\": [\n {\n \"component_id\": \"component_id\",\n \"socket_names\": [\n \"socket_name\"\n ]\n }\n ],\n \"enabled\": true,\n \"negated\": true,\n \"parent_trigger_group_name\": \"parent_trigger_group_name\",\n \"score_result\": \"FAIL\",\n \"trigger_description\": \"trigger_description\",\n \"trigger_name\": \"trigger_name\",\n \"trigger_phase\": \"MATCHING\"\n}"
response = http.request(request)
puts response.read_bodyCreate a score trigger
Adds a score trigger to the specified campaign controller. The trigger fires when the computed score for the participant crosses the configured threshold. Returns the created trigger with its server-assigned id.
curl --request POST \
--url https://api.extole.io/v2/campaigns/{campaignId}/controllers/{controllerId}/triggers/scores \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"cause_event_name": "cause_event_name",
"channel": "channel",
"component_ids": [
"component_id"
],
"component_references": [
{
"component_id": "component_id",
"socket_names": [
"socket_name"
]
}
],
"enabled": true,
"negated": true,
"parent_trigger_group_name": "parent_trigger_group_name",
"score_result": "FAIL",
"trigger_description": "trigger_description",
"trigger_name": "trigger_name",
"trigger_phase": "MATCHING"
}
'import requests
url = "https://api.extole.io/v2/campaigns/{campaignId}/controllers/{controllerId}/triggers/scores"
payload = {
"cause_event_name": "cause_event_name",
"channel": "channel",
"component_ids": ["component_id"],
"component_references": [
{
"component_id": "component_id",
"socket_names": ["socket_name"]
}
],
"enabled": True,
"negated": True,
"parent_trigger_group_name": "parent_trigger_group_name",
"score_result": "FAIL",
"trigger_description": "trigger_description",
"trigger_name": "trigger_name",
"trigger_phase": "MATCHING"
}
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({
cause_event_name: 'cause_event_name',
channel: 'channel',
component_ids: ['component_id'],
component_references: [{component_id: 'component_id', socket_names: ['socket_name']}],
enabled: true,
negated: true,
parent_trigger_group_name: 'parent_trigger_group_name',
score_result: 'FAIL',
trigger_description: 'trigger_description',
trigger_name: 'trigger_name',
trigger_phase: 'MATCHING'
})
};
fetch('https://api.extole.io/v2/campaigns/{campaignId}/controllers/{controllerId}/triggers/scores', 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/v2/campaigns/{campaignId}/controllers/{controllerId}/triggers/scores",
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([
'cause_event_name' => 'cause_event_name',
'channel' => 'channel',
'component_ids' => [
'component_id'
],
'component_references' => [
[
'component_id' => 'component_id',
'socket_names' => [
'socket_name'
]
]
],
'enabled' => true,
'negated' => true,
'parent_trigger_group_name' => 'parent_trigger_group_name',
'score_result' => 'FAIL',
'trigger_description' => 'trigger_description',
'trigger_name' => 'trigger_name',
'trigger_phase' => 'MATCHING'
]),
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/v2/campaigns/{campaignId}/controllers/{controllerId}/triggers/scores"
payload := strings.NewReader("{\n \"cause_event_name\": \"cause_event_name\",\n \"channel\": \"channel\",\n \"component_ids\": [\n \"component_id\"\n ],\n \"component_references\": [\n {\n \"component_id\": \"component_id\",\n \"socket_names\": [\n \"socket_name\"\n ]\n }\n ],\n \"enabled\": true,\n \"negated\": true,\n \"parent_trigger_group_name\": \"parent_trigger_group_name\",\n \"score_result\": \"FAIL\",\n \"trigger_description\": \"trigger_description\",\n \"trigger_name\": \"trigger_name\",\n \"trigger_phase\": \"MATCHING\"\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/v2/campaigns/{campaignId}/controllers/{controllerId}/triggers/scores")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"cause_event_name\": \"cause_event_name\",\n \"channel\": \"channel\",\n \"component_ids\": [\n \"component_id\"\n ],\n \"component_references\": [\n {\n \"component_id\": \"component_id\",\n \"socket_names\": [\n \"socket_name\"\n ]\n }\n ],\n \"enabled\": true,\n \"negated\": true,\n \"parent_trigger_group_name\": \"parent_trigger_group_name\",\n \"score_result\": \"FAIL\",\n \"trigger_description\": \"trigger_description\",\n \"trigger_name\": \"trigger_name\",\n \"trigger_phase\": \"MATCHING\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.extole.io/v2/campaigns/{campaignId}/controllers/{controllerId}/triggers/scores")
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 \"cause_event_name\": \"cause_event_name\",\n \"channel\": \"channel\",\n \"component_ids\": [\n \"component_id\"\n ],\n \"component_references\": [\n {\n \"component_id\": \"component_id\",\n \"socket_names\": [\n \"socket_name\"\n ]\n }\n ],\n \"enabled\": true,\n \"negated\": true,\n \"parent_trigger_group_name\": \"parent_trigger_group_name\",\n \"score_result\": \"FAIL\",\n \"trigger_description\": \"trigger_description\",\n \"trigger_name\": \"trigger_name\",\n \"trigger_phase\": \"MATCHING\"\n}"
response = http.request(request)
puts response.read_bodyBody
Body of a POST /v2/campaigns/{campaignId}{version:(/version/.+)?}/controllers/{controllerId}/triggers/scores request.
Choose between static or dynamic enabled. Buildtime expressions use ControllerBuildtimeContext.
Choose between static or dynamic negated. Buildtime expressions use ControllerBuildtimeContext.
Choose between static or dynamic parent trigger group name. Buildtime expressions use ControllerBuildtimeContext.
Choose between static or dynamic trigger description. Buildtime expressions use ControllerBuildtimeContext.
Choose between static or dynamic trigger name. Buildtime expressions use ControllerBuildtimeContext.
Choose between static or dynamic trigger phase. Buildtime expressions use ControllerBuildtimeContext.
MATCHING, QUALIFYING, QUALITY Response
Successful response
The enabled as configured: a literal value, or an expression (type:string) when defined dynamically. Buildtime expressions use ControllerBuildtimeContext.
The negated as configured: a literal value, or an expression (type:string) when defined dynamically. Buildtime expressions use ControllerBuildtimeContext.
The parent trigger group name as configured: a literal value, or an expression (type:string) when defined dynamically. Buildtime expressions use ControllerBuildtimeContext.
The trigger description as configured: a literal value, or an expression (type:string) when defined dynamically. Buildtime expressions use ControllerBuildtimeContext.
The trigger name as configured: a literal value, or an expression (type:string) when defined dynamically. Buildtime expressions use ControllerBuildtimeContext.
The trigger phase as configured: a literal value, or an expression (type:string) when defined dynamically. Buildtime expressions use ControllerBuildtimeContext.
MATCHING, QUALIFYING, QUALITY Was this page helpful?
