|

Help center

Submit a ticket My Tickets
Welcome
Login

HTTP(S) API

Introduction

This document provides the HTTP API description for external systems integration with CommPeak SMS platform. HTTPS API enables SMS submitting and delivery status request.

Authentication information (login/password) for connecting to CommPeak SMS platform must be requested from the owner of CommPeak SMS platform for each new interconnection.

Credentials must be sent with each API request otherwise one will be rejected as authorised.

Requests can be sent either using GET or POST methods to URL provided by the system owner in the format:


SMS submitting.

Request format:

HTTPS: https://sms.commpeak.com:8002/api?username=<username>&password=<password>&ani=<ani>&dnis=<dnis>&message=<message>&command=submit&serviceType=<serviceType>&longMessageMode=<longMessageMode>


HTTP: http://sms.commpeak.com:8001/api?username=<username>&password=<password>&ani=<ani>&dnis=<dnis>&message=<message>&command=submit&serviceType=<serviceType>&longMessageMode=<longMessageMode>

 

Parameters:

User name    
Login
Password
Password
ANI
Caller ID. Technical limitation - alpha-numeric up to 32 symbols. Additional limitation can be provided based on the destination route peculiarities.
DNIS
Destination number. Must be sent in international E.164 format (up to 15 digits allowed).
Message
Message text
Command
Request type. Must be set to “submit” value.
Service type
Service type, provided by the system owner for the registered interconnection. Can be blank.
LongMessageMode
Type of long messages processing. The following values allowed:
- cut (trim message text to 140 bytes) - shortens the message leaving only first 140 bytes to be sent.
- split
- split_sar - split the message according to the logics described below. The difference between split and split_sar is in the header to be used, for Split it is UDH header, for Split SAR it is SAR accordingly.
- payload - message_payload field is used for sending the message text via SMPP protocol

The splitting (options 2/3) depends on the encoding:

- dataCoding = 0: one message can contain up to 160 symbols, if more – segment count = message length / 152 - dataCoding from 1 to 7: one message can contain up to 140 symbols, if more – segment count = message length / 134 - dataCoding = 8: one message can contain up to 70 symbols (140 bytes), if more – segment count = message length / 67 (134 bytes)

           

All parameters except for longMessageMode are obligatory, the default value forlongMessageMode is 1 (cut).


Response format:

In case of successful processing, HTTP response status is 200 OK. Response body contains the message_id in JSON format.


Response sample:


HTTP/1.1 200 OK
Content-Type: text/html; charset=UTF-8
{"message_id":"alss-a1b2c3d4-e5f67890"}


In case of rejected messages (no compatible routes found or authentication data is incorrect), the HTTP response status is - 400 Bad Request .

Response body contains the string describing the reason for rejection e.g. NO ROUTES or Unknown username.



HTTP/1.1 400 Bad Request
Content-Type: text/html; charset=UTF-8

Unknown username


In case incorrect password is provided HTTP status is 401 Unauthorized. 

Response bodycontains the string describing the reason for rejection.


HTTP/1.1 401 Unauthorized
Content-Type: text/html; charset=UTF-8

Incorrect password


SMS status request

Request format:


https://sms.commpeak.com:8002/api?username=<username>&password=<password>&messageId=<messageId>&command=query



http://sms.commpeak.com:8001/api?username=<username>&password=<password>&messageId=<messageId>&command=query


Parameters:

User name    
Login
Password
Password
messageId
Message identifier received in the response to submit
command
Request type. Must be set to “query” value


All parameter are obligatory.


Response format:

In case of successful processing, status in the header of the HTTP response is 200 OK.

Response body contains the one of the following possible values:


ENROUTE
Message is in routing stage
SENT
Message is delivered to the SMSC
DELIVERD
Message is delivered to the Subscriber
EXIRED
Message storage period expired
DELETED
Message was deleted
UNDELIV
Message can not be delivered
ACCEPTD
Message is accepted by SMSC
UNKNOWN
Unknown message status
REJECTD
Massage was rejected by SMSc


Response sample:


HTTP/1.1 200 OK
Content-Type: text/html; charset=UTF-8

{"status":"DELIVRD"}


Status can be requested within 48 hours after the message submitting.

In case the message with the requested message ID is not found the response HTTPresponse code is 200 OK. Response body contains the error description in the “status”field:


HTTP/1.1 200 OK
Content-Type: text/html; charset=UTF-8

{"status":"message ID alss-some-message-id not found"}


In case of incorrect status request is submitted (for example login is incorrect), status HTTP 400 Bad Request is sent back. Response body contains the string describing the reason for

rejection. E.g. NO ROUTES or Unknown username.


HTTP/1.1 400 Bad Request
Content-Type: text/html; charset=UTF-8

Unknown username


In case incorrect password is provided HTTP status is 401 Unauthorized. Response body contains the string describing the reason for rejection.


HTTP/1.1 401 Unauthorized
Content-Type: text/html; charset=UTF-8

Incorrect password

Did you find it helpful? Yes No

Send feedback
Sorry we couldn't be helpful. Help us improve this article with your feedback.