AvraAPI::sms() for the four released SMS operations. All return an
ApiResponse. Sending is a real external action: a successful response means
the configured QuickSend integration accepted the request, not that a handset
received it. Do not automatically retry an uncertain send.
The Laravel package discovers the AvraAPI Facade alias automatically. Import
Avraapi\Laravel\Facades\AvraAPI when you prefer an explicit dependency for
IDE and static-analysis support.
Every SMS operation can use the shared one-request privacy control:
AvraAPI::sms()->withPrivacyMode()->getBalance(). It sends
X-Privacy-Mode: 1 only for that next request, then clears automatically.
Privacy Mode keeps normal routing, billing, and usage tracking while
suppressing request and response payload storage.Send one SMS
sendSingle(string $to, string $message): ApiResponse sends one message to a
QuickSend-compatible Sri Lankan local 07XXXXXXXX or E.164 +947XXXXXXXX
number. A Managed SMS integration supports this method.
SDK function
Copy the SDK call
Send one SMS and capture acceptance
Response
Send one message to a bulk list
sendBulkSame(array $recipients, string $message, bool $checkCost = false): ApiResponse sends the same text to 1–10,000 recipients. It requires a Manual
(BYOK) QuickSend integration. Set checkCost to true to request a campaign
cost estimate instead of sending that bulk campaign.
SDK function
Copy the SDK call
Check the cost before a bulk campaign
Response
checkCost: false, the same method submits the campaign and
provider_response instead contains the provider acceptance result. Manual
(BYOK) sends return credits_charged: 0; the connected provider can charge its
own account.
Send different messages to a bulk list
sendBulkDifferent(array $messages): ApiResponse sends a different message to
each recipient through a Manual (BYOK) QuickSend integration. Supply 1–20
entries; each entry has exactly to and msg values.
SDK function
Copy the SDK call
Send recipient-specific SMS messages
Response
checkCost is not an argument of sendBulkDifferent(). A cost estimate is
available only through sendBulkSame(..., checkCost: true).
Check the configured SMS balance
getBalance(): ApiResponse reads the balance for the active SMS integration.
It does not deduct AvraAPI credits.
SDK function
Copy the SDK call
Read the SMS balance
Response — Manual (BYOK)
Response — Managed
balance_formatted reports AvraAPI wallet credits:
1 USD equals 1,000,000 API credits. For a Manual integration it reports
the connected QuickSend account balance.
SMS units and errors
message_count is SMS units, not API request count. Use up to 153 GSM-7
characters or 67 Unicode (UCS-2) characters per unit. Each recipient
message is limited to three units. The SMS REST API Reference
contains the full method restrictions and error contract; use the typed SDK
exception pattern from Laravel Overview and setup
for failures.