How to send a paragraph (line break)

You can also break lines in query parameters by sending %0A, for instance: body = 1%0A2 will give you:

1
2

Breaking text lines in messages via API can be achieved using a Post request \n

$whatsapp_message = "1\n2";

$client = new \GuzzleHttp\Client();
$response_send = $client->request('POST', 'https://gate.whapi.cloud/messages/text', [
    'body' => json_encode([
        "to" => "967605492075@s.whatsapp.net",
        "body" => $whatsapp_message
    ]),
    'headers' => [
        'accept' => 'application/json',
        'authorization' => 'Bearer ' . $token,
        'content-type' => 'application/json',
    ],
]);
$sent_message = $response_send->getBody();
$sent_message_decoded = json_decode($sent_message);
print_r($sent_message_decoded);

Last updated