Assign delivery response to a lead field

Follow

This article goes over how you can take the data out of an delivery's API response and map it into a field or map multiple different parts of the response data into multiple fields. This is done in the "Remote System Responses" section of your delivery configuration. Each individual mapped delivery response can have a completely different response mapping configuration.


This feature allows you to store a section of a buyers delivery response against a lead field. 

This could be an identifier they return when accepting a lead, or a unique URL you need to redirect your leads to following a successful sale.

 

Find this function by editing your Delivery > Remote System Responses > Advanced Settings.

 

8b8d305b-ed5f-44e6-9d51-ca0d025538e5.png

 

We allow you to extract data from your buyer responses using JSON Path and XPATH.

This can be done with the remote system response you have marked as the success response but it can also be done for your other configured remote system responses. This will allow you to assign delivery responses to a lead field even when a lead is rejected from the buyer's system.

 

JSON Path

JSON Path is used to save values from a response returned in JSON.

The JSON path MUST start with a $ and then instruct LeadByte what value you want to store from the response.

 

Example JSON response 1 - 

{
"status": "Success",
"ID": "ac1e02ae-520cdd21-6228b6fa-fd5f-3bbba28a" 
}

In order to store the ID we would use the JSON Path below

$.ID

 

Example JSON response 2 - 

{
"status": "Sold",
"ID": "12345",
"price": 5,
"details": {
"URL": "www.a-lovely-website.com",
"redirect": true
}
}

In order to store the URL we would use the JSON Path below:

$.details.URL

 

Example JSON response 3 - 

{
"status": [1],
"result": ["success"],
"lead_id": ["12345"],
"uuid": ["5234dfy-2354df-543s1-7s123-asd12356"]
}

In order to store the uuid when the value is contained within a one-element array we would use the JSON Path below:

$.uuid[*]

 

XPATH

XPATH is used to save values from a response returned in XML.

The XPATH MUST start with // and then instruct LeadByte what value you want to store from the response.

 

Example XML response 1 - 

<response>
<status>Sold</status>
<ID>ac1e02ae-520cdd21-6228b6fa</ID>
</response>

In order to store the ID we would use the XPATH below:

//ID

 

Example XML response 2 - 

<response>
<status>Sold</status>
<ID>12345</ID>
<price>5</price>
<details>
<URL>www.a-lovely-website.com</URL>
<redirect>true</redirect>
</details>
</response>

In order to store the ID we would use the XPATH below:

//response/details/URL

 

Useful Tools

https://jsonpath.com/ - Assists you in building your JSON path

http://xpather.com/ - Assist you in building your XPATH

If you needed to capture the [AUTHTOKEN] from a 2 Step Authentication Delivery into a custom data field for whatever reason, you can map [AUTHTOKEN] to a field like this:
 

 

If you are struggling with more complicated JSON and XPATH queries, please raise a support ticket. Ensure you include an example of your response and your JSON path/XPATH attempt in the ticket details.

Was this article helpful?
0 out of 0 found this helpful

Comments