"Invalid cookie value" when calling REST API leads | Community
Skip to main content
December 12, 2014
Solved

"Invalid cookie value" when calling REST API leads

  • December 12, 2014
  • 14 replies
  • 4110 views
I'm trying to get the lead information for the current user in a website, using this REST API: Get Multiple Leads By Filter Type

I have the right authentication token ( I am able to call other entries, i.e. /lead/{id}.json ) but whenever I call the "leads" resource with filterType=cookie&filterValues=xxxxxxxxxxxxxx I get a JSON error response with this value in the message property:
Invalid cookie value 'id:561-HYG-937&token:_mch-marketo.com-1415884534947-30230'
I have encoded the '&' inside the cookie value as %26, and it is reaching the API correctly.  The value stated in the error message matches exactly the value of my _mkto_trk cookie on the 'marketo.com' domain.

Any clue on what I may be doing wrong?
Thanks in advance
Jose
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
For future viewers of this thread, I also updated this developer blog post with the example:
http://developers.marketo.com/blog/get-a-visitors-cookie-id-and-then-query-associated-lead-data/

14 replies

December 20, 2014
I am now going to make sure our form submission code comply with the specs in this post - by Murtza Manzur himself -  and try again. I will post here the results.
December 20, 2014
I am not sure. It is possible. Let me know if following steps in that blog post solve the issue. 
December 20, 2014
Yes! That worked.  

So:
  • Murtza's first reply was the right one for my original question.
  • The rest of the thread helped me fix a separate issue we had when submitting the forms to Marketo: we were missing the _mkt_trk hidden field, so the cookie value was not being stored with the lead data.
Thanks Murtza for your help through all this process.
Jose
December 20, 2014
@Jose, I am glad you were able to get this resolved! Thanks for closing the loop.