latestSwagger 2.02026-08-101561322.2 MB

3e4029d19684

Outbound Messages

Check message price

<a class="try-sandbox-link" href="https://sandbox.textmagic.com/#/Messages%3A%20Send%0A/getMessagePrice" target="_blank">Try in sandbox</a><br>Check pricing for a new outbound message.

get/api/v2/messages/price/normalized

Query parameters

includeBlocked0 | 1

Should we show the pricing for blocked contacts?

textstring

Message text. Required if the template_id is not set.

templateIdinteger

Template used instead of message text. Required if the text is not set.

sendingTimeinteger

DEPRECATED, consider using the sendingDateTime and sendingTimezone parameters instead: optional (required with rrule set). Message sending time is in unix timestamp format. Default is now.

sendingDateTimestring

Sending time is in Y-m-d H:i:s format (e.g. 2016-05-27 13:02:33). This time is relative to the sendingTimezone.

sendingTimezonestring

The ID or ISO-name of the timezone used for sending when sendingDateTime parameter is set, e.g. if you specify sendingDateTime = "2016-05-27 13:02:33" and sendingTimezone = "America/Buenos_Aires", your message will be sent on May 27, 2016 13:02:33 Buenos Aires time, or 16:02:33 UTC. Default is the account timezone.

contactsstring

Comma-separated array of contact resources id message will be sent to.

listsstring

Comma-separated array of list resources id message will be sent to.

phonesstring

Comma-separated array of E.164 phone numbers message will be sent to.

cutExtra0 | 1

Should sending method cut extra characters which not fit supplied partsCount or return 400 Bad request response instead.

partsCountinteger

Maximum message parts count (Textmagic allows sending 1 to 6 message parts).

referenceIdinteger

Custom message reference id which can be used in your application infrastructure.

fromstring

One of the allowed Sender ID (phone number or alphanumeric sender ID). If the specified Sender ID is not allowed for some destinations, a fallback default Sender ID will be used to ensure delivery. See Get timezones.

rulestring

An iCal RRULE parameter to create recurrent scheduled messages. When used, sendingTime is mandatory as the start point of sending. See https://www.textmagic.com/free-tools/rrule-generator for format details.

createChat0 | 1

Should the sending method try to create new Chat (if not exist) with specified recipients?

tts0 | 1

Send a Text-to-Speech message.

local0 | 1

Treat phone numbers passed in the 'phones' field as local.

localCountrystring

The 2-letter ISO country code for local phone numbers, used when 'local' is set to true. Default is the account country.

Response

Returned when successful.

totalnumber required

Total price of the message.

partsinteger nullable required

Message parts (multiples of 160 characters) count.

Example response

{
  "total": 0.08,
  "parts": 6,
  "countries": [
    {
      "country": "US",
      "countryName": "United State",
      "allowDedicated": true,
      "count": 1,
      "max": 6
    }
  ]
}