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

**URL:** <https://community.postman.com/t/posting-comments-to-a-sharepoint-site-page-using-rest-apis/24862>\
**Category:** Help Hub\
**Created:** [June 14, 2021, 8:06pm UTC](https://community.postman.com/t/posting-comments-to-a-sharepoint-site-page-using-rest-apis/24862 "2021-06-14T20:06:20Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![matthowell](https://avatars.discourse-cdn.com/v4/letter/m/3ec8ea/32.png) [@matthowell](https://community.postman.com/u/matthowell)\
**Post date:** [June 14, 2021, 8:06pm UTC](https://community.postman.com/t/posting-comments-to-a-sharepoint-site-page-using-rest-apis/24862/1 "2021-06-14T20:06:21Z")

</div>

_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:

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

```

Response:

```auto
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?
```

---

<div class="post-metadata">

**Author:** ![hannah.neil](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/hannah.neil/32/4477_2.png) [@hannah.neil](https://community.postman.com/u/hannah.neil)\
**Post date:** [June 14, 2021, 8:39pm UTC](https://community.postman.com/t/posting-comments-to-a-sharepoint-site-page-using-rest-apis/24862/2 "2021-06-14T20:39:50Z")

</div>

Hey @matthowell - welcome to the Postman Community!

Would you be able to share more about your problem using a public collection? [Here’s how.](https://community.postman.com/t/using-public-workspaces-to-get-help-with-postman/22418)

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

---

<div class="post-metadata">

**Author:** ![matthowell](https://avatars.discourse-cdn.com/v4/letter/m/3ec8ea/32.png) [@matthowell](https://community.postman.com/u/matthowell)\
**Post date:** [June 14, 2021, 9:32pm UTC](https://community.postman.com/t/posting-comments-to-a-sharepoint-site-page-using-rest-apis/24862/3 "2021-06-14T21:32:08Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![matthowell](https://avatars.discourse-cdn.com/v4/letter/m/3ec8ea/32.png) [@matthowell](https://community.postman.com/u/matthowell)\
**Post date:** [June 15, 2021, 1:46pm UTC](https://community.postman.com/t/posting-comments-to-a-sharepoint-site-page-using-rest-apis/24862/4 "2021-06-15T13:46:11Z")

</div>

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"

```

}

---

<div class="post-metadata">

**Author:** ![hannah.neil](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/hannah.neil/32/4477_2.png) [@hannah.neil](https://community.postman.com/u/hannah.neil)\
**Post date:** [June 17, 2021, 11:59pm UTC](https://community.postman.com/t/posting-comments-to-a-sharepoint-site-page-using-rest-apis/24862/5 "2021-06-17T23:59:20Z")

</div>

Glad you figured it out. Typos get me a lot too 🤦‍♀️ Thanks for letting us know what worked 🙂
