Marketo REST API returns empty result[] | Community
Skip to main content
Franky_Ruyssch2
Level 4
September 27, 2019
Solved

Marketo REST API returns empty result[]

  • September 27, 2019
  • 2 replies
  • 3520 views

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/

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 SanfordWhiteman
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...

2 replies

SanfordWhiteman
Level 10
September 27, 2019

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.

Kevin_Vanhove
Level 1
September 27, 2019
The lead is queryable but the result is empty.
When querying the leads api (GET /rest/v1/lead/{leadId}.json), for some of the requests, the result[] array of the response is empty. Under what conditions can this happen? And why is it empty?
https://developers.marketo.com/rest-api/endpoint-reference/lead-database-endpoint-reference/#!/Leads/getLeadByIdUsingGET
Thx,
SanfordWhiteman
SanfordWhitemanAccepted solution
Level 10
September 27, 2019
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...