When a lead first visits a page on a domain, a new anonymous lead record is created in Marketo. The ID of the this record is based on the Munchkin cookie (ex. id:561–HYG–937&token:_mch–marketo.com–1374552656411–90718).
When certain conditions are met the anonymous lead is associated with a know lead and the user will have a queryable marketo ID (ex. 42065).
However, there are situations where the lead has a marketo ID (because he clicked the link in the email) and an api request to (rest/v1/lead/42065) returns an empty result [] array.
ex: https://xxx-GGO-xxx.mktorest.com/rest/v1/lead/42065.json?access_token=e5b8e439-xxxx-4d62-xxxx-f1308cxxxxx:lon
Why is that?
Resources used:
Anonymous Lead Promotion to Known Lead – Munchkin V2 Behavior
https://developers.marketo.com/javascript-api/lead-tracking/
Solved! Go to Solution.
The lead is queryable but the result is empty.
That's the same thing as not being queryable. An empty result set = no results found.
There's no case where a lead in the known part of the database will not be found.
I don't really understand where you're getting the lead ID from in these cases where you're sure it's a known lead, but it's also not...
When a lead first visits a page on a domain, a new anonymous lead record is created in Marketo. The ID of the this record is based on the Munchkin cookie (ex. id:561–HYG–937&token:_mch–marketo.com–1374552656411–90718).
The ID of an anonymous lead isn't the cookie value, it's an integer ID.
There should be no cases at all where the ID of a known lead is not queryable via that API endpoint. I imagine there's something amiss with your test scenario.
The lead is queryable but the result is empty.
That's the same thing as not being queryable. An empty result set = no results found.
There's no case where a lead in the known part of the database will not be found.
I don't really understand where you're getting the lead ID from in these cases where you're sure it's a known lead, but it's also not...