SOLVED

Marketo REST API returns empty result[]

Go to solution
Franky_Ruyssch2
Level 4

Marketo REST API returns empty result[]

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/

Franky Ruysschaert
Tags (1)
1 ACCEPTED SOLUTION

Accepted Solutions
SanfordWhiteman
Level 10 - Community Moderator

Re: Marketo REST API returns empty result[]

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

View solution in original post

3 REPLIES 3
SanfordWhiteman
Level 10 - Community Moderator

Re: Marketo REST API returns empty result[]

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

Re: Marketo REST API returns empty result[]

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
Level 10 - Community Moderator

Re: Marketo REST API returns empty result[]

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