Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

How to get a Like & Label list user details for particular page in confluence

karthick tgi January 6, 2019

Hi Team,

I need a Rest API service for getting a Like & Label list user details for the particular page in confluence.

Please let me know if it is possible or not.

If possible then how can we achieve.

Is there anything please share with me your ideas or API.

 

Thanks and regards

Karthick

2 answers

1 accepted

0 votes
Answer accepted
Shannon S
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
January 8, 2019

Karthick,

Can you let me know what information you want to display when you say you want to get a Like & Label list user details?

Regards,

Shannon

karthick tgi January 8, 2019

Thanks for your reply @Shannon S

I need a User details those who all are "LIKE" my confluence page. I don't need the user details who like comments and nested comments.

These details is help for me to display dashboard .

In Getting the confluence page space details API . I got the like details in HTML format. its not helpful for me.

In Labels also need user details its display only label details

FYI please refer screenshotpicturemessage_2qfn3ptq.idi.png

Shannon S
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
January 8, 2019

Karthick,

The REST API to obtain likes is from /rest/likes/1.0/content, so for example, if I want to get a list of likes on a specific page:

GET https://shannonspaniol.atlassian.net/wiki/rest/likes/1.0/content/1234567/likes

However, you would need to do several API calls, such as one to get the list of users, and compare it to the user ID of the vote. 

The HTML format you are referring to is JSON and it's the default format that API calls return information. You would need adjust the format yourself in your code to make it human readable. 

For example: JSON to HTML Table

For further details on using the REST API, have a look at our Confluence Cloud REST API Documentation.

Regards,

Shannon

Like # people like this
karthick tgi January 9, 2019

@Shannon S Thanks for your valuable reply its working fine. 

Question 1 :

Here the likes user details came using these API . but the same time i need a user details those who all are created the labels.

I searched the API for that its not available. Its get only labels count and labels details API's alone.

 

Question 2:

For Example,

In my confluence page there are 1000 of users like the page and comments_like also. How can we set the pagination for like API service because all other API's are have pagination limit size. 

I have a doubt either it can be show all the likes in single page itself.?

Shannon S
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
January 9, 2019

Karthick,

There's a User Macro that Stephen Deutsch posted on the below thread:

I am aware that you cannot use User Macros in Cloud, but perhaps you may be able to reverse-engineer it for your needs?

For pagination, could you try what's listed here? 

Pagination: The Confluence REST API uses pagination: a method that returns a response with multiple objects can only return a limited number at one time. This limits the size of responses and conserves server resources.

Use the 'limit' and 'start' query parameters to specify pagination:

  • limit is the number of objects to return per page. This may be restricted by system limits.
  • start is the index of the first item returned in the page of results. The base index is 0.

For example, the following request will return ten content objects, starting from the fifth object.

GET /wiki/rest/api/content?start=4,limit=10
I hope that helps! 

Regards,

Shannon

karthick tgi January 9, 2019

Thnak you @Shannon S For your wonderful reply and i have cleared appearance about this.

Shannon S
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
January 10, 2019

Happy to help, Karthick!

Have a pleasant rest of your week.

Regards,

Shannon

karthick tgi January 10, 2019

Hello @Shannon S need your help for my query.

I need to take the particular date between of records which i was created in the confluence space.

I tried this API for getting the list of pages i was created in confluence. But the same time i need a particular date between basis.

GET /wiki/rest/api/content/{spaceid}.

Shannon S
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
January 10, 2019

Karthick,

Can you clarify what you mean by "need to take the particular date between of records"?  I'm not sure what it is you want to get from the API.

Are you looking for a way to pull a list of pages created in Confluence (by a particular user) between a date range? I would recommend raising a new question for that, since it's not directly related to your original question.

Regards,

Shannon

0 votes
Move Work Forward
Atlassian Partner
February 26, 2020

Hi @Shannon S ,

 

Thanks for all your answers here. I am trying to Like/Unlike a piece of content.

I can do it with the user API token, but not using a Connect App. Getting not authorized response.

Is there a way to use those endpoints by a connect up?

Thanks,
Leo

Shannon S
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
February 27, 2020

Hi Leo,

I'm not really familiar with building Connect Apps myself, but you you can raise the question on our Developer Community, which you can find from our Developer Resources page.

There, the Community members are used to developing Connect add-ons and will be able to give you tips on what might be going on.

 Let me know if you have any trouble raising that.

Shannon

Like Move Work Forward likes this
Move Work Forward
Atlassian Partner
February 27, 2020

Thanks @Shannon S 

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events