BICS OpenSMS API

create Delivery Info Subscription

Subscribe for delivery info notifications. This is an alternative way to the Get Delivery Infos method to retrieve delivery infos.

A delivery infos will be sent to the specified URL whenever the message's state changes. You will typically receive 2 notifications with the states DeliveredToNetwork and DeliveredToTerminal respectively for each sent message. For large messages that are split into parts, you will receive one notification for the first part with the state DeliveredToTerminal.

Be aware that

  • There is no retry mechanism on the delivery notifications. If we fail to send the notification to your URL (e.g. 404 not found, timeout, network issues) we will not send it again.
  • The notifications might arrive in random order. You might receive the DeliveredToTerminal before the DeliveredToNetwork notification. This requires you to build some logic on your end to not simply overwrite the state DeliveredToTerminal with DeliveredToNetwork and wronfully conclude that the message is still in the state DeliveredToNetwork.
  • You can have only one subscription.

/outbound/subscriptions

Usage example:

Request

POST /outbound/subscriptions HTTP/1.1
Host: opensms.api.bics.com

Authorization: Bearer MY_API_KEY
Content-type: application/json
Content-length: 106

{
  "callback": {
      "url": "https://your.domain/sms/callback",
      "securityToken": "r2k5hq3"
  }
}

Response

HTTP/1.1 201 Created

Parameters

Body

{ "$ref" : "#/definitions/Callback" }
{
  "callback": {
      "url": "https://your.domain/sms/callback",
      "securityToken": "r2k5hq3"
  }
}

Responses

Status: 201 Created

subscription created

{ "$ref" : "#/definitions/Callback" }

Status: 400 Bad request

The request is not well formed.

Status: 406

The request is not accepted.

{ "$ref" : "#/definitions/NotAcceptableCallback" }

delete Delivery Info Subscription

Delete your subscription for delivery infos

/outbound/subscriptions

Usage example:

Request

DELETE /outbound/subscriptions HTTP/1.1
Host: opensms.api.bics.com

Authorization: Bearer MY_API_KEY

Response

HTTP/1.1 204 No content

Parameters

Responses

Status: 204 No content

Subscription removed

Status: 401 Authentication required

Not authorized

Status: 404 Not found

Delivery subscription not found


get Delivery Info Subscription

Your subscription for delivery infos

/outbound/subscriptions

Usage example:

Request

GET /outbound/subscriptions HTTP/1.1
Host: opensms.api.bics.com

Authorization: Bearer MY_API_KEY

Response

HTTP/1.1 200 OK

Parameters

Responses

Status: 200 OK

subscription

{ "$ref" : "#/definitions/Callback" }

Status: 401 Authentication required

Not authorized

Status: 404 Not found

No subscription found


get Delivery Infos

