How to open a domain URL in a new tab dynamically using iparam templating?

Hi Guys,

I have tried to open new tab using given domain.

Here is tried code:

var orderDet = "https://<%= oauth_iparams.domain %>/_cpanel/order/vieworder?id=123";

window.open(orderDet, '_blank');

Error in browser:

Failed to execute 'open' on 'Window': Unable to open a window with invalid URL 'https://%3C%25%3D%20oauth_iparams.domain%20%25%3E/_cpanel/order/vieworder?id=123'

Thank you.

Hi Karuppu Samy,

Few pointers which would help us achieve this,

  1. From the documentation OAuth - oauth iparams can be substituted in iparams but only access_token can be used in the app code

  2. And if we have domain as iparam, We can use client object to get the domain to be substituted in the app code as like Installation Parameters

Hi Raghu,

Thanks for the response.

Let me know whether the above suggested method will work for OAuth installation parameter as well?
In client object I could find iparams, but cannot find oauth_iparams.

Please help me to get properties of oauth_iparams.

For your reference, there is a similar plugin developed for shopify. If you could share the code from this plugin might help.

Thanks.

Hi Karuppu Samy,

oauth_iparams ,in general, will also be containing secured data (For eg. client_id and secret_id), Hence it will not be exposed in client object.

We can use iparams(js/html) to input domain during installation and retrieve it through the client object.

1 Like

Hi Raghu,

Thank you for the response.