Revision: 50 Revision Date: :43 Author: Oliver Zabel. GTX Mobile Messaging SMS Gateway Interface Simple HTTP API Manual

Similar documents
LINK Mobility SMS REST API MT and Delivery Reports Version 1.3; Last updated September 21, 2017

SMS Submit Interface description HTTP Version 1.5

Forthnet Mobile Platform - groupsms http interface v1.0 1 / 9

HTTP API Specification V2.7

SMS-Bulk Gateway HTTP interface

SMS Outbound. HTTP interface - v1.1

Integration Guide Xura Messaging HTTP-Interface

Gatesms.eu Mobile Solutions for Business

cellip CELLIPS SMS INTERFACE DESCRIPTION HTTP GET INNEHÅLLSFÖRTECKNING

text2reach2 SMS API Sep 5, 2013 v1.1 This document describes application interface (API) between SMS service provider (SP) and SMS gateway (SMSGW).

Response: Note: Please define Dynamic Value in ##Field## The following are the parameters used: For Unicode Message:

Integrating with Cellsynt's SMS gateway via HTTP interface (technical documentation)

NIC SMS SERVICE INTEGRATION

ERMES. Technical Specification for ex MPAY services integration. version /10/2018

Bulk HTTP API Specification

SMS HTTP API DOCUMENTATION December 2012

Way2mint SMS Mobile Terminate (MT) API Guide for HTTP / HTTPS

API Documentation. Release Version 1 Beta

USSD HTTP API SPECIFICATION Version 1.0 Teletalk Bangladesh Limited

LINK Mobility SMS REST API MO messages Version 1.1; Last updated June 07, 2017

All requests must be authenticated using the login and password you use to access your account.

Notification Services

Integration REST Text2Speech Version 1.1

Connect Media Bulk SMS API Documentation

Cloud SMS API Guide. Version 5.1

eservices channel-any_name_for_sms Section

SMSPortal SMS Encapsulation (8bit data)

Way2mint SMS Mobile Terminate (MT) API Guide for HTTP HTTPS

HTTP API. Table of Contents

SMS Outbound. SMTP interface - v1.1

SMS4BD Gateway Integration

API Specification Doc

1. Overview Account Configuration Details... 3

Revision: 11 Revision Date: :34 Author: Evgenij Tovba, Oliver Zabel. GTX Mobile Messaging SMS Gateway Interface SMPP API Manual

mvaayoo API Ver 1.2.0

Messaging Service REST API Specification V2.3.2 Last Modified: 07.October, 2016

SMS Relay. API Documentation SPLIO - SPRING Contact and Campaign SMS Relay API - EN v1.2.docx

Wired 2 Wireless Technology Solutions API Help Document Copyright Introduction. 2. Parameter list

Message parameter details

HTTP Specification Version 1.83

SMS Aggregation - API Documentation

4/ FGC Uen Rev C IPX. Implementation Guide SMS Utility API 1.0

Quriiri HTTP MT API. Quriiri HTTP MT API v , doc version This document describes the Quriiri HTTP MT API version 1 (v1).

Technical Guide. REST API for Mobile Outbound SMS

Mobile forensics. SMS (Short Message Service) EMS, MMS, CBS

API Integration Document

In order to create your proxy classes, we have provided a WSDL file. This can be located at the following URL:

Trigger SMS API. API Documentation SPLIO - SPRING Contact and Campaign Trigger SMS API - EN v4.0.docx

ARTIO SMS Services HTTP API Documentation

SMS Gateway. API & Application Technical Documentation. Revision 1. Current as at 10 th August Document ID: DOC-SMS-API-R1

Lecture 7b: HTTP. Feb. 24, Internet and Intranet Protocols and Applications

Overview Introduction Messaging Error Codes Message parameter details Contact Details... 7

SMS API - Web Services with SSL SHA2 HMAC Version 1.7

SDK Developer Reference Manual. Version 1.0

BulkSMS / Customer, Marketo Integration Guide, version 2.6, 2018/01/19. BulkSMS / Customer. Marketo Quick Start Integration Guide

BulkSMS Marketo Gateway

Client-Server Protocol Transport Bindings

Redrabbit Cloud-based Communications Platform SMS APIs

HTTP Interface API. for SMS Services. Version 2. Claude ICT Poland Sp. z o. o.

TC-IOT M2M CORE Services Protocol. User Manual. Version: 1.0 Date:

API Developer Reference Manual. Version 1.0

API Spec Sheet For Version 2.5

PageOne SOAP Web Services

SMS+ Client User Manual

Opaali Portal Quick guide

HTTP API-HELP DOCUMENT

SMS API - Web Services with SSL SHA2 HMAC Version 1.5

WhatsATool API - REST-Like Interface to WhatsATool Services

API ONE-TIME PASSWORD

atms PremiumSMS Documentation Info Hotline: Author: Karl Lettner English Version: Gerald Eigenstuhler

CNIT 129S: Securing Web Applications. Ch 10: Attacking Back-End Components

Extended sms2 API Documentation

SONERA OPERATOR SERVICE PLATFORM OPAALI PORTAL SMS. FREQUENTLY ASKED QUESTIONS, version 2.0

Product Guide SMS PLUS + Copyrights RouteSms Solutions Limited Page 1

ezeesms URL API Documentation

Black Box DCX3000 / DCX1000 Using the API

MCB Gateway. 1 Introduction. 2 Change history. 3 Table of contents

Integration Guide Xura Messaging SMTP- Interface

Instructions for Using New API. Instructions for Using New API

API-SMS HTTP/POST Interface Ref Push SMS, Balance, ACKs. April 18, 2017 v2.15

HTTP Authentication API

SOAP WebService. User Manual Version Copyright Route Mobile Limited All Rights Reserved.

BULK SMS RESELLER PLATFORM WEB SERVICES API

Application Security through a Hacker s Eyes James Walden Northern Kentucky University

SOAP API. The correct URL has been hidden. Please contact your account manager for the full URL information.

SMS API User Guide. Document Reference: October Version: 6

version 2.0 HTTPS SMSAPI Specification Version 1.0 It also contains Sample Codes for -.Net - PHP - Java

Smart Bulk SMS & Voice SMS Marketing Script with 2-Way Messaging. Quick-Start Manual

SMS Pro/Billing Pro. Interface specification. Version 3.0.1

Reqs-LTE-SMS. Device Requirements Issued: Mar-16

CNIT 129S: Securing Web Applications. Ch 3: Web Application Technologies

BitPipe Cellular Dev- Kit

Programming for the Web with PHP

Information About SIP Compliance with RFC 3261

Future Pay MCB API. Version

HTTP Reading: Section and COS 461: Computer Networks Spring 2013

sqlbox cvs User s Guide

SIP Compliance APPENDIX

Dynmark Messaging Platform XML HTTP Interface Quick Start Guide. Draft Revision September

Version Date Description Author First version Nate. send_sms request Added DELIVERED. status in Send Sms.

Transcription:

Revision: 50 Revision Date: 09.06.17 14:43 Author: Oliver Zabel GTX Mobile Messaging SMS Gateway Interface Simple HTTP API Manual

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 or HTTP-POST 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 408 Blacklist The recipient is blacklisted (upon request) 503 Service Unavailable 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