GTX Mobile Messaging SMS Gateway Interface Simple HTTP API Manual



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

Technical documentation

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

SMPP protocol analysis using Wireshark (SMS)

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

Advanced HTTP API Documentation

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

HTTP/SOAP Application Program Interface (API) Version 1.0

FTP API Specification V2.6

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

Technical Specification Normal SMS gateway

MyMobileAPI. mymobileapi.com

Now SMS/MMS Android Modem Quick Start Guide

NetCom SMS Bedrift API Technical Documentation

SRFax Fax API Web Services Documentation

HireDesk API V1.0 Developer s Guide

ValueSMS HTTP/S Protocol API Booklet

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

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

VMware vcenter Log Insight Developer's Guide

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

AMD Telecom SMS GATEWAY HTTP API INTERFACE. Technical Specifications

Cloud Elements! Marketing Hub Provisioning and Usage Guide!

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

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

AIRTEL INDIA OPEN API. Application Developer Guide for OAuth2 Authentication and Authorization. Document Version 1.1

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

CloudOYE CDN USER MANUAL

SMS Service Reference

Technical Specification Premium SMS gateway

Message Containers and API Framework

Diafaan SMS Server 3.0 Manual Diafaan communication software

Online signature API. Terms used in this document. The API in brief. Version 0.20,

Safeguard Ecommerce Integration / API

HTTP Application Programming Interface

Nuance Mobile Developer Program. HTTP Services for Nuance Mobile Developer Program Clients

Web Service Integration

InternetVista Web scenario documentation

Appendix. Web Command Error Codes. Web Command Error Codes

API Guide v /11/2013

reference: HTTP: The Definitive Guide by David Gourley and Brian Totty (O Reilly, 2002)

Secure XML API Integration Guide. (with FraudGuard add in)

Virtual Fax API User Guide

Quick Start Guide Now SMS/MMS Gateway

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

AT&T Business Messaging Account Management

QIWI Wallet Pull Payments API

CTIS 256 Web Technologies II. Week # 1 Serkan GENÇ

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

VoxStack GSM Gateway API. Version: Author: Joe.Yung

Chapter 4: Computer Codes

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

Web. Services. Web Technologies. Today. Web. Technologies. Internet WWW. Protocols TCP/IP HTTP. Apache. Next Time. Lecture # Apache.

Remote Access API 2.0

Playing with Web Application Firewalls

CSCI-1680 SMTP Chen Avin

Human Translation Server

Protocolo HTTP. Web and HTTP. HTTP overview. HTTP overview

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

Bitrix Site Manager 4.0. Quick Start Guide to Newsletters and Subscriptions

SMTP-32 Library. Simple Mail Transfer Protocol Dynamic Link Library for Microsoft Windows. Version 5.2

Automating SQL Injection Exploits

Internet Technologies. World Wide Web (WWW) Proxy Server Network Address Translator (NAT)

Internet Technologies Internet Protocols and Services

CONTRACT MODEL IPONZ DESIGN SERVICE VERSION 2. Author: Foster Moore Date: 20 September 2011 Document Version: 1.7

PHP Integration Kit. Version User Guide

Revised: 3-Jun-08. Stratos C- User Guide

The Simple Submission URL. Overview & Guide

Jobs Guide Identity Manager February 10, 2012

FileMaker 14. ODBC and JDBC Guide

Order Notifications - reporting a payment status

WP4: Cloud Hosting Chapter Object Storage Generic Enabler

PaperCut Payment Gateway Module PayPal Website Payments Standard Quick Start Guide

Integrations. Help Documentation

DEVELOPER API. Last Updated: Simwood Mobile Developer API 1.5

(Document Version 1.4) (This Document gives details on how to send messages via the Bulk HTTP API for the RouteSms SMPP System)

Issuetrak API 1.2 Documentation A Guide to the Issuetrak API, Version 1.2

A Silent SMS Denial of Service (DoS) Attack

NAT TCP SIP ALG Support

BMC Track-It! Web. Web Services API Guide. Version 11.3

Clickatell two-way technical guide v2.0

ENTTEC Pixie Driver API Specification

HOST EUROPE CLOUD STORAGE REST API DEVELOPER REFERENCE

Network Technologies

Fairsail REST API: Guide for Developers

Ciphermail Gateway PDF Encryption Setup Guide

Version of this tutorial: 1.06a (this tutorial will going to evolve with versions of NWNX4)

1. Change Log Introduction Flow summary Flow Overview Premium SMS flow Pin Flow Redirect Flow...

API Documentation. Introduction. General request structure. Authentication. Account and Site Identifiers. Name Description Optional

