Before you start
- You need PHP 8.1+ installed on your machine.
- You need a Rewrite API key with the required permissions.
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
Learn how to use the PHP SDK to send SMS with the API.
REWRITE_API_KEY=rw...
<?php
require __DIR__ . '/vendor/autoload.php';
use RewriteToday\Rewrite;
$rewrite = new Rewrite(getenv('REWRITE_API_KEY'));
$message = $rewrite->messages->send([
'to' => '+1234567890',
'content' => 'Your OTP code is 478201',
]);
var_dump($message);