20114 - Bad parameter when setting marketoCookie

Anonymous
Not applicable
I'm using C# and code from the Marketo C# Example to try and sync leads.  Everything is working fine as long as I don't set the marketoCookie property of my ParamsSyncLead variable:

ws_lead.marketoCookie = cookie;

cookie is the value of the marketo cookie, it looks like this "id:MYID,token:_mch-localhost-1375359337265-73080".

Changed id to MYID, but it is a valid ID.  As soon as I call syncLead with this line of code in place I get the 20114 - Bad parameter error being thrown.  If I comment out that line, everything works.  From the API doc this seems like it should work
"syncLead
This function requests an insert or update (upsert) operation for a lead record. When updating an existing lead, the 
lead can be identified one of the follow:
Marketo ID
Foreign system ID
Marketo Cookie
Email"

Our requirement is for the marketo cookie to be the unique identifier, not the other 3.  

Any thoughts?
Tags (1)
4 REPLIES 4
Anonymous
Not applicable
Thanks for sharing your solution Scott.

IIan, I'm getting the same error on my requestCampaign call.  Were you able to resolve it?
 
Anonymous
Not applicable
Scot maybe you can help me.

I am also using c# and trying to request campaign.

I get a bad paramter 20114  error.

What does that actually mean?0EM50000000RcDg.jpg
Anonymous
Not applicable
Good catch Scott.  Thanks for sharing the resolution.
Anonymous
Not applicable
Of course, shortly after posting this I finally figured it out.  Was getting the cookie value by calling

Request.Cookies["_mkto_trk"].Values[0].ToString()

which was changing the & to a comma, and crashing the API call.  Changed to

Request.Cookies["_mkto_trk"].Value

and it started working.