1. Building Testing Environment

Package uptimerobot. October 22, 2015

Chapter 2 Application Layer. Lecture 5 FTP, Mail. Computer Networking: A Top Down Approach

OAuth 2.0 Developers Guide. Ping Identity, Inc th Street, Suite 100, Denver, CO

vcloud Air Platform Programmer's Guide

UAB CIS QuickStart Guide Using the RT SelfService Web Interface Revision 1, 3/22/06

TED 5000 Third Party Posting API

Manual. Netumo NETUMO HELP MANUAL Copyright Netumo 2014 All Rights Reserved

ADMINISTRATION GUIDE. Cisco Small Business. WAP371 Wireless-AC/N Dual Radio Access Point with Single Point Setup

Transcription:

GTX Mobile Messaging SMS Gateway Interface Simple HTTP API Manual Revision: 48 Revision Date: 12.10.11 09:09 Author: Evgenij Tovba

Table of Contents Table of Contents... 2 Introduction... 3 Sending SMS... 3 Targets... 3 Request... 3 Encoding... 4 Request Examples... 4 Simple text message... 4 Binary message containing a WAP- Push... 4 Multi- byte message with UCS- 2 coded data (using BINARY format and DCS)... 4 Multi- byte UTF- 8 message (with UCS- 2 coding)... 4 Response... 5 Response Examples... 5 Successful submission... 5 Service Unavailable... 5 Receiving DLRs... 6 Request Parameters... 6 Status definitions... 6 Example DLR callback... 6 Receiving Session Replies... 7 Request Parameters... 7 Example session reply... 7 Receiving SMS... 8 Request Parameters... 8 Example MO SMS... 8 Sample Code... 9 Send a text SMS... 9 Send a Unicode SMS... 10 Process a DLR callback... 11 Process a session reply callback... 12 Process a MO SMS callback... 12 2

Introduction The Mobile Messaging SMS Gateway provides an easy- to- use and easy- to- implement HTTP- GET interface for receiving and submitting messages from and to the gateway. This manual will describe the interface and provide some examples on how to use the interface. If you have further questions regarding this interface, please contact your account manager or file a trouble ticket to support@gtx- messaging.com. Sending SMS Targets You can reach the SMS Gateway under the following URL using HTTP: http://http.gtx-messaging.net/smsc.php If you prefer to use a HTTPS connection instead, please use this endpoint: https://http.gtx-messaging.net/smsc.php Request The following HTTP- GET parameters should be set when sending a message: Field Mandatory Type Description Example user yes String Your username "comp_gold_001" pass yes String Your password "topsecret" from 1 optional Alphanumeric String, Numeric, MSISDN The TPOA / originator of the message to yes MSISDN The recipient of the message, international format, no "+" t optional TEXT BINARY UNICODE Type of the message (defaults to "TEXT") "Company", "49171000000", "55888" "491701234567", "44751234567" "TEXT" text 2 optional String Text of the message "Hello World" coding 3 optional Fixed String Use UCS- 2 coding "ucs2" udh 4 optional HEX Custom UDH "0605040B8423F0" data 4 optional HEX Custom Data "1B0601AE02056..." dcs 4 optional Integer Custom DCS "8" 1) The TPOA in the from- field may be overridden, based on your profile/contract. In case you do not have a custom TPOA, this parameter can be left out. Please note that special characters are not allowed. 2) When using multi- byte text (UTF- 8), make sure to set the t- parameter to "UNICODE", only mandatory when the t- parameter is either "TEXT" or "UNICODE". Please see the Encoding reference below. 3) Only applicable when the t- parameter is set to "UNICODE". Please note that UCS- 2 coding requires more bytes per character. A single- part message can contain up to 70 characters, multi- part messages can contain up to 67 characters. 4) Only applicable when the t- parameter is set to "BINARY". 3

