SOLVED

Re: How do I update a lead record using a Webhook(s)?

Go to solution
Guitarrista82
Level 6

How do I define a webhook to call the Vibes API?

Hello,

 

I am asking a developer question because, while we have developers, it takes months to have changes made and things built. So our small technical team works to try and get things built faster.

 

I am trying to set up webhooks in Marketo that will 1. Get data from the Vibes sms/mobile wallet platform and 2. Update Marketo records with that data.

 

I've been reading through the API documentation for both Marketo and Vibes and am still unsure of how to accomplish this.

 

I've created a webhook to accomplish the first part, to Get the Vibes data, which would be the External Person ID circled in the second screenshot below.

 

webhook screenshot 1.png

webhook screenshot 2.png

First, I'm not sure that the webhook is set up correctly, and second I don't know how to update the field below in Marketo with the External Person ID that resides in Vibes.

 

Is it possible to update this field using the same webhook or would I need to create a Post webhook to update that field?

 

Guitarrista82_2-1694027238889.png

 

Thank you,

LK

1 ACCEPTED SOLUTION

Accepted Solutions
Darshil_Shah1
Level 10 - Community Advisor + Adobe Champion

Re: How do I update a lead record using a Webhook(s)?

@Guitarrista82, as a first step, please edit your post and redact/mask any credentials/API key. It's really not advisable to post any of those in a public forum. The order of headers doesn't matter, as long as all the headers are included, you should be fine. You might want to update your response mapping, as from what I see on the documentation, mdn is an attribute within the mobile_phone object (mobile_phone.mdn). You might also want to select the Response Type to JSON in the webhook definition. Also, sometimes I've seen the webhook definition getting cached by Marketo, so I usually like to create a new webhook, and keep the existing one as the older version (helps with the versioning as a silver-lining) if I run into errors/get no output. Also, are you able to check the campaign queue and verify whether the campaign you requested is still in the queue? Because, if the campaign you requested has a Webhook call step in its flow, then you should technically see the Call Webhook activity in the person's activity log.

View solution in original post

12 REPLIES 12
Darshil_Shah1
Level 10 - Community Advisor + Adobe Champion

Re: How do I update a lead record using a Webhook(s)?

Are you trying to make a webhook call to the Find person by MDN (Mobile Directory Number) vibes API from Marketo? A couple of items below you should re-check in the documentation and rectify in your webhook definition in Marketo:

  • You only need "&" to separate the 2nd query parameter onwards, for the first QP, you should be using "?" after the base URL. You're also probably missing the query parameter's attribute (unless you have that included in the Phone Number field, which I highly doubt).

 

https://public-api.vibescm.com/companies/company_key/mobiledb/persons?mdn={{lead.mobile phone number}}

 

  • Per the API documentation, external_person_id attribute has the unique person identifier assigned by the brand, which can be used to link non-Vibes-assigned identifiers to Vibes person records. I think you should be using this instead of the foo attribute in the response mapping table.
  • You're missing the X-API-Version header. Check the CURL on the documentation page, it has the X-API-Version header included. Also, the documentation specifies using the accept header and not the Content-Type header.

 

Is it possible to update this field using the same webhook or would I need to create a Post webhook to update that field?

 

Guitarrista82_2-1694027238889.png

 

Thank you,

LK


You don't really need a POST call to update the Marketo field with the "Vibes Id". As long as the Vibes API call includes the required ID in its response, you can map the incoming response attribute with the Vibes Id Marketo field. You'd do that in the webhook call's Response Mapping section (Webhook's Response Mapping uses the SOAP field name).

Guitarrista82
Level 6

Re: How do I update a lead record using a Webhook(s)?

Hi Darshil,

 

Thanks for your help!

 

Yes, I am trying to first locate the contact in Vibes by using the mobile phone number (called MDN in Vibes), grab the External Person ID that lives in Vibes and then in Marketo I want to update the {{Lead.Vibes ID}} field with the External Person ID info that is in Vibes. 

 

Unfortunately, the External Person ID that is in Vibes does not exactly match the ID, {{Lead.ID}}, that is in Marketo. The External Person ID simply contains the {{Lead.ID}} like this:  mkto:512-JJP-615:53435840

 

webhook screenshot 3.png

Guitarrista82_1-1694038764566.png

 

So what I'm trying to do is grab that External Person ID from Vibes and then copy it to the Lead.Vibes ID field that I created so that I can then use a separate webhook here to update the custom fields I have created in Vibes with Marketo data.

 

I reconfigured my GET webhook as shown below based on your feedback:

webhook screenshot 4.png

 

Does this look correct considering what I'm trying to accomplish?

 

Thank you,

LK

Darshil_Shah1
Level 10 - Community Advisor + Adobe Champion

Re: How do I update a lead record using a Webhook(s)?

I still think you've got discrepancies with your headers. Below are the headers mentioned in the documentation page, which you should also be adding to your webhook definition:

     --header 'X-API-Version: 1' \
     --header 'accept: application/json' \
     --header 'authorization: Basic <key>'

Additionally, it's not expected of any system that they'd have their identifier values (External Person Id in this case) the same as those of records in Marketo (Person Id).

 

