How to link jira issue and a confluence page via rest

i would like to link a confluence page to a jira issue via rest api from a jira cloud/server app. apparently there is no documentation yet but i noticed a jira-confluence link is created by the remotelink endpoint.

i tried the following:

const data = {
  object: {
    url:properties.pageUrl,
    title:properties.pageTitle || 'Flower Confluence Link'
  },
  application: {type: 'com.atlassian.confluence', name: 'System Confluence'},
  globalId: 'appId=' + '6dd09426-cc5c-48f6-bfff-4c3e7e5a11dc')+ '&pageId=' + properties.pageId,
  relationship: 'Wiki Page'
}
return http.post(config.jira.rest.base + 'issue/' + properties.issueKey + '/remotelink', data);

which worked basically - but from where do i get the confluence-appId??

i tried:

http.get(config.confluence.rest.base + 'settings/systemInfo')

which would be the solution - but a jira-app is not allowed to access a confluence serviceā€¦

but apart of this - is there another best practice approach - something simpler like

linkIssueWithConfluence(issue-key,page-id);