Batch - Message grouping

Read collection of batches

Endpoint: GET /v2/batches

This endpoint will provide you with a collection of batches for which you can see the batch document definition below. However messageSummary and priceSummary will not be provided as those are only available to the single batch endpoint. Ordered chronologically by creation date.

Reading a Single Batch

Endpoint: Get /v2/batches/{batchId}

This endpoint will provide you with a single batch which will provide you with the total price of a batch as well as a summary of the statuses for the batch' messages.

Response data type

{
    "id": "5bc86b6e85c7209830f96936",
    "sender": "46101606060",
    "body": "Hi my name is {name}",
    "owner": "ip1-XXXXX",
    "direction": "MT",
    "type": "flash",
    "datacoding": "GSM",
    "priority": 1,
    "templated": true,
    "priceSummary": {
        "total": 0.125,
        "currency": "EUR",
        "average": 0.0416
    },
    "messageSummary": {
        "101": {
          "messages": 43,
          "sms": 86
        },
        "102": {
          "messages": 3,
          "sms": 6
        },
        "201": {
          "messages": 142,
          "sms": 284
        }
    },
    "deliveryWindows": [
        {
            "opens": "ISO-8601 string",
            "closes": "ISO-8601 string"
        },
        {
            "opens": "ISO-8601 string",
            "closes": "ISO-8601 string"
        }
    ],
    "status": 112,
    "deliveryReportUrl": "https://api.example.com/sms/deliveryreport",
    "reference": "A client reference",
    "tags": ["marketing", "auth", "etc"],
}

sender

The sender ID used in the messages.

body

The original body sent before templating has been applied as supplied in the original request.

owner

The account ID of the SMS account that owns the batch (e.g. you).

direction

Decides if the message is sent or received by our system

mt an acronym for mobile terminated
mo an acronym for mobile originated.

type

There are two types that an SMS may have: sms and flash. sms sms is a regular SMS while flash flash is shown once and then deleted from the handset. Default is sms sms.

datacoding

Specifies the largest datacoding set allowed in the batch.

priority

In case it it very important for you that your messages to arrive quickly and not be hindered by by our other customers you may set a higher priority.

Please note that if you set a higher priority, the price per SMS will increase by 10 öre if you use a Swedish account, or € 0.01 if you use an international account.

Priority 1 is the default value and also the lowest available value, while priority 2 is the highest available value. If priority is set, 1 and 2 1 and 2 are the only values ​​allowed.

templated

Whether templating was utilized or not.

priceSummary

priceSummary.total
The total price for the batch. This value may change if messages are rejected by the next upstream carrier in which case the payment for that specific message will be canceled.

priceSummary.currency
What currency total andaverage are given in

priceSummary.average
The average price for a single message in the bundle. Note that a message differs from SMS since one message may require multiple SMS.

messageSummary

This is a dictionary where the key is a status code and the value is the count of how many messages (and their corresponding SMS segments) has that status code as it's most recently added status. For more information regarding our status codes for messages please see the section about status codes. Status codes.

deliveryWindows

In case there is a need to schedule a sending in the future there's the possibility to do so with our delivery time windows. These are the current delivery time windows for this batch.

status

Current status of the batch. Derived from the direction and latest status of the batch's messages. Available statuses are as follows:

NameStatus codeComment
Planned101The batch is scheduled to be sent in the future.
Ongoing111The batch is being processed and sent out
Sent112The batch has been sent out
Incoming201The batch contains incoming messages
Canceled203The batch has been canceled and will not be sent

deliveryReportUrl

If provided, status update reports will be sent to this URL through the method POST. These reports are separated for each recipient in a message and for each status update. If you want to read more about these reports, you can do so in the section for Delivery reports.

reference

This is a property that allows the user to set a custom ID or credential if storing the default generated IDs is deprecated.

Restrictions

  • May consist of a maximum of 40 characters
  • Cannot be represented by an empty string or whitespace.

null the default value.

tags

An array of tags used to categorize or sort your bastches. When listing your batches, you can filter by these.