Documentation and samples on how to use likedByInformation while reading from a sharepoint list

Shreya Agrawal 40 Reputation points Microsoft Employee
2024-03-19T12:09:20.6133333+00:00

Hi ,

We are developing an upvote functionality for a single page application where we show a list of assets by reading the data from a sharepoint list
API used -
https://sitename.sharepoint.com/teams/TeamName/_api/web/lists/getbyTitle('SPListName')/items?filter=IsActive%20eq%201&$select=Id,Title,AssetDescription,ProductName,AssetType,CreatedOn,Image,LinktoAsset,Editor/Title&$expand=Editor/Id&$orderby=CreatedOn%20desc&$top=1000

We are developing an upvote functionality on this asset list and would like to give users the capability to increment the LikesCount on the Number Of Likes OOTB column on the list.

Do we have any documentation around the APIs we can use to UPDATE and GET the likedByInformation from our SP list for all the items in single call?
Also, any suggestions on API which can help us achieve this functionality for each of the items in our SPList .

SharePoint
SharePoint
A group of Microsoft Products and technologies used for sharing and managing content, knowledge, and applications.
10,300 questions
SharePoint Development
SharePoint Development
SharePoint: A group of Microsoft Products and technologies used for sharing and managing content, knowledge, and applications.Development: The process of researching, productizing, and refining new or existing technologies.
2,810 questions
{count} votes

Accepted answer
  1. RaytheonXie_MSFT 33,641 Reputation points Microsoft Vendor
    2024-03-20T06:34:26.69+00:00

    Hi @Shreya Agrawal,

    You could refer to the following document

    https://learn.microsoft.com/en-us/openspecs/sharepoint_protocols/ms-csomspt/3af90e3a-bd2f-4d14-a99f-8ab6fe0285fa?redirectedfrom=MSDN

    After doing some research, we could only update one item likedByInformation with a single rest api call. But we could get all items likedByInformation by following api

    http://sharepointsite.com/sites/sitename/_api/Web/Lists/GetByTitle('List%20Name')/items?$select=Title,LikesCount,LikedBy/Title&$expand=LikedBy
    

    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    1 person found this answer helpful.

0 additional answers

Sort by: Most helpful