Munchkin Success response

Highlighted
Level 1

Munchkin Success response

How to identify that munchkin.munchkinFunction('associateLead', { 'Email': email }, hash); GET service is successful? Does this function has a callback using Javascript GET ? 

Need to write some code on success of this API.  

Tags (1)
3 REPLIES 3
Level 10 - Community Moderator

Re: Munchkin Success response

There's no callback, but more important: the completion of this GET doesn't mean the current session cookie is associated when the response is complete. It's merely queued for association, as with a form post. (The association could happen as little as 1ms later, but regardless, the point is it isn't synchronous, and it certainly may take a few seconds under load.)

The GET can only fail of the hash key is wrong (which is de facto impossible for server code you control) or if the Munchkin server is down (or inaccessible due to Tracking Protection, but you'd know you didn't have the global Munchkin object in this case). What exactly are you trying to do when the association (or attempt to associate) is complete? What's the biz logic here?

Highlighted
Level 1

Re: Munchkin Success response

I need to run a service call after the success of the munchkin response.

Highlighted
Level 10 - Community Moderator

Re: Munchkin Success response

You haven't explained your use case. The "success" of the response is just the HTTP 200. It doesn't mean the association is complete. Please be specific about what you're trying to accomplish.