Developers

OneTouch SMS & Email API

Send SMS and email from your own app — sign-up codes, welcome emails, alerts and receipts — with one HTTPS request.

You need a OneTouch account with an active plan and tokens. Create an API key in Dashboard → Developer API.

1. Quick start

Send this from your server:

curl -X POST https://neo1touch.com/api/v1/sms.php \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"to": "+2348031234567", "message": "Welcome to MyApp! Your code is 482913"}'

A successful reply:

{
  "success": true,
  "data": {
    "message_id": "3017544054459094834646",
    "status": "sent",
    "recipients": 1,
    "pages": 1,
    "tokens_charged": 6,
    "balance": 9814,
    "sender": "MyBrand",
    "reference": null
  }
}

2. Authentication

Every request carries your API key in a header — either form works:

Authorization: Bearer ot_live_…
X-API-Key: ot_live_…

3. Send SMS

POST https://neo1touch.com/api/v1/sms.php

JSON body:

FieldTypeRequiredDescription
tostring or arrayYesOne number, or up to 100. International format such as +2348031234567; Nigerian local numbers (08031234567) are accepted too.
messagestringYesThe SMS text, up to 6 SMS pages (see Pricing).
referencestringNoYour own id (up to 64 characters), echoed back and shown in your OneTouch log.

SMS go out from your account’s approved Sender ID (request one in OneTouch → SMS Sender ID) through the DND route, so they also reach numbers on Do-Not-Disturb — right for sign-up and login codes.

4. Send email

POST https://neo1touch.com/api/v1/email.php
curl -X POST https://neo1touch.com/api/v1/email.php \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"to": "ada@example.com", "subject": "Welcome to MyApp", "html": "<h1>Welcome, Ada!</h1><p>Your account is ready.</p>", "reply_to": "support@myapp.com"}'
FieldTypeRequiredDescription
tostring or arrayYesOne address, or up to 50. Each person gets their own email; they don’t see each other.
subjectstringYesUp to 200 characters.
htmlstringOne of html/textThe email as HTML (up to 300 KB). Scripts, forms and embedded frames are removed. Pictures must be online links (https://…).
textstringOne of html/textA plain-text version. Send both if you can; if you send only one, we make the other.
from_namestringNoThe sender name people see. Defaults to the organisation name on the OneTouch account.
reply_tostringNoWhere replies go, e.g. your support address.
referencestringNoYour own id (up to 64 characters), echoed back.

A successful reply lists each recipient:

{
  "success": true,
  "data": {
    "status": "sent",
    "sent": 1,
    "failed": 0,
    "results": [ { "to": "ada@example.com", "status": "sent", "id": "4ef9a417-…" } ],
    "tokens_charged": 1,
    "balance": 9813,
    "from": "MyApp",
    "reference": null
  }
}

With several recipients, status is "partial" when some failed; you’re charged only for the ones sent. Emails come from OneTouch’s sending address with your name as the sender. The API is for transactional email (codes, welcomes, receipts, alerts) — not newsletters or marketing lists; use OneTouch broadcasts for those, which handle unsubscribes.

5. Check your balance

GET https://neo1touch.com/api/v1/balance.php
{ "success": true, "data": { "balance": 9814, "tokens_per_sms_page": 6, "tokens_per_email": 1, "sender": "MyBrand", "plan_active": true } }

6. Errors

Errors use HTTP status codes and this shape: {"success": false, "error": {"code": "…", "message": "…"}}. Show your users your own message; log ours.

HTTPcodeMeaning
400invalid_bodyThe body isn’t JSON with to and message.
401invalid_api_keyMissing, wrong or revoked key.
402plan_requiredThe account has no active plan.
402insufficient_tokensNot enough tokens — top up in OneTouch. Nothing was sent.
405method_not_allowedWrong HTTP method.
422message_required, message_too_long, invalid_recipient, subject_required, content_required, content_too_large, invalid_html, invalid_reply_toFix the request; the message says what’s wrong.
429rate_limitedOver 120 messages (SMS + email) a minute for this key. Wait and retry (see Retry-After).
502send_failedThe SMS network or email service refused it (for SMS, often the Sender ID). Nothing was charged.
500server_errorA problem on our side. Retry later.

7. Pricing and limits

8. Example: send a code when someone registers

Generate the code on your server, store it with an expiry, send it, then check what the user types.

<?php
// After saving the new user:
$code = random_int(100000, 999999);
// save $code (hashed) with an expiry of e.g. 10 minutes against the user …

$ch = curl_init('https://neo1touch.com/api/v1/sms.php');
curl_setopt_array($ch, [
    CURLOPT_POST           => true,
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_TIMEOUT        => 30,
    CURLOPT_HTTPHEADER     => ['Authorization: Bearer ' . getenv('ONETOUCH_API_KEY'), 'Content-Type: application/json'],
    CURLOPT_POSTFIELDS     => json_encode([
        'to'        => $user['phone'],
        'message'   => "Welcome to MyApp! Your verification code is $code. It expires in 10 minutes.",
        'reference' => 'signup-' . $user['id'],
    ]),
]);
$res    = json_decode(curl_exec($ch), true);
$status = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

if ($status !== 200 || empty($res['success'])) {
    error_log('OneTouch SMS failed: ' . ($res['error']['message'] ?? "HTTP $status"));
    // let the user ask for a new code
}

A welcome email is the same request to /email.php with to, subject and html instead of message.

9. Good practice

Need help?

Email admin@httn.org with your account email and the reference or time of the message.