You're on your way to the next level! Join the Kudos program to earn points and save your progress.
Level 1: Seed
25 / 150 points
Next: Root
1 badge earned
Challenges come and go, but your rewards stay with you. Do more to earn more!
What goes around comes around! Share the love by gifting kudos to your peers.
Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!
Join now to unlock these features and more
The Atlassian Community can help you and your team get more value out of Atlassian products and practices.
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>
---------------------------------
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.