Docs
OverviewPlatformPlatform APIA2P Messaging API
AI & MCP
Open dashboard
OverviewPlatformPlatform APIA2P Messaging API
AI & MCP
  • Overview
  • Create an account
  • Choose your API
  • AI & MCP
Channels
    • Senders
    • Coverage
    • Destination countries
    • Wildcard route
    • Agents
HTTP
  • Quickstart
  • Bulk sending
  • Authentication
  • Rate limits
  • Errors
  • DLRs
  • Traffic metrics
  • Full API Reference
SMPP
  • Authentication
  • Integration
SDKs
  • Node.js
  • PHP
  • Python
  • Ruby
  • Java
Legacy API
  • Overview
  • Authentication
  • Full API Reference
DashboardSupportinstasent.com

A2P Messaging API · SDKs

PHP SDK

Official PHP client for the Instasent A2P Messaging API. Install via Composer, construct the SmsClient with your api_sms token, and call sendSms — Unicode, lookup and verify workflows are covered by separate clients in the same package.

On this page▾
  • Installation
  • Via Composer
  • Via ZIP
  • Send an SMS
  • Unicode
  • Retrieve an SMS
  • Lookup
  • Verify
  • Request a code
  • Check the code
  • Requirements
  • Getting help

The PHP SDK wraps SMS, lookup and verify into small focused clients. Most integrations only need SmsClient.

Installation

Via Composer

composer require instasent/instasent-php-lib

Via ZIP

Download the source from GitHub, drop the folder into your project and require the files directly:

require_once __DIR__ . '/path/to/lib/Abstracts/InstasentClient.php';
require_once __DIR__ . '/path/to/lib/SmsClient.php';

Send an SMS

<?php
require __DIR__ . '/vendor/autoload.php';
 
$client = new Instasent\SmsClient(getenv('INSTASENT_TOKEN'));
$response = $client->sendSms('test', '+34647000000', 'test message');
 
echo $response['response_code'];
echo $response['response_body'];

Unicode

For SMS containing characters outside GSM-7 (accents, emoji) use sendUnicodeSms:

$response = $client->sendUnicodeSms('test', '+34647000000', 'Unicode test: ña éáíóú 😀');

Retrieve an SMS

<?php
require __DIR__ . '/vendor/autoload.php';
 
$client = new Instasent\SmsClient(getenv('INSTASENT_TOKEN'));
$response = $client->getSmsById('smsId');
 
echo $response['response_code'];
echo $response['response_body'];

Lookup

<?php
require __DIR__ . '/vendor/autoload.php';
 
$client = new Instasent\LookupClient(getenv('INSTASENT_TOKEN'));
$response = $client->doLookup('+34666000000');
 
echo $response['response_code'];
echo $response['response_body'];

Verify

Verify is a two-step workflow: request a code, then check it against the user input.

Request a code

<?php
require __DIR__ . '/vendor/autoload.php';
 
$client = new Instasent\VerifyClient(getenv('INSTASENT_TOKEN'));
$response = $client->requestVerify('test', '+34647000000', 'Your code is %token%', 6, 300);
 
echo $response['response_code'];
echo $response['response_body'];

The fourth argument is the code length, the fifth is the validity in seconds.

Check the code

$client = new Instasent\VerifyClient(getenv('INSTASENT_TOKEN'));
$response = $client->checkVerify($requestVerifyId, $token);
 
$body = json_decode($response['response_body']);
if ($body->entity->status === 'verified') {
    // success
} else {
    // handle pending / failed / expired
}

Requirements

PHP ≥ 5.2.3.

Getting help

For help installing or using the library, contact support@instasent.com. Bugs and feature requests belong on the GitHub repository.

Product and pricing

  • SMS API
  • SMS and RCS pricing

Last updated September 30, 2026

PreviousNode.jsNextPython
  • Installation
  • Via Composer
  • Via ZIP
  • Send an SMS
  • Unicode
  • Retrieve an SMS
  • Lookup
  • Verify
  • Request a code
  • Check the code
  • Requirements
  • Getting help

© 2026 Instasent

Privacy PolicyTerms & ConditionsCookie PolicyLegal Notice
All systems operational