v1

latestSwagger 2.02026-07-13151175.7 KB
Message

Send message by simple GET or POST

A really simple interface for people who require a GET mechanism to submit a single message.

The URI is interpreted as UTF-8. HTTP Basic Auth is used for authentication.

Note BulkSMS recommends that you use the more flexible Send Messages Operation when submitting SMS messages from your application.

Here is an example of a GET

GET /v1/messages/send?to=%2b270000000&body=Hello%20World

You can also use the same parameters to POST form encoded fields to /messages. Here is an example of a POST

POST /v1/messages
Content-Type: application/x-www-form-urlencoded

to=%2b27000000000&body=Hello+World
get/messages/send

Query parameters

tostring required

The phone number of the recipient.

bodystring required

The text you want to send.

deduplication-idinteger

Refer to the deduplication-id parameter.

Response

An array of messages

idstring required

A unique identifier that is assigned when the message is created.

type'SENT' | 'RECEIVED' required

The message direction

fromstring

The address part of the sender id

tostring required

The phone number of the recipient

bodystring required

The content of the message

encoding'TEXT' | 'UNICODE' | 'BINARY'

The type of the content. See the encoding field for more information.

protocolIdinteger

See the protocolId field for more information.

messageClassinteger

See the messageClass field for more information.

numberOfPartsinteger

The number of parts. If this is a concatenated message, the number of parts will be more than 1. Note that this field does not have a value in the submission response.

creditCostnumber float

The cost of the message (in credits). Note that this field does not have a value in the submission response.

relatedSentMessageIdstring

This field has a value only if the type is RECEIVED. With SMS messages, it is not possible to link a reply directly with a specific sent message. However, if you specified REPLIABLE in the from property, BulkSMS will link any reply to the most recent message sent to a given phone number.

The relatedSentMessageId property keeps the information about this link.

You can use this property to derive an implicit conversation from a set of messages.

  • If a received reply message has a relatedSentMessageId, you can use it to retrieve the last message that was sent before the reply was received.
  • If you have the id of the sent message and you want all the received messages that relate to it, you can use the List Related Messages Operation.
userSuppliedIdstring

This is the value you supplied in the userSuppliedId field. Has a value only if the type is SENT.