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.
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?
Thank you,
LK
Solved! Go to Solution.
@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.
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:
https://public-api.vibescm.com/companies/company_key/mobiledb/persons?mdn={{lead.mobile phone number}}
Is it possible to update this field using the same webhook or would I need to create a Post webhook to update that field?
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).
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
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:
Does this look correct considering what I'm trying to accomplish?
Thank you,
LK
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.
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.
I added the correct headers shown on the documentation for "Add a person":
Does the order that the headers are in matter? Here's how they are set up in the webhook in Marketo?
Thank you,
LK
@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.
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:
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.
Does anything look erroneous in my updated webhook above?
Thank you,
LK
What error do you see in the Response/Error type when you expand the Call Webhook activity in the person's activity log?
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 '{"event_type": "update_custom_fields", "event_data": {"mdn":""6232931076"" }, "custom_fields": {"brand_website":""www.govvacationrewards.com\/"", "sms_phone": ""844-967-1088"" }}</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.
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.
Thanks for all your help, Darshil!