Savaraflow
Open console
← Framework guides

PHP

Send a test request from Laravel.

Use Laravel’s HTTP client from a service class or queued job.

Laravel

Connect your application

  1. Configure the service

    Define services.savara.host and services.savara.test_key in config/services.php using your server environment.

  2. Dispatch from trusted server code

    Call the example from a queued job after your transaction commits. Persist the job event ID so retries can reuse the idempotency key.

  3. Handle the response

    Laravel’s HTTP client exposes the HTTP status and parsed response. Store the message ID if the request succeeded.

Read the Laravel documentation
PHP example
use Illuminate\Support\Facades\Http;

function simulatePickup(string $orderId): array
{
    $response = Http::withToken(config('services.savara.test_key'))
        ->withHeaders(['Idempotency-Key' => 'pickup-' . $orderId])
        ->timeout(10)
        ->post(config('services.savara.host') . '/api/v1/messages', [
            'channel' => 'SMS',
            'to' => '+256770123456',
            'body' => 'Your order is ready to collect.',
            'scenario' => 'delivered',
        ]);

    return ['status' => $response->status(), 'result' => $response->json()];
}

Before sending live

Use your own SavaraFlow deployment origin without a trailing slash and a scoped key from that deployment. Switch to a live key only after enabling the route and funding the workspace. Remove the sandbox scenario, use a recipient who agreed to receive the message, and include consent: true in the request. Keep API keys in server-side configuration.

Read the complete sending workflow

Get a quote before your first live send.

Use the live quote endpoint to review the destination cost and available balance.

Read about quotes

Choose what SavaraFlow can save on this device. You can change your choice here at any time.