Retrieves the delivery information per recipient for a previously transmitted message. For each message sent, you can poll this URL until the message has one of the 2 final states:

  • DeliveredToTerminal : the message arrived on the recipient's device
  • DeliveryImpossible : the message could not be delivered (e.g. the recipient's number is not an active number)
    Polling for the status can be resource itensive, alternatively you can also create a delivery subscription which will post the same delivery info to a URL you specify.

/outbound/{senderAddress}/requests/{requestId}/deliveryInfos

Usage example:

Request

GET /outbound/321234567/requests/4c279a5f-1502-4679-8077-a63fa399369e/deliveryInfos HTTP/1.1
Host: opensms.api.bics.com

Authorization: Bearer MY_API_KEY

Response

HTTP/1.1 200 OK

Content-Type: application/json

{
  "deliveryInfoList": {
    "resourceURL": "https://opensms.api.bics.com/smsmessaging/v1/outbound/%2B321234567/requests/4c279a5f-1502-4679-8077-a63fa399369e/deliveryInfos",
    "deliveryInfo": [
      {
        "address": "tel:+331234568",
        "deliveryStatus": "DeliveredToTerminal"
      }
      {
        "address": "tel:+331234567",
        "deliveryStatus": "DeliveredToNetwork"
      }
    ]
  }
}

Parameters

Path parameters

Name Type Description Example
senderAddress* String

The sender of the message used in the original SendMessage request

321234567
requestId* String

The requestId of the submitted message which can be found in the reponse or the location header of the original SendMessage request

4c279a5f-1502-4679-8077-a63fa399369e

Responses

Status: 200 OK

OK

{ "$ref" : "#/definitions/DeliveryInfoList" }
{
  "deliveryInfoList": {
    "resourceURL": "https://opensms.api.bics.com/smsmessaging/v1/outbound/%2B321234567/requests/4c279a5f-1502-4679-8077-a63fa399369e/deliveryInfos",
    "deliveryInfo": [
      {
        "address": "tel:+331234568",
        "deliveryStatus": "DeliveredToTerminal"
      }
      {
        "address": "tel:+331234567",
        "deliveryStatus": "DeliveredToNetwork"
      }
    ]
  }
}

Status: 401 Authentication required

Unauthorized: the API Key was not mentioned or is invalid (see authentication)

Status: 403 Access denied

Forbidden: this service cannot be used according to your API Key

Status: 404 Not found

no such message was found

Status: 429 Too many requests

Too Many Requests: more requests were made in the last hour than is permitted with your API key


send Message

Sends a text message to one or more destination numbers.

/outbound/{senderAddress}/requests

Usage example:

Request

POST /outbound/321234567/requests HTTP/1.1
Host: opensms.api.bics.com

Authorization: Bearer MY_API_KEY
Content-type: application/json
Content-length: 325

{
               "outboundSMSMessageRequest": {
                   "address": ["tel:+13500000991", "tel:+13500000992"],
                   "senderAddress": "tel:12345678",
                   "outboundSMSTextMessage": {"message": "Hello World"},
                   "senderName": "web app name"
               }
             }

Response

HTTP/1.1 201 Created

Content-Type: application/json

{
  "outboundSMSMessageRequest":{
      "address":["tel:+13500000991", "tel:+13500000992"],
      "deliveryInfoList" : {
          "deliveryInfo" : [
              { "address" : "tel:+13500000991", "deliveryStatus" : "DeliveredToNetwork" },
              { "address" : "tel:+13500000992", "deliveryStatus" : "DeliveredToNetwork" }
          ],
          "resourceURL": "https://opensms.api.bics.com/smsmessaging/v1/outbound/tel%3A%2B12345678/requests/abc123/deliveryInfos"
      },
      "senderAddress":"tel:12345678",
      "outboundSMSTextMessage":{"message":"Hello World"},
      "clientCorrelator":"123456",
      "senderName":"web app name",
      "resourceURL": "https://opensms.api.bics.com/smsmessaging/v1/outbound/tel%3A%2B12345678/requests/abc123"
  }
}

Parameters

Path parameters

Name Type Description Example
senderAddress* String

The address to use as the sender of the message. This can be either a number up to 15 characters, or an alphanumeric text up to 11 characters from the GSM 7bit alphabet. However, most destination networks will only allow valid phone numbers or short codes. Keep in mind that any replies will end up being delivered to this address. If the address is a phone number, you can optionally prefix it with tel: for clarity (e.g. tel:+1234567). senderAddress path variable must be a valid URL chars sequence. If it contains non-latin letters or special/punctuation characters, they are required to be URL-encoded (e.g. /outbound/ALPHA NUMERIC/requests -> /outbound/ALPHA%20NUMERIC/requests).

321234567

Body

{ "$ref" : "#/definitions/OutboundRequest" }
{
               "outboundSMSMessageRequest": {
                   "address": ["tel:+13500000991", "tel:+13500000992"],
                   "senderAddress": "tel:12345678",
                   "outboundSMSTextMessage": {"message": "Hello World"},
                   "senderName": "web app name"
               }
             }

Responses

Status: 201 Created

CREATED

{ "$ref" : "#/definitions/OutboundRequest" }
{
  "outboundSMSMessageRequest":{
      "address":["tel:+13500000991", "tel:+13500000992"],
      "deliveryInfoList" : {
          "deliveryInfo" : [
              { "address" : "tel:+13500000991", "deliveryStatus" : "DeliveredToNetwork" },
              { "address" : "tel:+13500000992", "deliveryStatus" : "DeliveredToNetwork" }
          ],
          "resourceURL": "https://opensms.api.bics.com/smsmessaging/v1/outbound/tel%3A%2B12345678/requests/abc123/deliveryInfos"
      },
      "senderAddress":"tel:12345678",
      "outboundSMSTextMessage":{"message":"Hello World"},
      "clientCorrelator":"123456",
      "senderName":"web app name",
      "resourceURL": "https://opensms.api.bics.com/smsmessaging/v1/outbound/tel%3A%2B12345678/requests/abc123"
  }
}

Status: 401 Authentication required

Unauthorized: the API Key was not mentioned or is invalid (see authentication)

Status: 403 Access denied

Forbidden: this service cannot be used according to your API Key

Status: 429 Too many requests

Too Many Requests: more requests were made in the last hour than is permitted with your API key


Generated 2023-11-10T13:43:37.422+01:00