How do I check what munchkins are associated with a lead?

Highlighted
Level 1

How do I check what munchkins are associated with a lead?

I'm happy to provide more specific information if needed but basically:

 

1) User submits form

2) We push lead to Marketo using REST API (/rest/v1/leads/push.json)
3) We associate munchkin with the lead with REST API (/rest/v1/leads/{leadId}/associate.json)

How do I check if this munchkin has been successfully associated?

 

12 REPLIES 12
Highlighted
Level 10 - Community Moderator

Re: How do I check what munchkins are associated with a lead?

If the cookie exists at all, then a successful call to the Associate Lead endpoint means it was associated.

 

You do not want to be checking the cookies field after every association, that would be a worst practice.

Highlighted
Level 1

Re: How do I check what munchkins are associated with a lead?

Thanks so much for the quick response Sandford.

Yes, I will not be deploying a check of the cookies field into prod however, when I tried to check it to see if it was working correctly it's value was null. Does that mean it hasn't been associated?

The way I tried to check was again with the REST API (/rest/v1/lead/{leadId}.json?fields=cookies`).

Highlighted
Level 10 - Community Moderator

Re: How do I check what munchkins are associated with a lead?

That is indeed the way to spot-check. Are you sure you URL-encoded the cookie value correctly?

Highlighted
Level 1

Re: How do I check what munchkins are associated with a lead?

I am not sure TBH. I am currently grabbing the _mkto_trk cookie value and passing that through so is request looks something like:

https://000-aaa-777.mktorest.com/rest/v1/leads/1234567/associate.json?cookie=id:000-AAA-777&token:_m...

Highlighted
Level 10 - Community Moderator

Re: How do I check what munchkins are associated with a lead?

 I am currently grabbing the _mkto_trk cookie value and passing that through so is request looks something like:

https://000-aaa-777.mktorest.com/rest/v1/leads/1234567/associate.json?cookie=id:000-AAA-777&token:_m...

You can't send the token unencoded like that, the "&" is going to break the query string into two parts, by definition.

 

You must always, always URI encode any query param name or param value. 

Highlighted
Level 1

Re: How do I check what munchkins are associated with a lead?

Ahhh, thank you so much! That was the issue. You have helped me a lot. 

Highlighted
Level 10 - Community Moderator

Re: How do I check what munchkins are associated with a lead?

OK, pls mark one of my answers as the Solution, thx.

Highlighted
Level 1

Re: How do I check what munchkins are associated with a lead?

Ahhh, thank you so much! That was the issue. You have helped me a lot.

Highlighted
Level 10 - Community Moderator

Re: How do I check what munchkins are associated with a lead?

@Dev_Team pls return to the thread and mark one of my answers as the Solution, thanks.