Release Note - April 2022

Introducing Variant ID to our API end-points and custom webhooks related to campaigns

Using Sonar’s APIs you can now track which variant ID was sent to the customer both when the message is sent and when a response is received with the following API end-points and custom webhooks.

Please note: that step_variant_id in this document, is the same as variant_id related to campaigns.

API end-points:
• Send Campaign
• Send Personalized Campaign

Custom Webhooks:
• Outbound Message
• New Assigned Message
• New Unassigned Message

Details of the changes:

  1. Both of the above API end-points will now include a “step_variant_id” as an additional parameter in their result format.

Change from:

{
  "to":"+13105551234",
  "text":"sent",
  "status":"queued"
}

To

{
  "to":"+13105551234",
  "text":"sent",
  "status":"queued",
  "step_variant_id":"2"
}
  1. The 3 custom webhooks mentioned above, will now include the “step_variant_id” of the campaign.

Outbound Message” will have the following added to its response:

/* note: this section exists only if the new message is a reply to a campaign*/
  "campaign":{ 
    "slug": "CLKkAS",
    "name": "nps",
    "parsed_value": "8",
    "step_variant_id": "2"		
  }

New Assigned Message” and “New Unassigned Message” will add the step_variant_id field to the campaign component, of their response.

Changing from:

/* note: this section exists only if the new message is a reply to a campaign*/
  "campaign":{ 
    "slug": "CLKkAS",
    "name": "nps",
    "parsed_value": "8"
  }

To:

/* note: this section exists only if the new message is a reply to a campaign*/
  "campaign":{ 
    "slug": "CLKkAS",
    "name": "nps",
    "parsed_value": "8",
    "step_variant_id": "2"
  }