<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.omi.me/v1/dev/user/conversations",
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([
'text' => '<string>',
'finished_at' => '2023-11-07T05:31:56Z',
'geolocation' => [
'latitude' => 123,
'longitude' => 123,
'accuracy' => 1,
'address' => '<string>',
'altitude' => 123,
'captured_at' => '2023-11-07T05:31:56Z',
'google_place_id' => '<string>',
'location_type' => '<string>'
],
'language' => 'en',
'started_at' => '2023-11-07T05:31:56Z',
'text_source' => 'other_text',
'text_source_spec' => '<string>'
]),
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;
}