How to display a REST service response in a popup window.

Anonymous
Not applicable

How to display a REST service response in a popup window.

I am trying to display a response having multiple rows to the user in a popup window so that user can select the desire one and mapped in available response mapping.

Is there any way in Marketo to achieve this functionality.

Best regards,

Deepak

4 REPLIES 4
SanfordWhiteman
Level 10 - Community Moderator

Re: How to display a REST service response in a popup window.

Not sure what this has to do with Marketo specifically -- I sure hope you're not talking about calling Marketo's REST API from within the browser!

In general, you'd be talking about an XDomainRequest (older IE) or XMLHttpRequest 2 with CORS.  There are 1000s of articles about these technologies on the web.  Note that if the REST service doesn't want to be called cross-domain, you won't be able to force it.  If you provide more detail maybe we look into the feasibility.

Anonymous
Not applicable

Re: How to display a REST service response in a popup window.

Hi Sanford,

Thanks for your reply.

The REST service which i have mentioned is not Marketo service, it is third party service which we have configured inside the webhook.

My use case is that, I want to show the response in popup window to the user and then based on the user selection will do the response mapping.

How can i  achieve this functionality in Marketo.

Best Regards,

Deepak

Kenny_Elkington
Marketo Employee

Re: How to display a REST service response in a popup window.

Marketo Webhooks can't be called synchronously with page views, so I would say that this is the wrong approach.  I would look into doing this via AJAX in the browser, or proxied through your own server.

SanfordWhiteman
Level 10 - Community Moderator

Re: How to display a REST service response in a popup window.

Deepak, like Kenny said (and this may already be clear to you) there's no need to define a webhook if what you actually want to do is call the service from the browser. 

What you're talking about is a pretty typical "client-side lead enrichment" approach where a form is populated with additional data based on calls to a remote service.  Typically such data is put in hidden fields (for the frank reason that you don't want to tell the user how much info you've looked up about them), but it can also be presented for user confirmation/modification.

What you actually need is a service that can be called from the browser -- simple as that.  Parsing the service response into a popup, adding hidden fields, all that is basic stuff.