URL for Forge app

Hi,

In my connect plugin, My app (For example: hosted on www.abc.com) generate a javascript code which user can embed in his website/app. This javascript loads javascript file from www.abc.com (my connect app url) and also calls some API from my App url.

  • How can i achieve the same with Forge app? How to get url of forge app hosted environment?
  • Is this url can be used to call API?
  • Is this URL changes or remains same?
  • Is there a possibility to map www.abc.com domain to the forge app url?

Thanks
Shiv

Web triggers can return data, would that meet your needs? https://developer.atlassian.com/platform/forge/manifest-reference/modules/web-trigger/

Yes this works. But when i tried to embed this webtrigger url in https://77e69e7a-2e4e-417c-a279-0f65a519c9ae.hello.atlassian-dev.net/x1/h76mmE0rfv_6T0sApGFE6z34GCw in the iframe as src. It gives me “424 Failed Dependency”. Is there a way to define cross origin policy so that this url can be rendered in iframe?

You can check this recently published video about web triggers for implementing REST endpoints for an app:

Thanks for sharing this video, but we have a requirement where I need to show the web trigger URL in an iframe. This video does not answer this. I tried setting up ‘X-Frame-Options’, ‘Content-Security-Policy’ and ‘Access-Control-Allow-Origin’ headers in the trigger response, but it did not worked.

I think setting fetch.client permissions might be what you need? https://developer.atlassian.com/platform/forge/manifest-reference/permissions/#fetch

added below in manifest

 external:
    frames:
      - 'https://*.hello.atlassian-dev.net'
    fetch:
      client:
        - 'https://*.hello.atlassian-dev.net'    
      backend:
        - 'https://*.hello.atlassian-dev.net'

still getting in the response
x-frame-options: DENY

The URL should be the URL of the web trigger itself - is that the format of the web trigger URL? And did you re-install to get the latest version?

Also try without the https:// prefix.

Added below configuration

  external:
    frames:
      - 'https://*.hello.atlassian-dev.net'
      - '*.hello.atlassian-dev.net'
    fetch:
      client:
        - 'https://*.hello.atlassian-dev.net'    
        - '*.hello.atlassian-dev.net'    
      backend:
        - 'https://*.hello.atlassian-dev.net'    
        - '*.hello.atlassian-dev.net'            

The trigger url is

https://77e69e7a-2e4e-417c-a279-0f65a519c9ae.hello.atlassian-dev.net/x1/T6iPyWp2oBni-HOaimazy-C5Z48

Above url is working in the browser.
However if i create test.html with below code

<html>
<head>
</head>
<body>
Hi this is test page<br/>
<iframe src="https://77e69e7a-2e4e-417c-a279-0f65a519c9ae.hello.atlassian-dev.net/x1/T6iPyWp2oBni-HOaimazy-C5Z48"/>
<body>
</html>

iframe refuse to render.
deployed and reinstalled each time manifest is changed

My apologies, I think you actually need to declare the URL as a frames permission.

Thanks for response, using frames you can access external site in your app ui. However my requirement is bit different, i want to use trigger url as src in iframe in external site.

This topic was automatically closed after 30 days. New replies are no longer allowed.