How to get a Like & Label list user details for particular page in confluence
Asked by karthick tgi:

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


Answers:
author: Shannon S
body: 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

comments: author: karthick tgi
body: Thanks for your reply [@Shannon S](/t5/user/viewprofilepage/user-id/510046)

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 screenshot![picturemessage_2qfn3ptq.idi.png](https://community.atlassian.com/t5/image/serverpage/image-id/41867i473370291A611F8D/image-size/large?v=v2&px=999 "picturemessage_2qfn3ptq.idi.png")


author: Shannon S
body: 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](https://www.w3schools.com/js/js_json_html.asp)

For further details on using the REST API, have a look at our [Confluence Cloud REST API Documentation](https://developer.atlassian.com/cloud/confluence/rest/).

Regards,

Shannon


author: karthick tgi
body: [@Shannon S](/t5/user/viewprofilepage/user-id/510046) 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.?


author: Shannon S
body: Karthick,

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

* [How can I tell who added a given label?](https://community.atlassian.com/t5/Confluence-questions/How-can-I-tell-who-added-a-given-label/qaq-p/275547)

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?

* [Confluence Cloud REST API](https://developer.atlassian.com/cloud/confluence/rest/)

> **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


author: karthick tgi
body: Thnak you [@Shannon S](/t5/user/viewprofilepage/user-id/510046) For your wonderful reply and i have cleared appearance about this.


author: Shannon S
body: Happy to help, Karthick!

Have a pleasant rest of your week.

Regards,

Shannon


author: karthick tgi
body: Hello [@Shannon S](/t5/user/viewprofilepage/user-id/510046) 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}.


author: Shannon S
body: 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


author: Move Work Forward
body: Hi [@Shannon S](/t5/user/viewprofilepage/user-id/510046) ,

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

comments: author: Shannon S
body: 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](http://developer.atlassian.com/resources).

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


author: Move Work Forward
body: Thanks [@Shannon S](/t5/user/viewprofilepage/user-id/510046)


Tags: atl-adm

cloud

confluence-cloud