Webhook - Need help to parse the JSON response | Community
Skip to main content
New Participant
November 17, 2023
Solved

Webhook - Need help to parse the JSON response

  • November 17, 2023
  • 1 reply
  • 972 views

Hi Everyone,

I successfully retrieved data from AEP using a Webhook. Here is the response.

 

 

{ "BVr123": { "entityId": "BVr123", "entity": { "CommerceSite": { "latestCommerceEventDate": "2023-10-16T20:54:32.175Z", "productList": [ { "name": "LAB DEMO", "quantity": 2, "priceTotal": 48.99, "SKU": "310", "CommerceSite": { "productHierarchyCode": "804" }, "productCategories": [ { "categoryName": "Classroom-Kits" } ] }, { "name": "NPL", "quantity": 1, "priceTotal": 85.19, "SKU": "418", "CommerceSite": { "productHierarchyCode": "907" }, "productCategories": [ { "categoryName": "Classroom-Kits" } ] }, { "name": "DIGITAL METER", "quantity": 4, "priceTotal": 169.0, "SKU": "586", "CommerceSite": { "productHierarchyCode": "804" }, "productCategories": [ { "categoryName": "Clinometers" } ] } ], "latestCommerceEvent": "commerce.productListAdds" } }, "lastModifiedAt": "2023-11-17T01:17:39Z" } }

 

 

 

I require assistance in parsing JSON data to save it in Marketo custom fields. Specifically, I aim to store the latest commerce event, product list, latest commerce event date in three distinct custom fields. Please note that "BVr123" serves as a unique identifier for each individual and will vary for each person.

@sanfordwhiteman Could you please share your thoughts.

Thanks

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by SanfordWhiteman

You won’t be able to directly parse and map this response because the top-level property name is dynamic.

 

Best you can do is go via a webhook gateway that can pre-parse and transform the payload into something Marketo can understand.

1 reply

SanfordWhiteman
SanfordWhitemanAccepted solution
New Participant
November 17, 2023

You won’t be able to directly parse and map this response because the top-level property name is dynamic.

 

Best you can do is go via a webhook gateway that can pre-parse and transform the payload into something Marketo can understand.