Skip to main content
MrAshitey SMS
API Documentation

SMS API Integration Guide

Build SMS into websites, apps and business systems with a secure REST API and the MrAshitey SMS WordPress Connector.

Fast messagingProfessional dashboardSecure integrations
REST API v1.0

One API for messaging from your own software.

Server-to-server integration with account-specific API keys, approved Sender IDs, wallet billing and idempotency protection.

BASE URLhttps://sms.mrashitey.org/wp-json/mrashitey-sms/v1/
Overview

Start with an API key, then call the endpoint you need.

Create the key in the customer portal under Developer API. Keep it on your server. Every accepted message uses that workspace's SMS-credit wallet and an approved Sender ID.

Authentication

Bearer token

Authorization: Bearer YOUR_API_KEYYou can also use the X-Mrashitey-Key header.
Rate limit

120 requests/minute

Applied per active API key.

Numbers

International format

Use a complete number such as +23324XXXXXXX.

Security

Never expose API keys client-side.

Keep keys in backend code, environment variables or a secrets manager.

GET/connection

Test the key and retrieve account status, balance and approved Sender IDs.

GET/balance

Return the current SMS-credit balance.

GET/sender-ids

Return approved Sender IDs available to the integration.

POST/messages

Submit one SMS using the workspace wallet and approved Sender ID.

Authentication

Verify the connection before sending.

Use /connection after saving a key in your application. A successful response confirms that the key is valid, the workspace is active and shows the current wallet balance and approved Sender IDs.

Keep your key secret

Never expose a masms_... key in browser JavaScript, a public mobile app bundle or a public repository.

GET/connection
curl -s \
  -H "Authorization: Bearer YOUR_API_KEY" \
  "https://sms.mrashitey.org/wp-json/mrashitey-sms/v1/connection"
200 Connected
{
    "ok": true,
    "platform": "MrAshitey SMS",
    "account_status": "active",
    "sms_credits": 250,
    "approved_sender_ids": [
        "MYBRAND"
    ],
    "api_version": "v1"
}
Send SMS

Request parameters.

POST /messages accepts JSON. The Sender ID must already be approved for the customer workspace.

Field / HeaderTypeRequiredDescription
tostringYesRecipient in complete international format, for example +23324XXXXXXX.
senderstringYesAn approved Sender ID returned by /sender-ids.
messagestringYesSMS body. Long GSM-7 and Unicode messages can consume multiple credits.
Idempotency-KeyheaderRecommendedReuse the same key when retrying the same business event to prevent accidental duplicate sends.
Response format

Accepted does not automatically mean delivered.

A 201 means MrAshitey SMS accepted the message request. Final handset delivery is shown only when verified delivery confirmation is available.

201Message accepted
{
    "ok": true,
    "message_uuid": "ef00b87b-d527-4c17-b0b8-20c2762e512a",
    "provider_reference": "",
    "recipient": "+23324XXXXXXX",
    "parts": 1,
    "credits_used": 1
}
Wallet billing

Credits are charged by message parts.

The API returns parts and credits_used. A Unicode or multipart message can use more than one SMS credit.

Delivery state

Store the message UUID.

Use the returned message_uuid in your own application records. Do not display “Delivered” unless your workflow receives verified delivery confirmation.

Code examples

Use the API from your backend.

Each example stays inside its own scrollable code window on desktop and mobile.

cURLCommand line
curl -s -X POST \
  "https://sms.mrashitey.org/wp-json/mrashitey-sms/v1/messages" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: order-10045-ready" \
  -d '{
    "to": "+23324XXXXXXX",
    "sender": "MYBRAND",
    "message": "Your order is ready."
  }'
PHPcURL extension
$payload = json_encode([
    "to" => "+23324XXXXXXX",
    "sender" => "MYBRAND",
    "message" => "Hello from MrAshitey SMS",
]);

$ch = curl_init("https://sms.mrashitey.org/wp-json/mrashitey-sms/v1/messages");
curl_setopt_array($ch, [
    CURLOPT_POST => true,
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_HTTPHEADER => [
        "Authorization: Bearer YOUR_API_KEY",
        "Content-Type: application/json",
        "Idempotency-Key: customer-event-123",
    ],
    CURLOPT_POSTFIELDS => $payload,
]);
$response = curl_exec($ch);
curl_close($ch);
Pythonrequests
import requests