Why don't you directly upsert the data using the Add a Person API call? This endpoint can very well identify people based on their MDN or External Person Id values, and since you already have MDN data in Marketo, you can bypass the Find person by MDN GET call to get the External Person Id first. If an existing person record already exists with the same mobile_phone. The record will be updated with the added information. Specified fields in the add request will be applied and any existing data fields on the record will remain unchanged.

Guitarrista82
Level 6

Re: How do I update a lead record using a Webhook(s)?

Hi Darshil,

 

I attempted to use the "Add a person" API call you suggested. When I test it on this page https://developer-platform.vibes.com/reference/post_add-a-person it works fine, but when I test in Marketo   all I get is the activity log below and no confirmation that the webhook was sent or failed.

Guitarrista82_1-1694114543361.png

I added the correct headers shown on the documentation for "Add a person": 


webhook screenshot 5.png

 

Does the order that the headers are in matter? Here's how they are set up in the webhook in Marketo?

webhook screenshot 6.png

 

Thank you,

LK

Darshil_Shah1
Level 10 - Community Advisor + Adobe Champion

Re: How do I update a lead record using a Webhook(s)?

@Guitarrista82, as a first step, please edit your post and redact/mask any credentials/API key. It's really not advisable to post any of those in a public forum. The order of headers doesn't matter, as long as all the headers are included, you should be fine. You might want to update your response mapping, as from what I see on the documentation, mdn is an attribute within the mobile_phone object (mobile_phone.mdn). You might also want to select the Response Type to JSON in the webhook definition. Also, sometimes I've seen the webhook definition getting cached by Marketo, so I usually like to create a new webhook, and keep the existing one as the older version (helps with the versioning as a silver-lining) if I run into errors/get no output. Also, are you able to check the campaign queue and verify whether the campaign you requested is still in the queue? Because, if the campaign you requested has a Webhook call step in its flow, then you should technically see the Call Webhook activity in the person's activity log.

Guitarrista82
Level 6

Re: How do I update a lead record using a Webhook(s)?

Hi @Darshil_Shah1 ,

 

I created a clone of the webhook and then updated it as shown below, including with the response mapping updated to include the Vibes objects:

 

webhook screenshot 8.png

 

However, when I test in Marketo, I am not getting the Call Webhook activity on my Activity Log. I only got it one time and it was a failed message so I made some changes and continued testing. But no call webhook activities since then.

 

Guitarrista82_1-1694128895706.png

 

Does anything look erroneous in my updated webhook above?

 

Thank you,

LK

Darshil_Shah1
Level 10 - Community Advisor + Adobe Champion

Re: How do I update a lead record using a Webhook(s)?

What error do you see in the Response/Error type when you expand the Call Webhook activity in the person's activity log?

Guitarrista82
Level 6

Re: How do I update a lead record using a Webhook(s)?

When I did receive that Call Webhook activity this is what it said when expanded:

Activity Details – ID 6534608671
Choice Number: 1287254
Url: https://public-api.vibescm.com/companies/company-key/mobiledb/persons?mdn=6025550000
Webhook Id: 60
Webhook Name: Copy of Vibes Update Person Record
Error String: Server Returned code 400
Request Type: http_post
Step ID: 277826
Source: Marketo Flow Action
Response:
<!DOCTYPE html> <html> <head> <title>Bad Request (400)</title> <style> body { background-color: #EFEFEF; color: #2E2F30; text-align: center; font-family: arial, sans-serif; } div.dialog { width: 25em; margin: 4em auto 0 auto; border: 1px solid #CCC; border-right-color: #999; border-left-color: #999; border-bottom-color: #BBB; border-top: #B00100 solid 4px; border-top-left-radius: 9px; border-top-right-radius: 9px; background-color: white; padding: 7px 4em 0 4em; } h1 { font-size: 100%; color: #730E15; line-height: 1.5em; } body > p { width: 33em; margin: 0 auto 1em; padding: 1em 0; background-color: #F7F7F7; border: 1px solid #CCC; border-right-color: #999; border-bottom-color: #999; border-bottom-left-radius: 4px; border-bottom-right-radius: 4px; border-top-color: #DADADA; color: #666; box-shadow:0 3px 8px rgba (50, 50, 50, 0.17); } </style> </head> <body> <div class="dialog"> <h1>Bad Request</h1> </div> <p>ActionDispatch::ParamsParser::ParseError: expected comma at line 2, column 36 [parse.c:520] in &#39;{&quot;event_type&quot;: &quot;update_custom_fields&quot;, &quot;event_data&quot;: {&quot;mdn&quot;:&quot;&quot;6232931076&quot;&quot; }, &quot;custom_fields&quot;: {&quot;brand_website&quot;:&quot;&quot;www.govvacationrewards.com\/&quot;&quot;, &quot;sms_phone&quot;: &quot;&quot;844-967-1088&quot;&quot; }}</p> </body> </html>
Person ID: 53435840
Error Type: HTTP Error 400: Bad URL request.

 But since testing again I am not seeing the Call Webhook activity log anymore.

Guitarrista82
Level 6

Re: How do I update a lead record using a Webhook(s)?

UPDATE:

 

One stupid simple issue has been fixed on the requested campaign--I had forgotten the settings below were set to run once a day. I changed it to run every time and it worked perfectly.

 

Guitarrista82_0-1694189579228.png

Thanks for all your help, Darshil!