@extends('layouts.app') @section('title', __('ui.docs')) @section('content')

WapAPI Documentation

Base URL: {{ $baseUrl }}

Auth header: Authorization: Bearer YOUR_API_KEY

Send text

curl -X POST {{ $baseUrl }}/messages/text \
  -H "Authorization: Bearer wap_xxx" \
  -H "Content-Type: application/json" \
  -d '{"to":"2010xxxxxxx","text":"Hello from WapAPI"}'

Send media

curl -X POST {{ $baseUrl }}/messages/media \
  -H "Authorization: Bearer wap_xxx" \
  -H "Content-Type: application/json" \
  -d '{"to":"2010xxxxxxx","media_url":"https://example.com/a.jpg","media_type":"image","caption":"Photo"}'

Send template (Meta only)

curl -X POST {{ $baseUrl }}/messages/template \
  -H "Authorization: Bearer wap_xxx" \
  -H "Content-Type: application/json" \
  -d '{"to":"2010xxxxxxx","template_name":"hello_world","language":"en"}'

Usage

curl {{ $baseUrl }}/usage -H "Authorization: Bearer wap_xxx"

PHP example

$ch = curl_init('{{ $baseUrl }}/messages/text');
curl_setopt_array($ch, [
  CURLOPT_POST => true,
  CURLOPT_HTTPHEADER => [
    'Authorization: Bearer wap_xxx',
    'Content-Type: application/json',
  ],
  CURLOPT_POSTFIELDS => json_encode([
    'to' => '2010xxxxxxx',
    'text' => 'Hello',
  ]),
  CURLOPT_RETURNTRANSFER => true,
]);
echo curl_exec($ch);

Response format

{
  "success": true,
  "data": { ... },
  "meta": {},
  "errors": []
}

Inbound provider webhooks

@endsection