Callbacks

Example flow

Imagine a workflow where the same contact receives 2 or more messages in quick succession. How does Whispir know which message they’ve responded to?

Explanation:

  • For communications sent via email or web, Whispir has a clear 1:1 relationship, ensuring each outbound communication is unique, with any reply to that communication (regardless of the order of response, or length of time between message send and response) be threaded against the original outbound message.
  • For communications sent via SMS, things get slightly more complex. Whispir uses a pool of mobile numbers, with Whispir retaining knowledge of which recipient was sent which message via the Whispir pool number. This means Whispir knows which reply from which recipient is for which initial outbound message.

The only challenge is where you have very high volumes of messages being sent to the same recipient (for example, a new SMS message sent to the same number every 5 minutes), and the list of pool numbers is exhausted, with Whispir needing to re-use pool numbers. This is a highly unlikely communication use case, but you need to be aware of it.

Scenario 1:

In a 10-second period 2 SMS messages are sent.

If user +1000000000 replies ‘Y’, which callbackId would be called?

  • Two separate messages are sent to the same mobile number, with both including a callbackid.
  • Each message is received by the recipient via two different sender numbers.
  • Assuming the recipient responds to the first message they receive, Whispir triggers the callback ‘callbackA’.
  • If they respond to the second message, Whispir triggers the callback ‘callbackB’.
  • JSON
  • XML

{{codeStart}}

{

"to": "+1000000000",

"subject": "Whispir",

"body": "Hello there. Reply Y",

"callbackId": "callbackA"

}

{

"to": "+1000000000",

"subject": "Whispir",

"body": "Goodbye. Reply Y",

"callbackId": "callbackB"

}

{{codeEnd}}

 

Scenario 2:

In a 30-minute period 2 SMS messages are sent.

If user +1000000000 replies ‘Y’, which callbackId would be called?

  • Two separate messages are sent to the same mobile number within 30 minutes, with both including a callbackid.
  • Each message is received by the recipient via two different sender numbers.
  • Assuming the recipient responds to the first message they receive, Whispir triggers the callback ‘callbackA’.
  • If they respond to the second message, Whispir trigger the callback ‘callbackB’.
  • JSON
  • XML

SMS sent:

{{codeStart}}

{

"to": "+1000000000",

"subject": "Whispir",

"body": "Hello there. Reply Y",

"callbackId": "callbackA"

}

{{codeEnd}}

 

Another SMS sent half an hour later (#scenario 2):

{{codeStart}}

{

"to": "+1000000000",

"subject": "Whispir",

"body": "Goodbye. Reply Y",

"callbackId": "callbackB"

}

{{codeEnd}}

 

Scenario 3:

If user +1000000000 replies ‘Y’ half an hour later, would the callbackId still be relevant?

  • Assuming this was the only message sent to the recipient in the 30 minutes, the response will trigger the callback ‘callbackA’.

How about 1 hour, 2 hours later?

  • The time between when the message is sent and the reply received has no significance.
  • The challenge in matching outbound messages and their inbound responses is only relevant when the entire pool of numbers (which continues to grow) is exhausted.
  • Recipients can respond days (maximum of 7 days) after the message was sent and Whispir will still correctly track the message that the reply relates to.
  • JSON
  • XML

SMS sent (#scenario 3):

{{codeStart}}

{

"to": "+1000000000",

"subject": "Whispir",

"body": "Hello there. Reply Y",

"callbackId": "callbackA"

}

{{codeEnd}}