MENA | HTTP API
Contact
Showing 12 of 471 Results

HTTP API

Introduction

This document provides a reference for all features available to you via the HTTP interface for sending SMS.

The HTTP-API allows you to integrate your application (client) to SMSGlobal (vendor) using the HTTP protocol to send SMS. HTTPS is also supported for secure transactions using SSL encryption.

The Client issues either a HTTP GET or POST request to the SMSGlobal HTTP interface supplying a list of required parameters. SMSGlobal issues back a HTTP response which indicates the validity of the transaction.

The HTTP-API is used for one-way messaging only. Therefore, you need to provide a valid MSISDN as the Sender ID of the message to enable the recipient to respond.

HTTP API Features

  • Custom Sender ID
  • Dedicated Virtual Numbers
  • Delivery Receipt Notifications via Email/SMS
  • Recipient OPT Out Option
  • 24/7 support via our support team

API Endpoint

The HTTP API can be accessed at https://api.smsglobal.com/http...

Note: You'll need your MXT account username and password to authenticate with the API

Postman Collection

Get started quickly with our Postman Collection for our API

Includes our REST, HTTP, SOAP and OTP API, with authentication scripts will get you sending messages in minutes.

HTTP Parameters

Below is a list of parameters when issuing a HTTP request.

ParameterDescriptionPresence
actionAction to be taken. [Default: sendsms]Mandatory
userYour SMSGlobal usernameMandatory
passwordYour SMSGlobal passwordMandatory
fromMSIDSN or Sender ID that the message will appear from. Eg: 61409317436 (Do not use +before the country code). 
Origin number must be verified before sending SMS https://knowledgebase.smsglobal.com/how-to-verify-numbers-in-mxt-smsglobal-help-center
Mandatory
toMSIDSN of the recipient that the message will be sent to. Eg: 61409317436 (Do not use + before the country code)Mandatory
text

Message to be sent. Must be URL encoded.

Sending unicode messages such as Chinese or Arabic, needs to have the text encoded three times

Mandatory
maxsplitEnables splitting of message if text exceeds 160 characters. Specifies number of times allowed to split.Optional
scheduledatetimeTo schedule the message to be sent sometime/date in the future. Time/Date format is: “yyyy-mm-dd hh:mm:ss” which must be URL encoded. - The time must be in AEDTOptional
optoutThe optout=1 parameter for HTTP API to exclude opted out numbers.Optional
global_optoutThe global_optout=1 parameter for HTTP API to exclude global opted out numbers.Optional
apiapi=1 will enable shared numbers.Optional
apireplyapireply=1 will ensure the replies are pushed out to the account e-mail address.Optional

HTTP Response

The HTTP response from SMSGlobal contains the following:

  • Status Code
  • Sent Queued Message ID (Internal use only)
  • SMSGlobalMsgId
  • Error message (if present)

Status Codes

If the message has been sent successfully the status code will return OK: 0

Example:

OK: 0; Sent queued message ID: 941596d028699601 SMSGlobalMsgID:6764842339385521

If the message was unable to be delivered it will return ERROR: {Status code} {Error Msg}

Example:
ERROR: Missing parameter: from
Examples

Below are example requests when using the HTTP interface.

Example Request

Username : testuser

Password : secret

From: Test

To : 61447100250

Message : Hello World

Request:
https://api.smsglobal.com/http-api.php?action=sendsms&user=testuser&password=secret&from=Test&to=61447100250&text=Hello%20world
Output:
OK: 0; Sent queued message ID: 941596d028699601 SMSGlobalMsgID:6764842339385521

Scheduling an SMS

It is possible to schedule delivery of a message to be sent at a specified date and time in the future. This is done by using the scheduledatetime parameter in your request.

Time/Date format is: “yyyy-mm-dd hh:mm:ss”

Note: Date/time must be URL Encoded.

Username : testuser

Password : secret

From: Test

To : 61447100250

Message : Hello World

Schedule Date : 10th Jan, 2010 at 3pm

Request:
https://api.smsglobal.com/http-api.php?action=sendsms&user=testuser&password=secret&from=Test&to=61447100250&text=Hello%20world&scheduledatetime=2010-01-10%2015%3A00%3A00
Output:
SMSGLOBAL DELAY MSGID:19736759

Note: A SMSGlobal Delay MSG ID is not the same as a SMSGlobal Message ID.

Status Codes

ParameterDescription
delivrdThe message has been received by the handset.
expiredThe carrier has timed out.
undelivThe messages failed to reach the handset.

Information on Unicode

Is your message splitting into multiple parts without MAXSPLIT?

Multi-Part Message Knowledgebase Article

Incoming SMS

Please find below a list of available parameters.

ParameterDescriptionLimitationMandatory
actionAction to be taken. [Default: sendsms] Mandatory
userYour SMSGlobal username Mandatory
passwordYour SMSGlobal password Mandatory
toMSIDSN of Recipient that the message will be going to.Eg: 61409317436 (Do not use + before the country code) Mandatory
textMessage to be sent. Mandatory
apiEnables 2-way messaging. [Default: 1]1 = enabled0 = disabled Mandatory
maxsplitEnables splitting of message if text exceeds 160 characters. Specifies number of times allowed to split. [Default: 1] Optional
userfieldCustom Field within which you can store internal ID or other information that you want returned to you with any reply to your outgoing SMS.Max 255 CharactersOptional

Incoming SMS HTTP Post Back

If you would like notifications of Incoming SMS messages to be pushed to your server, please ensure you specify a URL in your account settings.

In order for our system to know that your URL has received the delivery notice, at the end of your script you must echo out “OK”. The post back response time is restricted to five seconds. If the specified URL does not return ‘OK’ within five seconds of being sent, the request will be marked as incomplete and the process will be repeated.

Please find below the list of parameters that are sent.

ParameterDescription
toMobile Terminated Number, where the message was sent to
fromMobile Originated Number, where the message was sent from
msgContents of the message
userfieldUnique userfield passed in the original request
dateDate the message was received by SMSGlobal.

Important Information If You Have Dedicated Numbers

Often it is practical to have all SMS traffic sent from the same number each time. This makes it easier for recipients to reply to your message and to send message campaigns.

A dedicated number works like a normal mobile number. Once you have purchased one you will be able to receive text messages to it as you would a regular mobile number. Friends, customers or anybody with a mobile will be able to send SMS text messages to you via this number.

Note: When you start using 2 way SMS and dedicated numbers, the userfield no longer works and is ignored on the API.

Schedule A Demo

Live demonstations of our MXT platform are conducted over Google Meets by our friendly tech support team and generally take 15mins.