Re: Webhook How to capture full JSON Array

Anonymous
Not applicable

Webhook How to capture full JSON Array

Looking for a way to capture the full array of a JSON Parameter.  For example I'd like to capture all the values and have them saved comma delimited in a Marketo field.   I'd like to capture all values returned in the "places" array.
 
{
   "post code": "90210",
   "country": "United States",
   "country abbreviation": "US",
   "places": [
       {
           "place name": "Beverly Hills",
           "longitude": "-118.4065",
           "state": "California",
           "state abbreviation": "CA",
           "latitude": "34.0901"
       }
   ]
}
So output would look something like this:  place name: Beverly Hills, longitude:-118.4065, state:California, state_abbreviation:CA, latitude:34.0901

You can accomplish this in javascript with a function like JSON.stringify, but not sure how to accomplish it in a webhook. 

Ultimately it would be best if all information was returned without specifiying any parameter to allow for a one to many relationship.

The response attributes places and places[0] do not work in the webhook mapping.

Thanks.
Tags (1)
1 REPLY 1
Edward_Unthank_
Level 10

Re: Webhook How to capture full JSON Array

Same question! Did you find an answer? The only thing I've been able to find so far is to edit the actual webhook endpoint and make it comma-separated, then using Marketo for the "contains" logic.

Edward