Create an approve action
curl --request POST \
--url https://api.extole.io/v2/campaigns/{campaignId}{version}/controllers/{controllerId}/actions/approves \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"cause_type": "cause_type",
"component_ids": [
"component_id"
],
"component_references": [
{
"component_id": "component_id",
"socket_names": [
"socket_name"
]
}
],
"enabled": true,
"event_type": "event_type",
"force": "force",
"legacy_action_id": "legacy_action_id",
"note": "note",
"partner_event_id": "partner_event_id",
"polling_id": "polling_id",
"polling_name": "polling_name",
"quality": "ALWAYS",
"reward_tags": [
"reward_tag"
]
}
'import requests
url = "https://api.extole.io/v2/campaigns/{campaignId}{version}/controllers/{controllerId}/actions/approves"
payload = {
"cause_type": "cause_type",
"component_ids": ["component_id"],
"component_references": [
{
"component_id": "component_id",
"socket_names": ["socket_name"]
}
],
"enabled": True,
"event_type": "event_type",
"force": "force",
"legacy_action_id": "legacy_action_id",
"note": "note",
"partner_event_id": "partner_event_id",
"polling_id": "polling_id",
"polling_name": "polling_name",
"quality": "ALWAYS",
"reward_tags": ["reward_tag"]
}
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_type: 'cause_type',
component_ids: ['component_id'],
component_references: [{component_id: 'component_id', socket_names: ['socket_name']}],
enabled: true,
event_type: 'event_type',
force: 'force',
legacy_action_id: 'legacy_action_id',
note: 'note',
partner_event_id: 'partner_event_id',
polling_id: 'polling_id',
polling_name: 'polling_name',
quality: 'ALWAYS',
reward_tags: ['reward_tag']
})
};
fetch('https://api.extole.io/v2/campaigns/{campaignId}{version}/controllers/{controllerId}/actions/approves', 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}{version}/controllers/{controllerId}/actions/approves",
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_type' => 'cause_type',
'component_ids' => [
'component_id'
],
'component_references' => [
[
'component_id' => 'component_id',
'socket_names' => [
'socket_name'
]
]
],
'enabled' => true,
'event_type' => 'event_type',
'force' => 'force',
'legacy_action_id' => 'legacy_action_id',
'note' => 'note',
'partner_event_id' => 'partner_event_id',
'polling_id' => 'polling_id',
'polling_name' => 'polling_name',
'quality' => 'ALWAYS',
'reward_tags' => [
'reward_tag'
]
]),
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}{version}/controllers/{controllerId}/actions/approves"
payload := strings.NewReader("{\n \"cause_type\": \"cause_type\",\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 \"event_type\": \"event_type\",\n \"force\": \"force\",\n \"legacy_action_id\": \"legacy_action_id\",\n \"note\": \"note\",\n \"partner_event_id\": \"partner_event_id\",\n \"polling_id\": \"polling_id\",\n \"polling_name\": \"polling_name\",\n \"quality\": \"ALWAYS\",\n \"reward_tags\": [\n \"reward_tag\"\n ]\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}{version}/controllers/{controllerId}/actions/approves")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"cause_type\": \"cause_type\",\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 \"event_type\": \"event_type\",\n \"force\": \"force\",\n \"legacy_action_id\": \"legacy_action_id\",\n \"note\": \"note\",\n \"partner_event_id\": \"partner_event_id\",\n \"polling_id\": \"polling_id\",\n \"polling_name\": \"polling_name\",\n \"quality\": \"ALWAYS\",\n \"reward_tags\": [\n \"reward_tag\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.extole.io/v2/campaigns/{campaignId}{version}/controllers/{controllerId}/actions/approves")
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_type\": \"cause_type\",\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 \"event_type\": \"event_type\",\n \"force\": \"force\",\n \"legacy_action_id\": \"legacy_action_id\",\n \"note\": \"note\",\n \"partner_event_id\": \"partner_event_id\",\n \"polling_id\": \"polling_id\",\n \"polling_name\": \"polling_name\",\n \"quality\": \"ALWAYS\",\n \"reward_tags\": [\n \"reward_tag\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"action_id": "<string>",
"action_type": "APPROVE",
"component_ids": [
"<string>"
],
"component_references": [
{
"component_id": "<string>",
"socket_names": [
"<string>"
]
}
],
"enabled": true,
"cause_type": "<string>",
"event_type": "<string>",
"force": "<string>",
"legacy_action_id": "<string>",
"note": "<string>",
"partner_event_id": "<string>",
"polling_id": "<string>",
"polling_name": "<string>",
"reward_tags": [
"<string>"
]
}
Campaign Controllers Actions
Create an approve action
Adds an approve action to the specified campaign controller. When the controller’s triggers fire, this action approves the participant’s pending step or reward in the journey. Returns the created approve action with its server-assigned id.
POST
/
v2
/
campaigns
/
{campaignId}
{version}
/
controllers
/
{controllerId}
/
actions
/
approves
Create an approve action
curl --request POST \
--url https://api.extole.io/v2/campaigns/{campaignId}{version}/controllers/{controllerId}/actions/approves \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"cause_type": "cause_type",
"component_ids": [
"component_id"
],
"component_references": [
{
"component_id": "component_id",
"socket_names": [
"socket_name"
]
}
],
"enabled": true,
"event_type": "event_type",
"force": "force",
"legacy_action_id": "legacy_action_id",
"note": "note",
"partner_event_id": "partner_event_id",
"polling_id": "polling_id",
"polling_name": "polling_name",
"quality": "ALWAYS",
"reward_tags": [
"reward_tag"
]
}
'import requests
url = "https://api.extole.io/v2/campaigns/{campaignId}{version}/controllers/{controllerId}/actions/approves"
payload = {
"cause_type": "cause_type",
"component_ids": ["component_id"],
"component_references": [
{
"component_id": "component_id",
"socket_names": ["socket_name"]
}
],
"enabled": True,
"event_type": "event_type",
"force": "force",
"legacy_action_id": "legacy_action_id",
"note": "note",
"partner_event_id": "partner_event_id",
"polling_id": "polling_id",
"polling_name": "polling_name",
"quality": "ALWAYS",
"reward_tags": ["reward_tag"]
}
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_type: 'cause_type',
component_ids: ['component_id'],
component_references: [{component_id: 'component_id', socket_names: ['socket_name']}],
enabled: true,
event_type: 'event_type',
force: 'force',
legacy_action_id: 'legacy_action_id',
note: 'note',
partner_event_id: 'partner_event_id',
polling_id: 'polling_id',
polling_name: 'polling_name',
quality: 'ALWAYS',
reward_tags: ['reward_tag']
})
};
fetch('https://api.extole.io/v2/campaigns/{campaignId}{version}/controllers/{controllerId}/actions/approves', 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}{version}/controllers/{controllerId}/actions/approves",
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_type' => 'cause_type',
'component_ids' => [
'component_id'
],
'component_references' => [
[
'component_id' => 'component_id',
'socket_names' => [
'socket_name'
]
]
],
'enabled' => true,
'event_type' => 'event_type',
'force' => 'force',
'legacy_action_id' => 'legacy_action_id',
'note' => 'note',
'partner_event_id' => 'partner_event_id',
'polling_id' => 'polling_id',
'polling_name' => 'polling_name',
'quality' => 'ALWAYS',
'reward_tags' => [
'reward_tag'
]
]),
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}{version}/controllers/{controllerId}/actions/approves"
payload := strings.NewReader("{\n \"cause_type\": \"cause_type\",\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 \"event_type\": \"event_type\",\n \"force\": \"force\",\n \"legacy_action_id\": \"legacy_action_id\",\n \"note\": \"note\",\n \"partner_event_id\": \"partner_event_id\",\n \"polling_id\": \"polling_id\",\n \"polling_name\": \"polling_name\",\n \"quality\": \"ALWAYS\",\n \"reward_tags\": [\n \"reward_tag\"\n ]\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}{version}/controllers/{controllerId}/actions/approves")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"cause_type\": \"cause_type\",\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 \"event_type\": \"event_type\",\n \"force\": \"force\",\n \"legacy_action_id\": \"legacy_action_id\",\n \"note\": \"note\",\n \"partner_event_id\": \"partner_event_id\",\n \"polling_id\": \"polling_id\",\n \"polling_name\": \"polling_name\",\n \"quality\": \"ALWAYS\",\n \"reward_tags\": [\n \"reward_tag\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.extole.io/v2/campaigns/{campaignId}{version}/controllers/{controllerId}/actions/approves")
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_type\": \"cause_type\",\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 \"event_type\": \"event_type\",\n \"force\": \"force\",\n \"legacy_action_id\": \"legacy_action_id\",\n \"note\": \"note\",\n \"partner_event_id\": \"partner_event_id\",\n \"polling_id\": \"polling_id\",\n \"polling_name\": \"polling_name\",\n \"quality\": \"ALWAYS\",\n \"reward_tags\": [\n \"reward_tag\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"action_id": "<string>",
"action_type": "APPROVE",
"component_ids": [
"<string>"
],
"component_references": [
{
"component_id": "<string>",
"socket_names": [
"<string>"
]
}
],
"enabled": true,
"cause_type": "<string>",
"event_type": "<string>",
"force": "<string>",
"legacy_action_id": "<string>",
"note": "<string>",
"partner_event_id": "<string>",
"polling_id": "<string>",
"polling_name": "<string>",
"reward_tags": [
"<string>"
]
}
Authorizations
HEADERQUERYCOOKIE
Path Parameters
Pattern:
(/version/.+)?Body
application/json
Body of a POST /v2/campaigns/{campaignId}{version:(/version/.+)?}/controllers/{controllerId}/actions/approves request.
Show child attributes
Show child attributes
Choose between static or dynamic enabled
Available options:
ALWAYS, HIGH, LOW reward_tags
Static Value · string[]Buildtime - Handlebars · stringBuildtime - Javascript · stringRuntime - Handlebars · stringRuntime - Javascript · string
Choose between static or dynamic reward tags
Response
Successful response
Available options:
APPROVE Show child attributes
Show child attributes
The enabled as configured: a literal value, or an expression (type:string) when defined dynamically.
Available options:
ALWAYS, HIGH, LOW reward_tags
Static Value · string[]Buildtime - Handlebars · stringBuildtime - Javascript · stringRuntime - Handlebars · stringRuntime - Javascript · string
The reward tags as configured: a literal value, or an expression (type:string) when defined dynamically.
⌘I
