SOLVED

Help with debugging Munchkin Javascript API

Go to solution
Venus_Wills
Level 4

Help with debugging Munchkin Javascript API

Hello Marketo Community,

We've created a third-party tool with a third-party (non-Marketo) form submission to capture email and make the AssociateLead call. Everything seems to be working correctly but none of the values are syncing back to Marketo, and a new lead is not created when the email doesn't exist. Below are our codes. The origin and referring URLs will not work.

Javascript:

mktoMunchkinFunction('associateLead', marketingResults, hashCode);

PHP server-side code used to generate the hashCode:

<?php

if($_SERVER["REQUEST_METHOD"] == "POST") {

$email = $_REQUEST["email"];

$hash_code = hash('sha1', '############'.$email);

header('Content-Type: application/json');

// echo json_encode($hash_code);

wp_send_json($hash_code);

die;

}

?>

Here is the request to and response from Marketo for the associateLead call:

Request URL:

https://381-kpd-482.mktoresp.com/webevents/associateLead?_mchNc=1460152334365&_mchKy=2c1ba96f9aaf0ad...

Request Method:

GET

Status Code:

200 OK

Response Headersview source

Access-Control-Allow-Origin:

Cache-Control:

no-cache

Connection:

Keep-Alive

Content-Length:

43

Content-Type:

image/gif

Date:

Fri, 08 Apr 2016 21:52:14 GMT

Expires:

-1

Keep-Alive:

timeout=5, max=100

Last-Modified:

Fri, 08 Apr 2016 16:52:14 -0500

P3P:

policyref="http://www.marketo.com/w3c/p3p.xml", CP="NOI DSP COR NID CURi OUR NOR"

Pragma:

no-cache

Server:

Apache

Set-Cookie:

BIGipServersjlweb-mch_https=!ucaFc7ZN3LX0XfJEgmpKKdFIW06sxEP98mhC9P2cxvyGImMK0Jxnfp8njkiV7LHp/f9zb6X2gmOC8GY=; path=/

X-Content-Type-Options:

nosniff

Request Headersview source

Accept:

*/*

Accept-Encoding:

gzip, deflate, sdch

Accept-Language:

en-US,en;q=0.8

Connection:

keep-alive

Host:

381-kpd-482.mktoresp.com

Origin:

https://stage.armor.com

Referer:

https://stage.armor.com/resources/solution-configuration-tool/

User-Agent:

Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/49.0.2623.87 Safari/537.36

Query String Parametersview sourceview URL encoded

_mchNc:

1460152334365

_mchKy:

2c1ba96f9aaf0adb933612aaa2dcc4c19ffcf39f

_mchAtfirstName:

Joel

_mchAtlastName:

Doyle

_mchAtemail:

joel@few.io

_mchAtcompany:

Few

_mchAttoolSCComplianceNeeds:

No

_mchAttoolSCEncrypt:

No

_mchId:

381-KPD-482

_mchTk:

_mch-armor.com-1458070455961-21585

_mchHo:

stage.armor.com

_mchPo:

_mchRu:

/resources/solution-configuration-tool/

_mchPc:

https:

_mchVr:

151

1 ACCEPTED SOLUTION

Accepted Solutions
Kenny_Elkington
Marketo Employee

Re: Help with debugging Munchkin Javascript API

Munchkin API uses the SOAP API names for fields, not the REST API names.  You're using the REST ones, so your call will end up failing.

View solution in original post

6 REPLIES 6
Kenny_Elkington
Marketo Employee

Re: Help with debugging Munchkin Javascript API

Munchkin API uses the SOAP API names for fields, not the REST API names.  You're using the REST ones, so your call will end up failing.

SanfordWhiteman
Level 10 - Community Moderator

Re: Help with debugging Munchkin Javascript API

Yeah ​Email especially...

Venus_Wills
Level 4

Re: Help with debugging Munchkin Javascript API

Is it just a capitalization issue? When I look at the exported field names, the difference between REST and SOAP API names for email is email vs. Email.

Venus_Wills
Level 4

Re: Help with debugging Munchkin Javascript API

Ok I feel like that was a stupid question after scanning some other articles on the community. It was my understanding there would be no javascript...

SanfordWhiteman
Level 10 - Community Moderator

Re: Help with debugging Munchkin Javascript API

Right, there wouldn't be any JS if your forms' native fields were the SOAP API names, but typically some mapping needs to be done unless you custom-build your forms to mirror a Marketo form.  I usually create a separate mapping object.  You can see it in my way-back post on integrating a DotNetNuke form w/Marketo.

Venus_Wills
Level 4

Re: Help with debugging Munchkin Javascript API

Thanks Kenny and Sanford! The SOAP API was the issue. All is working now.