Triggers
Start offer preparation from a request in your integration.
When your integration receives an eligible CRM request, persist its identifier, the intended run ID and the operation UUID before calling the API. On redelivery, reuse those values and the original payload.
curl
curl -X POST "$RDC_BASE_URL/ai/v1/tasks/runs" \
-H "Authorization: Bearer $RDC_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"operationId": "1b5201ad-39eb-4cc1-889c-2dd2d43ffc57",
"expectedRevision": 0,
"runId": "run-1042",
"requestId": "CV-1042"
}' JavaScript
const response = await fetch(`${process.env.RDC_BASE_URL}/ai/v1/tasks/runs`, {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.RDC_TOKEN}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({
"operationId": "1b5201ad-39eb-4cc1-889c-2dd2d43ffc57",
"expectedRevision": 0,
"runId": "run-1042",
"requestId": "CV-1042"
}),
});
const result = await response.json(); Python
import os
import requests
response = requests.request(
'POST',
f'{os.environ["RDC_BASE_URL"]}/ai/v1/tasks/runs',
headers={
'Authorization': f'Bearer {os.environ["RDC_TOKEN"]}',
},
json={
'operationId': '1b5201ad-39eb-4cc1-889c-2dd2d43ffc57',
'expectedRevision': 0,
'runId': 'run-1042',
'requestId': 'CV-1042',
},
)
result = response.json() PHP
<?php
$body = <<<'JSON'
{
"operationId": "1b5201ad-39eb-4cc1-889c-2dd2d43ffc57",
"expectedRevision": 0,
"runId": "run-1042",
"requestId": "CV-1042"
}
JSON;
$curl = curl_init(getenv('RDC_BASE_URL') . '/ai/v1/tasks/runs');
curl_setopt_array($curl, [
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer ' . getenv('RDC_TOKEN'),
'Content-Type: application/json',
],
CURLOPT_POSTFIELDS => $body,
]);
$result = json_decode(curl_exec($curl), true);
curl_close($curl); C#
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Post, $"{Environment.GetEnvironmentVariable("RDC_BASE_URL")}/ai/v1/tasks/runs");
request.Headers.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("RDC_TOKEN"));
request.Content = new StringContent("""
{
"operationId": "1b5201ad-39eb-4cc1-889c-2dd2d43ffc57",
"expectedRevision": 0,
"runId": "run-1042",
"requestId": "CV-1042"
}
""", System.Text.Encoding.UTF8, "application/json");
var response = await client.SendAsync(request);
var result = await response.Content.ReadAsStringAsync(); {
"operationId": "1b5201ad-39eb-4cc1-889c-2dd2d43ffc57",
"status": "accepted",
"aggregateRevision": 1
} Follow completion with webhook subscriptions. Put a run awaiting approval in your reviewer’s queue and read the current revision when opening it.