Atlassian has announced the timeline for Connect's phased end-of-support.
From Sep 17, 2025, only Forge apps can be submitted to the Atlassian Marketplace. All new extensibility features will be delivered only on Forge.
Have an existing Connect app? Find out how to incrementally adopt Forge from Connect.
The Request Javascript module provides a mechanism for an add-on rendered in an iframe to make an XMLHttpRequest to the host product without requiring CORS.
In contrast to REST calls made from the add-on server to the product directly, any requests made in the browser are evaluated in the context of the currently logged in user. The requested resource is still evaluated against the add-ons granted scopes.
allows for dynamic rejection of ajax requests before they can be invoked. eg: by checking against a whitelist
Execute an XMLHttpRequest as a Promise, or via callbacks, in the context of the host application. The format of the response (dataType) will be set to "text" as default; however, if binary data is requested, it will be set to "arraybuffer".
Name | Type | Description | ||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
url | String | Either the URI to request or an options object (as below) containing at least a 'url' property; | ||||||||||||||||||||||||||||||||||||||||||||
options | Object | The options of the request. Properties
|
1 2// A simple POST request which logs response in the console. AP.request({ url: '/rest/api/latest/...', type: 'POST', data: {name: 'some text', description: 'test'}, success: function(responseText){ console.log(responseText); }, error: function(xhr, statusText, errorThrown){ console.log(arguments); } });
1 2// Upload an attachment to a Confluence entity. var fileToUpload = document.getElementById("fileInput").files[0]; AP.request({ url: '/rest/api/content/123456/child/attachment', type: 'POST', contentType: 'multipart/form-data', data: {comment: 'example comment', file: fileToUpload}, success: function(responseText){ alert(responseText); } });
1 2// Get the current user info using a Promise AP.request('/rest/api/user/current') .then(data => alert(data.body)) .catch(e => alert(e.err));
Rate this page: