HTTP Application Programming Interface



Similar documents
Technical documentation

AMD Telecom SMS GATEWAY HTTP API INTERFACE. Technical Specifications

Documentation for the SMSWay API v1.5. API for SMSWay Gateway. Documentation for the SMSWay API v

SIM Configuration Guide. February 2015 Version 1 Document Reference: 8127

MAIL1CLICK API - rel 1.35

HTTP/SOAP Application Program Interface (API) Version 1.0

This document is to provide help and illustrations to users who wish to deliver SMS using the Pinnacle SMS Gateway via the HTTP Protocol.

Spryng Making Business Mobile (0) Spryng Headquarters: Herengracht BW Amsterdam - The Netherlands

Messaging API. API Specification Document Messaging API. Functionality: Send SMS Messages.

MSDG Services Integration Document Draft Ver 1.2

HTTP API Specification Version 2.1

Advanced HTTP API Documentation

This section will describe the different functions that can be used by the Interspire Marketer XML API.

Spryng Making Business Mobile Mobile Terminated Premium SMS Gateway. Contents:

Technical Specification Normal SMS gateway

FTP API Specification V2.6

Technical Specification Premium SMS gateway

Diafaan SMS Server 3.0 Manual Diafaan communication software

GTX Mobile Messaging SMS Gateway Interface Simple HTTP API Manual

USING MYWEBSQL FIGURE 1: FIRST AUTHENTICATION LAYER (ENTER YOUR REGULAR SIMMONS USERNAME AND PASSWORD)

Web Service Integration

MXSAVE XMLRPC Web Service Guide. Last Revision: 6/14/2012

XML Processing and Web Services. Chapter 17

Information on SMS interface (As at March 31 th 2009) Delivery is possible to both mobile subscribers worldwide and the German fixed network

ResellerPlus - Bulk Http API Specification. (This Document gives details on how to send messages via the Bulk HTTP API for the RouteSms SMPP System)

MyMobileAPI. mymobileapi.com

Now SMS/MMS Android Modem Quick Start Guide

A RESTful Web Service Interface to the ATLAS COOL Database

BulkSMS API Document. Contents. 1 P a g e. API Version: 5.9 Document Version: 2.0 Last Updated Date: 31st July 2013

Advanced API. Contents: Description. Address Book Management. Bulk SMS Sending and Distribution Lists. Error Codes

API Guide v /11/2013

InTime API - Exempel kod

API Integration Payment21 Button

THE CHALLENGE OF ADMINISTERING WEBSITES OR APPLICATIONS THAT REQUIRE 24/7 ACCESSIBILITY

NASDAQ Global Index Watch (GIW) Secure Web Service 2.0 Access

Capturx for SharePoint 2.0: Notification Workflows

ipayment Gateway API (IPG API)

NYSP Web Service FAQ

Developing Mobile Services for Joomla! 1.5

Add / Update Ticket API using POST XML

Quick Start Guide Now SMS/MMS Gateway

Issue 2EN. Nokia and Nokia Connecting People are registered trademarks of Nokia Corporation

UPG plc Atlas Technical Integration Guide

TWO-WAY & SMS MESSAGING SMS WEB SERVICE. Product White Paper. Website: Telephone: enquiries@m-science.

IP Phone Service Administration and Subscription

UFTP AUTHENTICATION SERVICE

Fairsail REST API: Guide for Developers

User-ID Features. PAN-OS New Features Guide Version 6.0. Copyright Palo Alto Networks

Copyright Notice. ISBN: N/A SWsoft Sunrise Valley Drive Suite 600 Herndon VA USA Phone: +1 (703) Fax: +1 (703)

HireDesk API V1.0 Developer s Guide

Technical Specification ideal

Unifaun XMLPosting

IBM Unica emessage Version 8 Release 6 February 13, User's Guide

IBM Campaign and IBM Silverpop Engage Version 1 Release 2 August 31, Integration Guide IBM

TED 5000 Third Party Posting API

Secure XML API Integration Guide - Periodic and Triggered add in

Secure Hosting and Payments Technical Integration Guide

API documentation - 1 -

Contents. 2 Alfresco API Version 1.0

MONETA.Assistant API Reference

SQL Injection Attack Lab Using Collabtive

Web Forms for Marketers 2.3 for Sitecore CMS 6.5 and

1 Overview Configuration on MACH Web Portal 1

DocuSign Connect Guide

State of Michigan Data Exchange Gateway. Web-Interface Users Guide

Chapter 22 How to send and access other web sites

Version 1.0. ASAM CS Single Sign-On

NEMSIS v3 Web Services Guide

Jobs Guide Identity Manager February 10, 2012

VIDEO intypedia007en LESSON 7: WEB APPLICATION SECURITY - INTRODUCTION TO SQL INJECTION TECHNIQUES. AUTHOR: Chema Alonso

CRM Form to Web. Internet Lead Capture. Product Registration Instructions VERSION 1.0 DATE PREPARED: 1/1/2013

SMS Service Reference

Cite My Data M2M Service Technical Description

Integration Client Guide

Service for checking whether an is operative or not. Validate ids in your databases.

Example for Using the PrestaShop Web Service : CRUD

AS DNB banka. DNB Link specification (B2B functional description)

HTTP/HTTPS/XML API Hand Book

HTTP Reverse Proxy Scenarios

JobScheduler Web Services Executing JobScheduler commands

Specify the location of an HTML control stored in the application repository. See Using the XPath search method, page 2.

PROQUEST BULK SMS USER GUIDE

PHP Integration Kit. Version User Guide

KMx Enterprise: Integration Overview for Member Account Synchronization and Single Signon

SIX Trade Repository AG

Tableau Server Trusted Authentication

Issue 1 EN. Nokia and Nokia Connecting People are registered trademarks of Nokia Corporation

Comparison of WAP Push and Short Message Service (SMS)

2sms SMS API Overview

IoT-Ticket.com. Your Ticket to the Internet of Things and beyond. IoT API

SRFax Fax API Web Services Documentation

KPN SMS mail. Send SMS as fast as !

SME- Mail to SMS & MMS Gateway with NowSMS Quick Start Guide

This Annex uses the definitions set out in the Agreement on service of payment cards on the Internet (hereinafter the Agreement).

Installing, Uninstalling, and Upgrading Service Monitor

Transcription:

HTTP/API SPECIFICATION Technical Documentation HTTP Application Programming Interface Prepared by Olutola M Obembe Primax Technologies Limited

Contents 1. Introduction 2. HTTP Application Programming Interface 2.1 Introduction 2.2 Message Submission 2.2.1 HTTP GET 2.2.1.1 Query String Parameters 2.2.1.2 Return Values 2.2.2 HTTP XML POST 2.2.2.1 XML 2.2.2.2 Parameter Specifications 2.2.2.3 Return XML 2.2.2.4 Examples 2.3 Delivery Reports 2.3.1 PUSH METHOD 2.3.2 PULL METHOD

1. Introduction This document provides developers with instructions for integrating SMS messaging services into various solutions using smsbag HTTP application programming interface (HTTP API). smsbag HTTP API can be used for sending SMS messages, collecting delivery reports, receiving SMS messages, and LONG code solutions. It describes smsbag HTTP API methods, URLs and parameters needed as well as providing samples. The following methods are available Send messages using HTTP XML POST Send messages using HTTP GET Collection of Delivery Reports via XML format

2. HTTP Application Programming Interface 2.1 Introduction The smsbag system offers various methods to send and receive SMS messages. This chapter contains specifications for the following methods. Send messages using HTTP XML POST: This method allows one to send SMS messages to a number of recipients using the XML-formatted data sent to a corresponding URL. Send messages using HTTP GET: Similar to the HTTP XML POST, this method allows sending messages passing parameters directly as query string variables via HTTP GET. Collection of Delivery Reports This gives you the ability to collect XML formatted delivery reports from sent messages using either the push (HTTP POST) to a predefined call-back URL or the pull method by making HTTP GET request to a corresponding URL. 2.2 Message Submission 2.2.1 HTTP GET The URL used to send messages via HTTP GET is Data Centre 1: http://api.smsbag.com/api/sendsms/plain Data Centre 2: http://api2.smsbag.com/api/sendsms/plain Examples of normal SMS message http://api.smsbag.com/api/sendsms/plain?user=user&password=pass&sender=sender&sm SText=New_Message&GSM=2348062741555

2.2.1.1 Query String Parameters 2.2.1.2 Return Values user Client Username for smsbag system password Client Password for smsbag system sender Dynamic message Sender ID Alphanumeric : max 11 characters Numeric: max 14 xharacters SMSText Message body (160 characters for 1 message) GSM Recipient GSM number in International format IsFlash Can be 0 or 1 0 sends a normal SMS 1 sends a Flash SMS Type Optional Parameter To send WAP bookmarks: value bookmark To send concatenated SMS: value longsms bookmark WAP PUSH content Example: www.smsbag.com/pix.jpg Binary Binary content using hexadecimal format Example 410A0D4245 Cannot be used together wit text parameter Value Description -2 NOT_ENOUGH_CREDITS -3 NETWORK_NOT_COVERED -5 INVALID_USER_OR_PASS -6 MISSING_DESTINATION_ADDRESS -7 MISSING_SMSTEXT -8 MISSING_SENDERNAME -9 DESTADDR_INVALIDFORMAT -10 MISSING_USERNAME -11 MISSING_PASS -13 INVALID_DESTINATION_ADDRESS >0 SUCCESSFUL

2.2.2 HTTP(S) XML POST The URL used to post XML formatted data is Data Centre 1: http://api.smsbag.com/api/sendsms/xml Data Centre 2: http://api2.smsbag.com/api/sendsms/xml 2.2.2.1.1 XML The XML formatted string must have XML= at the beginning. There are two ways of formatting the XML String. Without Registered Delivery <SMS> <authentication> <username></username> <password></password> </authentication> <message> <sender></sender> <text></text> <flash></flash> <type></type> <wapurl></wapurl> <binary></binary> </message> <recipients> <gsm></gsm> <gsm></gsm> </recipients> </SMS> With Registered Delivery <SMS> <authentication> <username></username> <password></password> </authentication> <message> <sender></sender> <text></text> <flash></flash> <type></type> <wapurl></wapurl> <binary></binary> </message> <recipients> <gsm messageid= msgid1 ></gsm> <gsm messageid= msgid2 ></gsm> </recipients> </SMS> As shown in the XML formats described above. XML formatted with delivery contains a different <gsm> tag which includes the messageid attribute. That is the main difference between these two formats and it means that when using XML formatted without registered delivery, it is possible to collect delivery reports from sent SMS messages but those reports will have messageid generated by the smsbag system. Therefore connecting delivery reports with its SMS message will not be possible.

One the other hand, when using XML formatted with registered delivery, each delivery report will contain the messageid attribute with a value equal to the value of the messageid attribute defined by the client in <gsm> tags of every recipient in XML formatted with registered delivery. This is useful if the client wants to collect delivery reports for specific SMS messages and it can be done by using the messageid of those messages. 2.2.2.2 Parameter Specifications Authentication Message Recipients username Client Username for smsbag system password Client Password for smsbag system sender Dynamic message Sender ID Alphanumeric : max 11 characters Numeric: max 14 xharacters text Message body (160 characters for 1 message) flash Can be 0 or 1 0 sends a normal SMS 1 sends a Flash SMS type Optional Parameter To send WAP bookmarks: value bookmark To send concatenated SMS: value longsms wapurl WAP PUSH content Example: www.smsbag.com/pix.jpg binary Binary content using hexadecimal format Example 410A0D4245 Cannot be used together wit text parameter GSM Message destination address, must be in international format without leading 0s or + E.g 2348062741555 GSM messageid= msid Registered delivery messageid set by client

2.2.2.3 Return XML After the POST XML is initiated by the client, some status codes will be available. The return XML string format will be: <RESPONSE> <status>status_code</status> <credits>credit_amount</credits> </RESPONSE> Status Codes STATUS VALUE DESCRIPTION AUTH_FAILED -1 Invalid username and/or password XML_ERROR -2 Incorrect XML format NOT_ENOUGH_CREDITS -3 Not enough credits in user account NO_RECIPIENTS -4 No good recipients GENERAL_ERROR -5 Error in processing your request SEND_OK >0 Number of messages that will be sent 2.2.2.4 Example [PHP using CURL] <?php // smsbag s POST URL $posturl = "http://api2.smsbag.com/api/sendsms/xml"; // XML-formatted data $xmlstring = "<SMS> <authentification> <username> </username> <password></password> </authentification> <message> <sender>friend</sender> <text>message from your friend!</text> </message> <recipients>

