I am trying to send a message as a reply to a previous message using clickatel api.
Below is my payload
$header = [
"Content-Type: application/json",
"Accept: application/json",
"Authorization: " . $clickatel_api_key
];
$message = [
'channel' => 'whatsapp',
'to' => formatPhone($contact->phone),
'content' => $text,
'relatedMessageId' => $message->message_id
];
$messages = [];
array_push($messages, $message);
$data['messages'] = $messages;
$link = 'https://platform.clickatell.com/v1/message';
$ch = curl_init($link);
curl_setopt($ch, CURLOPT_HTTPHEADER, $header);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($data));
$response = curl_exec($ch);
curl_close($ch);
I have tried to change the relatedMessageId key to clientEventId and relatedClientMessageId and none worked.
It is just sending the message without sending it as a reply to a specific question