Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Anchor
_Toc62200938
_Toc62200938
Anchor
_Toc94723489
_Toc94723489
Before you begin

Please make sure you have provided CONNECT Support an URL where Common shall deliver your messages.

Please make an opening in your firewall if necessary, so that Common can connect to your system. For a list of the addresses Common will connect from, see below.

Anchor
_Toc62200939
_Toc62200939
Anchor
_Toc94723490
_Toc94723490
Scope of this document

This document will describe the Application Programming Interface (API) to receive text messages through the CONNECT “Common” platform. Sending messages is described in a separate document.

...

Messages will be delivered in JSON format. A basic familiarity with JSON is assumed.

Anchor
_Toc62200940
_Toc62200940
Anchor
_Toc94723491
_Toc94723491
Capabilities of “Common” platform

Common is a high-capacity, high-availability SMS gateway designed to let you send and receive SMS Text messages. Messages can contain any character in the UTF-8 2-byte character set.

Anchor
_Toc62200941
_Toc62200941
Anchor
_Toc94723492
_Toc94723492
Terms and glossary

Anchor
_Toc62200942
_Toc62200942
Anchor
_Toc94723493
_Toc94723493
MO message

Mobile Originated message. Refers to any text message sent from an end-user’s handset to you.

Anchor
_Toc62200943
_Toc62200943
Anchor
_Toc94723494
_Toc94723494
IP addresses

When delivering a message to you, the requests can be coming from several different IP addresses.

...

Please configure your firewalls so that these hosts/networks can connect to your systems to deliver messages.

Anchor
_Toc62200944
_Toc62200944
Anchor
_Toc94723495
_Toc94723495
Character encoding

All communication to and from Common will be in UTF-8 encoding.

Anchor
_Toc62200945
_Toc62200945
Anchor
_Toc94723496
_Toc94723496
KeyValue

Contains parameters and values in a JSON object.

Anchor
_Toc94723497
_Toc94723497
Example

...

Contains parameters and values in a Jason object.

Code Block
{
"key1": "value1",
"key2": "value2"
}

Anchor
_Toc62200946
_Toc62200946
Anchor
_Toc94723498
_Toc94723498
Receiving MO messages

When Common forwards an MO message to you, it will be POST:ed to your service, in either XML or JSON formats. The format is described in the following table:

...

route parameter

Data type

Description

type

String

Contains information on how the message was routed to you. Contains KEYWORD_ROUTE if the message matched a keyword, or SUBNUMBER_ROUTE if the message matched a subnumber.

id

String

The ID of either the subnumber or the keyword matched.

refId

String

A reference ID for this keyword or subnumber route. This string can be set by Support if you want to use it for routing internally.

gateIds

<List>String

A list of the gate(s) this keyword or subnumber forwards to.

platformId

String

The platformId of the platform which received this message. Will usually be “SMSC”.

platformPartnerId

String

Your partnerId

platformServiceType

String

Can be set to any string by Support. Used to differentiate different types of services on your end, if needed.

platformServiceId

String

Can be set to any string by Support. Used to differentiate different services on your end, if needed.

customParameters

KeyValue

Any custom parameters needed for this message. Usually blank.

number

String

The shortnumber this routing rule applies to.

startRange

String

Only if subnumbers are used. Contains the start of the range of subnumbers matched.

stopRange

String

Only if subnumbers are used. Contains the end of subnumbers matched.

keyword

String

Only if keyword is used. Contains the keyword that was matched.

keywordType

String

Contains the type of matching used for this keyword. Support will advise you on the different types of keyword types when setting up the keyword, if needed.

active

Boolean

Whether the keyword is active. Will always be true.

start

DateTime

The start date of the keyword. Will always be in the past.

end

DateTime

The expiry date of the keyword. Will always be in the future.

shared

Boolean

Whether this keyword will forward to multiple services. With the exception of STOP services, this will always be false.

description

String

Human-readable description of the service.

Anchor
_Toc62200947
_Toc62200947
Anchor
_Toc94723499
_Toc94723499
Examples

For most purposes, you are mainly interested in the “source”, “route”:”keyword”, and “content”:”userData” fields. Other fields are included for advanced or debugging purposes.

In these examples, some ID numbers have been replaced with 0.

Anchor
_Toc62200948
_Toc62200948
Anchor
_Toc94723500
_Toc94723500
Example sent to a keyword

This example is an example of a user with phone number +4741560067 sending a message to shortnumber 2333 with the text “Bclt hello”.
Anchor_MON_1705335398_MON_1705335398

...

...

This example shows how the request will look when the message is sent to a subnumber rather than a keyword. This example is sent from +4741560067 to shortcode 2333, subnumber 9999999989. The text of the message is “Hello, Dolly!”

...

Code Block
{
  "destination": "NO-2333",
  "subNumber": null,
  "source": "+4741560067",
  "content": {
  "type": "SMS",
  "userData": "Bclt hello",
  "encoding": "TEXT"
  },
  "operator": "no.telenor",
  "timestamp": "2015-11-17T14:28:40Z",
  "messageId": "0",
  "operatorTimestamp": "2015-11-17T14:28:40Z",
  "operatorMessageId": "0",
  "route": {
    "type": "KEYWORD_ROUTE",
    "id": "0",
    "refId": "Internal Keyword Reference",
    "gateIds": ["0"],
    "platformId": "0",
    "platformPartnerId": "0",
    "platformServiceType": "serviceType",
    "platformServiceId": "Internal Service ID",
    "customParameters": {},
    "number": "NO-2333",
    "keyword": "BCLT",
    "keywordType": "FIRST_WORD",
    "active": true,
    "start": "2015-11-17T00:00:00Z",
    "end": "2016-11-17T00:00:00Z",
    "shared": false,
    "description": "BCLT service"
  },
  "gateCustomParameters": {},
  "customParameters": {
    "platformPartnerId": "0",
    "suggestedOperator": "no.telenor",
    "moReferenceId": "0",
    "queued": "2015-11-17 15:28:40",
    "serviceCentreTimeStamp": "20151117152840",
    "platformId": "0"
 }
}

Anchor
_Toc62200950
_Toc62200950
Anchor
_Toc94723502
_Toc94723502
Appendix 1

The following hosts are currently used for outgoing messaging.

...