API Documentation

Welcome to the UniSMS API documentation. This guide will help you integrate SMS functionality into your applications.

Base URL
https://unismsapi.com/api
Authentication

All API requests require Basic Authentication using your API key.

Authorization: Basic {{your_api_key}}

(Your API key should be base64 encoded)

Endpoints

POST /sms

Send SMS

Send an SMS message to a recipient. The message will be queued for delivery.

Request Body

{
  "content": "Your message here",
  "recipient": "+639123456789"
}

Request Body With Metadata

Use metadata for your internal recording and info

{
  "metadata": {
    "template": "order_confirmation",
    "order_id": "12345"
  },
  "content": "Your message here",
  "sender_id": "MySender",
  "recipient": "+639123456789"
}

Parameters

Field Type Required Description
recipient string Yes Phone number in E.164 format (e.g., +639123456789)
content string Yes SMS message content (max 160 characters)
sender_id string No Custom sender ID (only for users with businesses. Leave blank if none.)
metadata object No Custom key-value pairs for tracking messages (e.g., order_id, template)

NOTE: If your business require a custom SenderID for branding purposes, please reach out to support and have your business documents ready.

Example Response

{
  "message": {
    "status": "sent",
    "metadata": {
      "source": "onboarding"
    },
    "content": "Welcome to UniSMS",
    "created": "2026-03-16T14:32:44Z",
    "reference_id": "msg_84e8b93b-6315-46af-a686",
    "fail_reason": null,
    "recipient": "+639055310560"
  }
}

Response Codes

201 Created 400 Bad Request 401 Unauthorized 422 Unprocessable Entity
GET /sms/:reference_id

Get SMS Status

Retrieve the status of a previously sent SMS message using its reference ID.

Path Parameters

Parameter Type Description
reference_id string The unique reference ID returned when sending the SMS

Example Response

{
  "message": {
    "status": "sent",
    "metadata": {},
    "content": "Welcome to UniSMS",
    "created": "2026-03-16T14:32:44Z",
    "reference_id": "msg_84e8b93b-6315-46af-a686",
    "fail_reason": null,
    "recipient": "+639055310560"
  }
}

Message Statuses

pending retrying sent failed

Response Codes

200 OK 401 Unauthorized 404 Not Found

Webhooks

Webhooks allow you to receive real-time notifications when SMS messages are processed. Instead of polling the API for status updates, you can configure a webhook URL to receive HTTP POST requests whenever an event occurs.

Configuring Webhooks

To receive webhooks, configure your webhook URL in the dashboard. Your URL must:

  • Use HTTPS (secure endpoint)
  • Be publicly accessible
  • Accept POST requests

Event Types

Event Description
message.sent Triggered when an SMS is successfully sent
message.failed Triggered when SMS sending fails
message.retrying Triggered when the system is retrying to send SMS

Payload Structure

All webhook payloads follow a consistent structure:

{
  "id": "msg_84e8b93b-6315-46af-a686",
  "message": {
    "status": "sent",
    "metadata": {},
    "content": "Welcome to UniSMS",
    "created": "2026-03-16T14:32:44Z",
    "reference_id": "msg_84e8b93b-6315-46af-a686",
    "fail_reason": null,
    "recipient": "+639055310560"
  },
  "event": "message.sent"
}

Payload Fields

Field Type Description
event string The event type (e.g., "message.sent")
id string The reference ID of the message
message object The full message object with current status

PHP SDK

The official UniSMS PHP SDK for sending and retrieving SMS messages. Built with Vanilla PHP - no external dependencies required.

Installation

Download the UniSms.php file from the GitHub repository and require it in your project.

Send a Message

<?php

require_once './UniSms.php';

$secret_key = "sk_XXXXXXXXXXXXXXXXXXXXXXXXX";

$client = new UniSms($secret_key);
$client->recipient = "+63912345678";
$client->content = "Hello world";

// Send message
print_r($client->send());

Get a Message

<?php

require_once './UniSms.php';

$secret_key = "sk_XXXXXXXXXXXXXXXXXXXXXXXXX";

$client = new UniSms($secret_key);

// Get a message
print_r($client->get("msg_b788f2bf-5816-47c1-8eb0-f018a699d7bc"));

Custom SenderID

Send SMS with your brand name instead of our default SenderID. Instead of "UnisoftSMS", your recipients will see your custom brand identifier (e.g., "MyBusiness").

Custom SenderID

Send SMS with your brand name

A SenderID is the identifier that appears when recipients receive your SMS. Instead of our SenderID (UnisoftSMS), they'll see your brand name (e.g. "MyBusiness").

Example:

From: UnisoftSMS

With SenderID: MyBusiness

Available for verified businesses only. Contact us to apply.

Apply via Email

Quick Start

Get your API key from the dashboard, then make your first request:

curl -X POST https://unismsapi.com/api/sms \
    -u your_api_key: \
    -H "Content-Type: application/json" \
    -d '{"recipient": "+639123456789", "content": "Hello!"}'