Encoding The gateway internally uses UTF- 8 encoding. If you submit messages as plain text (parameter t=text, default) then the gateway will assume that the text is encoded using Windows- 1252 (a.k.a. CP- 1252). If you want to submit UTF- 8 text please set the parameter t=unicode. Please note that special Unicode characters can only be transmitted using UCS- 2 coding. Wikipedia provides a good reference; please see http://en.wikipedia.org/wiki/windows- 1252 or http://en.wikipedia.org/wiki/utf- 8 for more information. Request Examples Simple text message The easiest way of using the interface: http://http.gtxmessaging.net/smsc.php?user=comp_gold_001&pass=topsecret&from=acme&to=491 701234567&text=Hello+World Binary message containing a WAP- Push Send a WAP- Push message to the recipient (may not work on all products, please ask your account manager for details about special binary content): http://http.gtxmessaging.net/smsc.php?user=comp_gold_001&pass=topsecret&to=491701234567& t=binary&udh=0605040b8423f0&data=1b0601ae02056a0045c60c037777772e796f632e 636F6D0001034D6F62696C6520456E61626C696E67000101 Multi- byte message with UCS- 2 coded data (using BINARY format and DCS) If your client already encodes multi- byte messages using UCS- 2 itself, you may simply supply that coded data and set the necessary DCS by yourself: http://http.gtxmessaging.net/smsc.php?user=comp_gold_001&pass=topsecret&to=491701234567& t=binary&data=041f044004804204504b&dcs=8 Multi- byte UTF- 8 message (with UCS- 2 coding) In this example the text is submitted using UTF- 8 encoding. By setting the parameter coding=ucs2 the gateway is requested to encode this message in UCS- 2: http://http.gtxmessaging.net/smsc.php?user=comp_gold_001&pass=topsecret&from=acme&to=491 701234567&t=UNICODE&text=%D0%9F%D1%80%D0%B8%D0%B2%D0%B5%D1%82&coding=ucs2 4

Response The Gateway will return a response containing a result of the performed operation. If the operation was successful, the result will contain a message ID that will be referred to when sending a DLR to the customer (see examples). The following error codes will be returned: Code Description 200 OK Message sent (includes message ID) 400 Bad Request Malformed or bad request submitted 401 Unauthorized Wrong username / password 402 Payment required Please recharge your account, no message sent 405 Not Authorized Client IP not authorized 407 Text too long The submitted message text is too long 408 Blacklist The recipient is blacklisted (upon request) 503 Service Unavailable Service is currently unavailable, please try again 505 Destination not allowed This destination is not in the reach list for this profile 700 Service Unavailable II Service is currently unavailable, please try again Response Examples Successful submission The submitted message was sent successfully and assigned the internal message ID 26818021. HTTP/1.1 200 OK\r\n (HTTP Headers shortened) Content-Length: 17\r\n \r\n 200 OK (26818021) Service Unavailable The service is temporarily unavailable, please try again later. HTTP/1.1 200 OK\r\n (HTTP Headers shortened)\r\n Content-Length: 23\r\n \r\n 503 Service Unavailable 5

Receiving DLRs The gateway will return an asynchronous delivery report (DLR) to your site via HTTP GET. In order to receive DLRs your profile must support DLRs and you must provide GTX with a callback URL that will satisfy the following interface requirements. The DLR callback refers to the message ID that was previously returned in response to the submission and will contain the destination MSISDN of the submitted message. Request Parameters The following parameters will be provided to the callback URL: Field Mandatory Type Description Example id yes Unsigned The message ID this DLR refers to "21498252" Long status yes Integer The last status of this message "8" snr yes MSISDN The number of the recipient "+491721234567" Status definitions The status codes provided to the callback URL should be interpreted in this manner: Status Description 1 Delivered to phone 2 Not delivered to phone 4 Queued on SMSC 8 Delivered to SMSC 16 Not delivered to SMSC Example DLR callback Given that you have provided your account manager with the callback URL: http://system.company.com/dlr.cgi A sample DLR callback could look like this: http://system.company.com/dlr.cgi?id=12345678&status=1&snr=%2b49172123456 7 This callback reports that the message identified by 12345678 was successfully delivered to the recipients phone. The recipient number is +4916721234567. 6

Receiving Session Replies When using a 2way product (e.g. Silver 2way) the recipient of the message can reply to it. This reply will be redirected to a given interface to your site. In order to receive these session replies you must provide GTX with a callback URL that will satisfy the following interface requirements. The session reply will refer to the original message ID that was previously returned in response to the submission. Please ask your account manager about 2way products for more details. Request Parameters The following parameters will be provided to the callback URL: Field Mandatory Type Description Example id yes Unsigned The message ID this reply refers to "21498252" Long from yes MSISDN The number of the originator (former "00491717654321" recipient) to yes MSISDN Always the virtual number: "00491710000000" text yes String The message of the reply (UTF- 8) "Ping back" user yes String Your username "comp_gold_001" Example session reply Given that you have provided your account manager with the callback URL: http://system.company.com/reply.cgi A sample session reply callback could look like this: http://system.company.com/reply.cgi?id=12345678&from=00491721234567&to=00 491710000000text=Ping%20back This callback reports that there is a message from the user 00491721234567 in reply to the message identified by 12345678. The message text is "Ping back". 7

