curl
# Requires the core:run key scope.
curl -X POST "https://api.triggr-app.com/api/v1/core/forms/<slug>/fields/<fieldId>/options" \
-H "Authorization: Bearer $TRIGGR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"clientId": "c1d2e3f4-5a6b-7c8d-9e0f-1a2b3c4d5e6f"
}'// Requires the core:run key scope.
const res = await fetch("https://api.triggr-app.com/api/v1/core/forms/<slug>/fields/<fieldId>/options", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.TRIGGR_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
"clientId": "c1d2e3f4-5a6b-7c8d-9e0f-1a2b3c4d5e6f"
}),
});
if (!res.ok) throw new Error(`Triggr ${res.status}: ${await res.text()}`);
const data = await res.json();# Requires the core:run key scope.
$headers = @{
Authorization = "Bearer $env:TRIGGR_API_KEY"
}
$body = @'
{
"clientId": "c1d2e3f4-5a6b-7c8d-9e0f-1a2b3c4d5e6f"
}
'@
Invoke-RestMethod -Method Post -Uri 'https://api.triggr-app.com/api/v1/core/forms/<slug>/fields/<fieldId>/options' -Headers $headers -ContentType 'application/json' -Body $bodyimport requests
url = "https://api.triggr-app.com/api/v1/core/forms/{slug}/fields/{fieldId}/options"
payload = { "clientId": "c1d2e3f4-5a6b-7c8d-9e0f-1a2b3c4d5e6f" }
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({clientId: 'c1d2e3f4-5a6b-7c8d-9e0f-1a2b3c4d5e6f'})
};
fetch('https://api.triggr-app.com/api/v1/core/forms/{slug}/fields/{fieldId}/options', 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.triggr-app.com/api/v1/core/forms/{slug}/fields/{fieldId}/options",
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([
'clientId' => 'c1d2e3f4-5a6b-7c8d-9e0f-1a2b3c4d5e6f'
]),
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.triggr-app.com/api/v1/core/forms/{slug}/fields/{fieldId}/options"
payload := strings.NewReader("{\n \"clientId\": \"c1d2e3f4-5a6b-7c8d-9e0f-1a2b3c4d5e6f\"\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.triggr-app.com/api/v1/core/forms/{slug}/fields/{fieldId}/options")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"clientId\": \"c1d2e3f4-5a6b-7c8d-9e0f-1a2b3c4d5e6f\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.triggr-app.com/api/v1/core/forms/{slug}/fields/{fieldId}/options")
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 \"clientId\": \"c1d2e3f4-5a6b-7c8d-9e0f-1a2b3c4d5e6f\"\n}"
response = http.request(request)
puts response.read_body{
"options": [
{
"label": "All Staff",
"type": "group",
"value": "0a5f7c2e-91b4-4d38-8e6a-2c7f1b9d4e50"
},
{
"label": "Sales",
"type": "group",
"value": "7e3b1d42-6c8f-4a91-b2d5-3f0a8c6e1b47"
}
]
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}Core run
Resolve a dynamic field's options
Microsoft-sourced, cached, or static options for one field, for the given client. forceRefresh bypasses the option cache — leave it off unless the user asked to refresh. Requires the core:run key scope.
POST
/
api
/
v1
/
core
/
forms
/
{slug}
/
fields
/
{fieldId}
/
options
curl
# Requires the core:run key scope.
curl -X POST "https://api.triggr-app.com/api/v1/core/forms/<slug>/fields/<fieldId>/options" \
-H "Authorization: Bearer $TRIGGR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"clientId": "c1d2e3f4-5a6b-7c8d-9e0f-1a2b3c4d5e6f"
}'// Requires the core:run key scope.
const res = await fetch("https://api.triggr-app.com/api/v1/core/forms/<slug>/fields/<fieldId>/options", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.TRIGGR_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
"clientId": "c1d2e3f4-5a6b-7c8d-9e0f-1a2b3c4d5e6f"
}),
});
if (!res.ok) throw new Error(`Triggr ${res.status}: ${await res.text()}`);
const data = await res.json();# Requires the core:run key scope.
$headers = @{
Authorization = "Bearer $env:TRIGGR_API_KEY"
}
$body = @'
{
"clientId": "c1d2e3f4-5a6b-7c8d-9e0f-1a2b3c4d5e6f"
}
'@
Invoke-RestMethod -Method Post -Uri 'https://api.triggr-app.com/api/v1/core/forms/<slug>/fields/<fieldId>/options' -Headers $headers -ContentType 'application/json' -Body $bodyimport requests
url = "https://api.triggr-app.com/api/v1/core/forms/{slug}/fields/{fieldId}/options"
payload = { "clientId": "c1d2e3f4-5a6b-7c8d-9e0f-1a2b3c4d5e6f" }
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({clientId: 'c1d2e3f4-5a6b-7c8d-9e0f-1a2b3c4d5e6f'})
};
fetch('https://api.triggr-app.com/api/v1/core/forms/{slug}/fields/{fieldId}/options', 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.triggr-app.com/api/v1/core/forms/{slug}/fields/{fieldId}/options",
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([
'clientId' => 'c1d2e3f4-5a6b-7c8d-9e0f-1a2b3c4d5e6f'
]),
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.triggr-app.com/api/v1/core/forms/{slug}/fields/{fieldId}/options"
payload := strings.NewReader("{\n \"clientId\": \"c1d2e3f4-5a6b-7c8d-9e0f-1a2b3c4d5e6f\"\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.triggr-app.com/api/v1/core/forms/{slug}/fields/{fieldId}/options")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"clientId\": \"c1d2e3f4-5a6b-7c8d-9e0f-1a2b3c4d5e6f\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.triggr-app.com/api/v1/core/forms/{slug}/fields/{fieldId}/options")
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 \"clientId\": \"c1d2e3f4-5a6b-7c8d-9e0f-1a2b3c4d5e6f\"\n}"
response = http.request(request)
puts response.read_body{
"options": [
{
"label": "All Staff",
"type": "group",
"value": "0a5f7c2e-91b4-4d38-8e6a-2c7f1b9d4e50"
},
{
"label": "Sales",
"type": "group",
"value": "7e3b1d42-6c8f-4a91-b2d5-3f0a8c6e1b47"
}
]
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}Authorizations
Organisation API key. Scoped operations carry x-triggr-scope; the scopes themselves are described in x-triggr-scopes.
Response
OK
Show child attributes
Show child attributes
⌘I

