Posting comments to a Sharepoint site page using REST api's

My question:
I’m testing Sharepoint REST api’s in PM and trying to figure out how to post comments to a site page. I’ve already resolved access token issues and found the endpoints required.

Details (like screenshots):
Endpoint:

/_api/web/Lists('<sitepagesguid>')/GetItemById(305)/Comments

Response:

The expression \"web/Lists('xxxx')/GetItemById(305)/Comments\" is not valid.
It IS valid - at least according to Msft and other articles I've read. Anyone have any luck getting this to work?

Hey @matthowell - welcome to the Postman Community!

Would you be able to share more about your problem using a public collection? Here’s how.

Have you gotten any other PUT or POST requests to work with this API?

Thanks @hannah.neil. I don’t think a public collection would work because of the credentials needed to access Sharepoint.
I have been able to POST items to Sharepoint lists, but the site page comments are handled differently from a regular list. As far as I can tell they are associated with a page but stored outside Sharepoint.

I was able to figure it out - I think I had a typo in the url, and it’s hard to confirm anything in Msft’s scattered and incomplete documentation :
URL /_api/web/Lists(‘list guid’)/GetItemById(305)/Comments
Accept application/json;odata=verbose
Content-Type application/json;odata=verbose
Auth Bearer {{access token}}
Listitementitytypefullname Microsoft.SharePoint.Comments.comment
Body
{

"__metadata": {

    "type": "Microsoft.SharePoint.Comments.comment"

},

"text": "Comment added using SharePoint REST API"

}

Glad you figured it out. Typos get me a lot too :woman_facepalming: Thanks for letting us know what worked :slight_smile: