Updating A Lead Field When Buyer Feedback Is Left
This article outlines a flow setup for a scenario where you would want to update a lead field with a specific value when a buyer leaves feedback for that lead. This flow can be modified so any sort of webhook action can be configured to trigger off feedback, to achieve things such as updating the financials of a lead depending on specific feedback types left.
The general flow:
- You have a custom field set up on your campaign to receive a value
- You have delivered a lead to a buyer
- The buyer leaves feedback for the lead - Buyer Returns and Feedback
- A LeadByte webhook detects the specific feedback has been left
- The webhook updates the custom field of the related lead to the feedback value
Setting up buyer feedback types.
Using the nav bar, if you go to "Campaigns" -> "Settings" -> "Lists" and then open "Buyer Feedback"
Here you will find a default list of buyer feedback types, feel free to remove any you don't need from the list and add the ones your buyer will be leaving.
In my example I have removed all types other than the 3 I will be using in this scenario:

Setting up a buyer REST API key if they are leaving feedback via REST API
Using the nav bar, if you go to "Tech Hub" -> "REST API" -> "Buyer Keys"
You need to create a buyer API key, selecting the related buyer that is receiving the leads and making sure the "Feedback" permission has been granted.

Scrolling down after enabling this permission, you can see the documentation for the buyer feedback API call.
Your buyer would be leaving feedback this way with an API call such as this:
[PUT] https://[ACCOUNT].leadbyte.co.uk/restapi/v1.3/leads/feedback
{
"key": "3hdnasdksdhetg34i23478adj38",
"leads": [
######
],
"BID": "NIALL",
"feedback": "Converted",
"overwrite": "yes"
}The leadID in the array must match the lead ID to be updated and the BID value must match the buyer's BID.
The feedback value must also match the reference for the feedback type you configured earlier.
Setting up an API KEY for the webhook
The webhook cannot use the same API KEY as it needs an admin key to perform actions such as lead field updates.
You must create an admin key with the lead update permission enabled:

Looking at the documentation for this call found further down the API KEY page, we can condense the call to target a custom field I have created in the define fields section of my campaign, called "buyer_status".
The call would be something like this:
[PUT] https://[ACCOUNT].leadbyte.co.uk/restapi/v1.3/leads
{
"leads": [
{
"id": "######",
"update": {
"buyer_status": "STATUS VALUE HERE"
}
}
]
}
Headers:
X_KEY: [API_KEY]Setting up the webhook to trigger off feedback type
Heading to "Tech Hub" -> "Webhooks" you would want to create a webhook using the feedback added trigger type, using webhook version 1.6 which will allow you to configure a webhook with a custom payload, using the PUT method.

With the payload looking like this - substituting the [leadid] tag and the [feedback] tag.

Making sure to add a custom header with the X_KEY of the admin key with lead update permissions.

You can also add a rule at the bottom so the webhook will only fire when the feedback type left matches - you must use the feedback name here and not the reference, my feedback reference is the same as the name so I can use the same value in my rule. The rule is Buyer Feedback IS PASTE LIST

Testing the flow
When I submit some buyer feedback from PostMan:

This triggers the webhook and the lead has buyer feedback left onto it:

Going into the lead information - the lead has had the buyer_feedback field updated with "Converted"

If you have any questions at all regarding the mechanics involved in this flow, please get in touch with support.
Comments