We want to get daily information about user activity (e.g. creating or modifying a page, adding a comment, etc.) via the confluence cloud API. As I understand, there is no specific method for this.
I tried to do this with separate methods, but ran into difficulties:
- The inline-comments and footer-comments methods give all comments at once (within the limit). That is, I would first need to get all of them (even sorted by date of change) and only then filter for yesterday’s date.
- There is no method that would output the whole history of a page with the user who changed it, as well as the date and time of change.
Maybe I went down the wrong path and there is an easier way to get user activity.
Has anyone experienced this problem yet?
Are you restricted to using the REST API, or can you use webhooks ? https://developer.atlassian.com/cloud/confluence/modules/webhook/
You can use this API to retrieve page history: https://developer.atlassian.com/cloud/confluence/rest/v2/api-group-version/#api-pages-id-versions-get
I haven’t tested it, but I believe the authorId field is the user who made the changes.
Hello, thanks for the reply.
I didn’t consider webhook as a solution, I might be wrong, I’ll have a look.
I can use the API, but using the
Get page versions method will only get the current and previous version, but I want to have all versions on one request…
I just tested it successfully on a page with 5 versions and all 5 versions were correctly returned. Have you set a limit, or are you testing on a page with only 2 versions?
export pageId = ...
export instance = ...
curl --location "https://$instance/wiki/api/v2/pages/$pageId/versions"
I missed the versions methods at all.
Thanks for the help, this is just what I need.