With registered Delivery <gsm messageid=\"760909090922222\">2348062741555</gsm> <gsm messageid=\"1760808080911111\">2348065246516</gsm> Or Without Registered Delivery <gsm >2348062741555</gsm> <gsm >2348065246516</gsm> </recipients> </SMS>"; // previously formatted XML data becomes value of "XML" POST variable $fields = "XML=". urlencode($xmlstring); // in this example, POST request was made using PHP's CURL $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $posturl); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_POSTFIELDS, $fields); // response of the POST request $response = curl_exec($ch); curl_close($ch); // write out the response echo $response;?> 2.3 Delivery Reports With this API method you can collect sent SMS delivery reports (by using one of two sending SMS messages methods described above). As soon as delivery reports for sent messages are received in the smsbag system, they will be forwarded to you as an XML formatted string. If you used a POST sending method with XML data formatted with registered delivery, each delivery report will have the same messageid attribute as the message for which it is being sent. If you used the POST method with XML data formatted without registered delivery or the GET method, the messageid attribute of collected delivery reports will be generated by the smsbag system.

There are two methods of collecting delivery reports: PUSH and PULL. 2.3.1 PUSH METHOD To be able to receive delivery report via the PUSH method, you will need to specify a delivery URL to us to configure. If your delivery report URLis unavailable for any reason, another attempt to forward the delivery report will be made in 60 seconds, another in five minutes and subsequently every hour for the next 24 hours. If your URL is not available for the entire time, the delivery report will be lost. The format of the XML delivery report structure will be: <DeliveryReport> <message id="msgid" sentdate="xxxx" donedate="xxxx" status="xxxx" /> <message id="msgid" sentdate="xxxx" donedate="xxxx" status="xxxx" /> </DeliveryReport> XML Attributes Description Attribute id sentdate Description Clients message ID Date/Time when message was submitted from the client to the smsbag system Format (yyyy/mm/dd hh:mm:ss) donedate Date/Time when SMSC notified the smsbag system of the delivery report Format (yyyy/mm/dd hh:mm:ss) status NOT_SENT The message could not be submitted to the Recipient Operator (possible reasons Operator SMSC connection is down) SENT The message was sent over a route that does not support delivery reports or delivery report not yet available NOT_DELIVERED DELIVERED The message could not be delivered The message was successfully delivered to the recipient

NOT_ALLOWED The client has no authorization to send to the specified network (the message will not be charged) INVALID_DESTINATION_ADDRESS Invalid/Incorrect GSM recipient INVALID_SOURCE_ADDRESS You have specified incorrect/invalid/not allowed source address (sender name) ROUTE_NOT_AVAILABLE NOT_ENOUGH_CREDITS INVALID_MESSAGE_FORMAT You are trying to use routing that is not available for your account There are no available credits on your account to send the message Your message has invalid format Example script for reading raw POST data sent to delivery report URL by PUSH method for example, delivery URL may be http://yourserver.com/dlreport.php (PHP scripting language) <?php ## read raw data $postdata = file_get_contents( php://input ); ##extract XML structure from server $dom = new DOMDocument(); $dom->loadxml ($postdata); ##create new Xpath $xpath = new domxpath($dom); ##query message XML element $reports = $xpath->query( /DeliveryReport/message ); ##write out attributes of each message element foreach ($reports as $node) { echo br>id:.$node->getattribute( id ); echo br>sentdate:.$node->getattribute( sentdate); echo br>donedate:.$node->getattribute( donedate); echo br>status:.$node->getattribute( status); }?>

2.3.2 PULL METHOD The URL to get delivery reports over HTTP GET method is: http://api.smsbag.com/api/dlrpull?user=xxx&password=xxx http://api2.smsbag.com/api/dlrpull?user=xxx&password=xxx Parameters User Password MessageId Optional Return Values 5 Invalid username and /or Password 10 Missing Username 11 Missing Password The XML delivery report structure is the same as defined in PUSH method. Examples of delivery report <DeliveryReport> <message id="162731295071200" sentdate="2011/1/15 18:40:3" donedate="2011/1/15 18:40:9" status="delivered" /> <message id="553831295071200" sentdate="2011/1/15 18:40:3" donedate="2011/1/15 18:40:12" status="delivered" /> </DeliveryReport> If you have any issues using this document or the API, kindly contact us via E: info@smsbag.com T: 234-8062741555 Contact Olutola Michael