<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.example.com/threads/{thread_id}/runs/crons",
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([
'schedule' => '<string>',
'assistant_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'timezone' => '<string>',
'end_time' => '2023-11-07T05:31:56Z',
'input' => [
[
]
],
'metadata' => [
],
'config' => [
'tags' => [
'<string>'
],
'recursion_limit' => 123,
'configurable' => [
]
],
'context' => [
],
'webhook' => '<string>',
'interrupt_before' => '*',
'interrupt_after' => '*',
'multitask_strategy' => 'enqueue',
'enabled' => true,
'stream_mode' => [
'values'
],
'stream_subgraphs' => false,
'stream_resumable' => false,
'durability' => 'async'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}