Receiving SMS To receive SMS on a short code or a long number you must provide GTX with a callback URL that will satisfy the following interface requirements. Request Parameters The following parameters will be provided to the callback URL: Field Mandatory Type Description Example timestamp yes UNIX Timestamp The timestamp of the message "1306413940" (GMT) from yes MSISDN The number of the originator "00491717654321" to yes MSISDN The recipient of the message "55123" or "00491715554443" text yes String The message sent by the "Hello World" originator (UTF- 8) user yes String Your username "comp_gold_001" Example MO SMS Given that you have provided your account manager with the callback URL: http://system.company.com/inbox.cgi A sample session reply callback could look like this: http://system.company.com/inbox.cgi?from=00491721234567&to=55123&text=hel lo%20world&timestamp=1206415240 This callback reports that there is a message from the user 00491721234567 that was sent to the short code 55123 on Tue, 25 Mar 2008 at 03:20:40. The text of the message is "Hello World". 8

Sample Code This sample pseudo- code is written in PHP and will help to demonstrate how the interface is used. It does not include any error handling and is not meant as a recommendation but just for illustrative purposes. Send a text SMS <?php $gw = "http://http.gtx-messaging.net/smsc.php"; $auth = array( 'user' => 'comp_gold_001', 'pass' => 'topsecret' ); $message = array( 'from' => 'ACME', 'to' => '491701234567', 'text' => 'Hello World!' ); $url = $gw."?user=".$auth['user']."&pass=".$auth['pass']; $url.= "&from=".urlencode($message['from'])."&to=".$message['to']; $url.= "&text=".urlencode($message['text']); $cp = curl_init($url); curl_setopt($cp, CURLOPT_HEADER, false); curl_setopt($cp, CURLOPT_RETURNTRANSFER, true); $result = curl_exec($cp); if ($result === false) { // error handling } else { // parse response message } curl_close($cp);?> 9

Send a Unicode SMS <?php // Assuming this file is UTF-8 $gw = "http://http.gtx-messaging.net/smsc.php"; $auth = array( 'user' => 'comp_gold_001', 'pass' => 'topsecret' ); $message = array( 'from' => 'ACME', 'to' => '491701234567', 'text' => 'Привет', 'coding' => 'ucs2' ); $url = $gw."?user=".$auth['user']."&pass=".$auth['pass']; $url.= "&from=".urlencode($message['from'])."&to=".$message['to']; $url.= "&text=".urlencode($message['text']); $url.= "&t=unicode&coding=".$message['coding']; $cp = curl_init($url); curl_setopt($cp, CURLOPT_HEADER, false); curl_setopt($cp, CURLOPT_RETURNTRANSFER, true); $result = curl_exec($cp); if ($result === false) { // error handling } else { // parse response message } curl_close($cp);?> 10

Process a DLR callback We are using a pseudo- class for database abstraction. <?php if (isset($_request['id'], $_REQUEST['status'], $_REQUEST['snr'])) { }?> $db->connect('to', 'my', 'database'); $sql = "UPDATE my_message_table "; $sql.= "SET last_status =? "; $sql.= "WHERE remote_id =? "; $sql.= "AND destination =? "; $sql.= "LIMIT 1"; $statement = $db->prepare($sql); $statement->bindparam($_request['status']); $statement->bindparam($_request['id']); $statement->bindparam($_request['snr']); $statement->execute(); $db->disconnect(); 11

Process a session reply callback We are using a pseudo- class for database abstraction. <?php if (isset($_request['id'], $_REQUEST['from], $_REQUEST['text'])) { }?> $db->connect('to', 'my', 'database'); $sql = "INSERT INTO my_reply_table "; $sql.= "(message_id, originator, text) "; $sql.= "VALUES (?,?,?)"; $statement = $db->prepare($sql); $statement->bindparam($_request['id']); $statement->bindparam($_request['from']); $statement->bindparam($_request['text']); $statement->execute(); $db->disconnect(); Process a MO SMS callback We are using a pseudo- class for database abstraction. <?php if (isset($_request['from], $_REQUEST['to'], $_REQUEST['timestamp'], $_REQUEST['text'])) { }?> $db->connect('to', 'my', 'database'); $sql = "INSERT INTO my_mo_table "; $sql.= "(originator, destination, ts, text) "; $sql.= "VALUES (?,?,?,?)"; $statement = $db->prepare($sql); $statement->bindparam($_request['from']); $statement->bindparam($_request['to']); $statement->bindparam(date('y-m-d H:i:s', $_REQUEST['timestamp'])); $statement->bindparam($_request['text']); $statement->execute(); $db->disconnect(); 12