Custom UI bridge

Rate this page:

requestConfluence

The requestConfluence bridge method enables custom UI apps to call the Confluence Cloud platform REST API as the current user.

To use the requestConfluence bridge method, you need to define a custom UI resolver using @forge/resolver at version 0.2.0 or later. You don't need to define any functions in the resolver.

Function signature

1
2
3
4
5
6
7
8
9
function requestConfluence(
  path: string,
  options?: RequestInit
): Promise<{
  status: number;
  ok: boolean;
  statusText: string;
  body: { [key in string | number]: any } | string | null;
}>;

Arguments

Returns

  • A Promise that resolves with the REST API response.

Example

1
2
3
4
5
import { requestConfluence } from '@forge/bridge';

requestConfluence('/wiki/rest/api/content').then((response) => {
  console.log(response);
});

Rate this page: