Hi,
I am writing a Confluence User-Macro and I want to "notify" our users. I have searched for sending mails / notifications or something like this but I could not find anything. Then I spotted the "Share"-Button on the pages.
I did some research and found the REST call to:
POST /rest/share-page/latest/share
With a payload of the format of:
{
"users": [],
"emails": [],
"groups": [],
"note": "",
"entityId": "",
"entityType": "",
"contextualPageId": ""
}
Then I have searched the web for the documentation of the REST API of "com.atlassian.confluence.plugins.share-page" but I could not find anything.
I have spotted the plugin at https://packages.atlassian.com/webapp/ but without any hints about the REST API. JavaDoc is empty and no source code.
Found this through: share page. any events fired ?
Can you please provide / share me the documentation of the REST API of this plugin?
Thanks, Daniel
Try this:
---------------------------------
<button id="shareIT" class="aui-button aui-button-primary">share it</button>
<br>
<hr>
<script type="text/javascript">
AJS.toInit(function() {
jQuery("#shareIT").click(function() {
var jsondata = {
//users: ["123c02b50038b550150038e09de1cc1"],
contextualPageId: "3942484297",
emails: ["example@test.com"],
entityId: "3942484297",
entityType: "page",
//groups: [],
note: "A example page"
};
jQuery.ajax({
type: "POST",
url: "/rest/share-page/latest/share",
contentType:"application/json; charset=utf-8",
dataType: "json",
async: false,
data: JSON.stringify(jsondata),
success: function () { alert('Page shared with ' + jsondata.emails); },
fail: function () { alert('Error'); }
});
/*******************************************************/
} );
</script>
---------------------------------
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.