Callbacks

Custom parameters

Important! Custom parameters are different from callbackParameters. To make it clear again:

  • callbackParameters is used by you in /messages endpoints to pass in any custom values that you need to receive back in the callback response.
  • customParameters is used by Whispir in the callback response to pass back the callbackParameters (and other values) that you passed in earlier.

Custom parameters are included in the response object of a callback POST that Whispir makes to your server. These parameters contain important information about:

  • The dynamically processed values that Whispir used to fulfill your request (the sender, receiver channels, timestamps and destination email address or phone number).
  • The message response rule and the condition that was applied to the response. See Matched rule
  • The callbackParameters. See Callback parameters

Dynamically processed values

Whispir allows bulk messaging or dynamic messaging via the /resources and /messages endpoints.

When you use bulk messaging or dynamic messaging, you need to know the processed values that are used by Whispir to replace the @@placeholders@@ in a specific message template against each row of your csv, json or xml data.

To facilitate that, Whispir gives those values in the callback response under customParameters. The table below lists the custom parameters provided by Whispir.

High-level custom parameters

sender_full_name

String

Specifies the full name of the sender. This is the name of the user account that was used to make the API call.

sender_first_name

String

Specifies the first name of the sender account.

sender_last_name

String

Specifies the last name of the sender account.

sender_sms

String

Specifies the phone number of the sender account.

sender_email

String

Specifies the email address of the sender. This is the email address of the user account that was used to make the API call.

recipient_full_name

String

Specifies the full name of the recipient, but only if the recipient is already a contact in the Whispir platform under your account.

recipient_first_name

String

Specifies the first name of the recipient account. If only the recipient is already a contact/user in the Whispir platform under your account.

recipient_last_name

String

Specifies the last name of the recipient account, but only if the recipient is already a contact in the Whispir platform under your account.

recipient_sms

String

Specifies the phone number of the recipient. If only the channel is SMS or the recipient is already a contact in the Whispir platform under your account.

recipient_email

String

Specifies the email address of the recipient, but only if the channel is email or the recipient is already a contact in the Whispir platform under your account

recipient_voice

String

Specifies the phone number of the recipient, but only if the channel is SMS/voice or the recipient is already a contact in the Whispir platform under your account

date

String

Specifies the date value in YYYY-MM-DD format.

Example: 2019-03-01.

This is the date when the message was sent. This helps to know the sent date when the message is a scheduled message (see Schedule message delivery). 

time

String

Specifies the time value in HH:MI format.

Example: 10:36.

This is the time when the message was sent. This helps to know the sent time when the message is a scheduled message (see Schedule message delivery). 

Individual broken-down values for Date and Time

String

Apart from the date and time values above, the API also provides the following broken-down values for use:

  • yyyy: Year (in 4 digit format). For example, 2019.
  • month: Month (in full month name format). For example, March.
  • day: Day (in full week day format). For example, Tuesday.
  • yy: Year (in 2 digit format). For example, 19.
  • mm: Month. For example, 03.
  • dd: Date. For example, 08.
  • hrs: Hours. For example, 16.
  • min: Minutes. For example, 39.
  • sec: Seconds. For example, 50.


  • JSON
  • XML

{{codeStart}}

"customParameters": {

"sender_full_name": "John Wick",

"sender_first_name": "John",

"sender_last_name": "Wick",

"sender_sms": "614235552323",

"sender_email": "JohnWick@example.com",

"recipient_full_name": "John Wick",

"recipient_first_name": "John",

"recipient_last_name": "Wick",

"recipient_sms": "6593556682",

"recipient_email": "jWick@whispir.com",

"recipient_voice": "6593556682",

"date": "2019-03-01",

"time": "10:36",

"yyyy": "2019",

"month": "March",

"day": "Friday",

"yy": "19",

"mm": "03",

"dd": "01",

"hrs": "10",

"min": "36",

"sec": "01",

"matchedCategory": "Reserved",

"responseRule": "Reserved Words",

"first_name": "John",

"last_name": "Wick"

}

{{codeEnd}}