Snipnet SMS API


HTTP API

This documentation will provide instructions on how to quickly integrate Snipnet SMS messaging services into various solutions by using Snipnet HTTP API. Snipnet API is based on REST standards. In order to interact with our API, any HTTP client in PHP programming language can be used.

How to get started

Easy. Only two steps actually:

1. Create a Snipnet account
In order to use our API, you will need credentials. These are not used only for API but also for other Snipnet services like Snipnet Projects. If you already have an Snipnet account you can skip this step. Otherwise, follow this link:

Create new account

2. Test your account by sending a text message to yourself
The best way to check if your account is operational is to test it, and the best way to test it is to send an SMS to your own phone. Use this simple API call to send your first message.

Our base URL for all API calls is POST https://snipnetworks.com

Endpoint for sending simple SMS is

POST https://snipnetworks.com/gateway/RESTAPI/sms/write.php


Parameters
Property name Type Description
method string This represents your domain name and can be retrived by default using PHP $_SERVER['SERVER_NAME']

user_email string Response message will be deliverd to the email address retrieved from this string (example: someone@example.com).

api_key string Represents your license ID, this can be found on your license panel (example: Y0E3-V4E4-Q7L6-O7U0-I6C2-T4O5).

senderid string Represents sender ID and it can be alphanumeric or numeric. Alphanumeric sender ID length should be between 3 and 11 characters (example: CompanyName). Numeric sender ID length should be between 3 and 14 characters.

phone string Represents Destination address and must be in international format (example: 233547946168).
message string Text of the message that will be sent.

report string This will output a JSON response. If successful, the response header HTTP status code will be 200 OK and the message will be sent. If you try to send a message without authorization, you will receive an error 401 Unauthorized. This string is optional


Request Example
<?php
//extract data from the post
extract($_POST);
$fields = array(
            'method' => $_SERVER['SERVER_NAME'],
            'user_email' => "",
            'api_key' => "xxxx-xxxx-xxxx-xxxx-xxxx-xxxx",
            'senderid' => "Snipnet",
            'phone' => "233547946168",
            'message' => "This is a test message"
              );
//set POST variables
$url = 'https://snipnetworks.com/gateway/RESTAPI/sms/write.php';

//url-ify the data for the POST
$fields_string = http_build_query($fields);

//open connection
$ch = curl_init();
curl_setopt($ch,CURLOPT_URL, $url);
curl_setopt($ch,CURLOPT_POST, 1);
curl_setopt($ch,CURLOPT_POSTFIELDS, $fields_string);
curl_exec ($ch);
curl_close($ch);