curl
# Requires the core:run key scope.
curl -X POST "https://api.triggr-app.com/api/v1/core/forms/<slug>/check-upns" \
-H "Authorization: Bearer $TRIGGR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"clientId": "c1d2e3f4-5a6b-7c8d-9e0f-1a2b3c4d5e6f",
"candidates": [
"jane.doe@acme.com",
"jdoe@acme.com"
]
}'// Requires the core:run key scope.
const res = await fetch("https://api.triggr-app.com/api/v1/core/forms/<slug>/check-upns", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.TRIGGR_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
"clientId": "c1d2e3f4-5a6b-7c8d-9e0f-1a2b3c4d5e6f",
"candidates": [
"jane.doe@acme.com",
"jdoe@acme.com"
]
}),
});
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",
"candidates": [
"jane.doe@acme.com",
"jdoe@acme.com"
]
}
'@
Invoke-RestMethod -Method Post -Uri 'https://api.triggr-app.com/api/v1/core/forms/<slug>/check-upns' -Headers $headers -ContentType 'application/json' -Body $bodyimport requests
url = "https://api.triggr-app.com/api/v1/core/forms/{slug}/check-upns"
payload = {
"candidates": ["jane.doe@acme.com", "jdoe@acme.com"],
"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({
candidates: ['jane.doe@acme.com', 'jdoe@acme.com'],
clientId: 'c1d2e3f4-5a6b-7c8d-9e0f-1a2b3c4d5e6f'
})
};
fetch('https://api.triggr-app.com/api/v1/core/forms/{slug}/check-upns', 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}/check-upns",
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([
'candidates' => [
'jane.doe@acme.com',
'jdoe@acme.com'
],
'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}/check-upns"
payload := strings.NewReader("{\n \"candidates\": [\n \"jane.doe@acme.com\",\n \"jdoe@acme.com\"\n ],\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}/check-upns")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"candidates\": [\n \"jane.doe@acme.com\",\n \"jdoe@acme.com\"\n ],\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}/check-upns")
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 \"candidates\": [\n \"jane.doe@acme.com\",\n \"jdoe@acme.com\"\n ],\n \"clientId\": \"c1d2e3f4-5a6b-7c8d-9e0f-1a2b3c4d5e6f\"\n}"
response = http.request(request)
puts response.read_body{
"taken": [
"jdoe@acme.com"
]
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}Core run
Check UPN availability
Which candidate UPNs already exist in the client’s directory. Requires the core:run key scope.
POST
/
api
/
v1
/
core
/
forms
/
{slug}
/
check-upns
curl
# Requires the core:run key scope.
curl -X POST "https://api.triggr-app.com/api/v1/core/forms/<slug>/check-upns" \
-H "Authorization: Bearer $TRIGGR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"clientId": "c1d2e3f4-5a6b-7c8d-9e0f-1a2b3c4d5e6f",
"candidates": [
"jane.doe@acme.com",
"jdoe@acme.com"
]
}'// Requires the core:run key scope.
const res = await fetch("https://api.triggr-app.com/api/v1/core/forms/<slug>/check-upns", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.TRIGGR_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
"clientId": "c1d2e3f4-5a6b-7c8d-9e0f-1a2b3c4d5e6f",
"candidates": [
"jane.doe@acme.com",
"jdoe@acme.com"
]
}),
});
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",
"candidates": [
"jane.doe@acme.com",
"jdoe@acme.com"
]
}
'@
Invoke-RestMethod -Method Post -Uri 'https://api.triggr-app.com/api/v1/core/forms/<slug>/check-upns' -Headers $headers -ContentType 'application/json' -Body $bodyimport requests
url = "https://api.triggr-app.com/api/v1/core/forms/{slug}/check-upns"
payload = {
"candidates": ["jane.doe@acme.com", "jdoe@acme.com"],
"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({
candidates: ['jane.doe@acme.com', 'jdoe@acme.com'],
clientId: 'c1d2e3f4-5a6b-7c8d-9e0f-1a2b3c4d5e6f'
})
};
fetch('https://api.triggr-app.com/api/v1/core/forms/{slug}/check-upns', 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}/check-upns",
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([
'candidates' => [
'jane.doe@acme.com',
'jdoe@acme.com'
],
'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}/check-upns"
payload := strings.NewReader("{\n \"candidates\": [\n \"jane.doe@acme.com\",\n \"jdoe@acme.com\"\n ],\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}/check-upns")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"candidates\": [\n \"jane.doe@acme.com\",\n \"jdoe@acme.com\"\n ],\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}/check-upns")
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 \"candidates\": [\n \"jane.doe@acme.com\",\n \"jdoe@acme.com\"\n ],\n \"clientId\": \"c1d2e3f4-5a6b-7c8d-9e0f-1a2b3c4d5e6f\"\n}"
response = http.request(request)
puts response.read_body{
"taken": [
"jdoe@acme.com"
]
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}⌘I