url = "https://sms.mrashitey.org/wp-json/mrashitey-sms/v1/messages"
headers = {
    "Authorization": "Bearer YOUR_API_KEY",
    "Idempotency-Key": "customer-event-123",
}
payload = {
    "to": "+23324XXXXXXX",
    "sender": "MYBRAND",
    "message": "Hello from MrAshitey SMS",
}

response = requests.post(url, json=payload, headers=headers)
print(response.status_code)
print(response.json())
Node.jsfetch
const response = await fetch("https://sms.mrashitey.org/wp-json/mrashitey-sms/v1/messages", {
  method: "POST",
  headers: {
    "Authorization": "Bearer YOUR_API_KEY",
    "Content-Type": "application/json",
    "Idempotency-Key": "customer-event-123"
  },
  body: JSON.stringify({
    to: "+23324XXXXXXX",
    sender: "MYBRAND",
    message: "Hello from MrAshitey SMS"
  })
});

console.log(response.status, await response.json());
WordPress Connector

Connect WordPress without giving the site your central gateway credentials.

The separate MrAshitey SMS Connector authenticates to this platform with a customer API key. The connected site uses the customer workspace wallet and approved Sender IDs, while upstream gateway credentials remain only on the central MrAshitey SMS server.

Ready to install?

Download the connector ZIP, then upload it under Plugins → Add New Plugin → Upload Plugin on the WordPress site you want to connect.

Download WordPress Connector v1.0.2 ↓

01

Install

Upload and activate the MrAshitey SMS Connector on the WordPress or WooCommerce site that will send messages.

02

Platform URL

Open MrAshitey SMS → Connection and keep the platform URL as https://sms.mrashitey.org.

03

Create a site key

In the central customer portal, create a dedicated API key for that WordPress website. Use a separate key per site.

04

Pair the connector

Paste the masms_... key into the connector, save it and run Test connection.

05

Choose Sender ID

Select one of the approved Sender IDs returned by the connected workspace.

06

Enable only what you need

Turn on the WordPress/WooCommerce notification features required by that website.

SUPPORTED WORKFLOWS

What the connector can power

WooCommerceOrder-status SMS for pending payment, processing, on hold, completed, cancelled, refunded and failed orders when those notifications are enabled.
Contact Form 7Send configured customer and administrator SMS notifications after matching form submissions.
WordPress account eventsUse configured account-related SMS notifications such as registration/password events supported by the connector.
OTP shortcodePlace [mrashitey_sms_otp] where the connector OTP flow is required.
Custom WordPress integrationUse the connector server-side helper/integration layer so custom code does not need the central gateway API key.
BILLING & SECURITY

How connected sites behave

Shared customer walletAccepted connector messages deduct SMS credits from the connected MrAshitey SMS customer workspace.
Approved Sender IDs onlyThe connector can use only Sender IDs approved for that customer account.
One API key per siteIf one website is retired or compromised, revoke only that site's key without breaking the customer's other integrations.
No upstream credentialsThe WordPress website never receives or stores the platform's upstream gateway API key.
Test before launchRun Test connection, confirm balance/Sender IDs, then send a controlled SMS to a number you own before enabling production notifications.
Recommended production setup

Give each WordPress website its own API key and descriptive label, for example School website or WooCommerce store. Revoke a key immediately when that site no longer needs SMS access.

Response codes

HTTP responses your integration should handle.

Use the HTTP status and JSON message together. Customer-facing software should show your own friendly wording rather than exposing internal implementation details.

HTTPMeaningRecommended action
200Connection, balance or Sender-ID request succeededRead the JSON response and continue.
201Message acceptedStore the returned message UUID and credits used. Do not label it delivered yet.
400Invalid send requestCorrect the number, message, Sender ID or request fields before retrying.
401Invalid, revoked or expired API keyStop sending and replace/re-authorise the credential.
403Workspace is not active or operation is unavailableCheck account status and permissions.
429Rate limit reachedBack off and retry later. The current limit is 120 authenticated requests per key per minute.
Production checklist

Before you go live.

Protect keys

Store API keys server-side. Never commit them to a public repository.

Use idempotency

Reuse the same Idempotency-Key when retrying the same business event.

Check balance

Read /balance or /connection when your app needs to warn about low SMS credits.

Query Sender IDs

Use /sender-ids instead of hard-coding an unapproved identity.

Handle multipart SMS

Expect parts/credits_used to be greater than one for long or Unicode messages.

Do not fake delivery

A successful API submission is Provider accepted until verified delivery confirmation exists.

API key management

Create, rotate and revoke keys from your customer portal.

Treat every API key like a password and create separate credentials for separate applications or WordPress websites.

Open customer portal →