Forum Discussion
mattchowell
Jun 14, 2021Iron Contributor
Post comment to a modern site page using REST api
Using this endpoint: https://xxx.sharepoint.com/sites/xxx/_api/web/Lists/GetByTitle('SitePages')/GetItemById(305)/Comments And this listitementitytypefullname: SP.Data.SitePagesItem Response: ...
- Jun 15, 2021
You need to use Microsoft.SharePoint.Comments.comment as listitementitytypefullname instead of SP.Data.SitePagesItem.
Please click Mark as Best Response & Like if my post helped you to solve your issue. This will help others to find the correct solution easily. It also closes the item. If the post was useful in other ways, please consider giving it Like.
ganeshsanap
Jun 15, 2021MVP
You need to use Microsoft.SharePoint.Comments.comment as listitementitytypefullname instead of SP.Data.SitePagesItem.
Please click Mark as Best Response & Like if my post helped you to solve your issue. This will help others to find the correct solution easily. It also closes the item. If the post was useful in other ways, please consider giving it Like.
- mattchowellJun 15, 2021Iron Contributorganeshsanap Thanks - I did initially try with Microsoft.SharePoint.Comments.comment and it failed probably due to some other issue, but now it works. Do you know if it's possible to reflect a user's name instead of the app name as the author, and if so how?