GET

List Comments By Resource


Developer Preview

This API is subject to change. Bug fixes and new features will be released based on developer feedback throughout the preview period.

Lists published comments and replies from a specified resource, such as a blog post.

Authentication

You can only call this method when authenticated as a Wix app or Wix user identity.

Permissions
Manage Comments
Read Comments
Learn more about app permissions.
Endpoint
GET
https://www.wixapis.com/comments/v1/comments/list-by-resource

Query Params
appIdstringRequired

ID of the app from which the comments are listed.


contextIdstringRequired

ID of the specific context the comment is in response to.

Within some Wix apps, the contextId will be the same as the resourceId. For example in Wix Forum, the forumPostId is used as both the contextId and the resourceId.


contextTypestring

Reserved for internal use.


resourceIdstringRequired

ID of the specific resource that the comment is in response to.

Within some Wix apps, the resourceId will be the same as the contextId. For example in Wix Forum, the forumPostId is used as both the resourceId and the contextId.


commentSort.orderstring

Sort order.


commentSort.keepMarkedInOriginalOrderboolean

If set to true, marked comments appear in the original order, and not at the top of the list.

Default: false. This means that marked comments are prioritized and listed first.


replySort.orderstring

Sort order.


replySort.keepMarkedInOriginalOrderboolean

Whether the marked comments are listed in the original order.

If set to true, marked comments appear in the original order, and not at the top of the list.

Default: false. In this case marked comments are prioritized and listed first.


cursorPaging.cursorstring

Pointer to the next or previous page in the list of results.


cursorPaging.limitintegerminimum 1maximum 100format int32

Number of items to return.


cursorPaging.repliesLimitintegerminimum 0maximum 100format int32

Maximum number of replies in a response. Only applicable to parent comments.

Response Object
commentsArray <Comment>

Listed comments.


pagingMetadataPagingMetadata

Paging metadata.


commentRepliesMap <string, RepliesListResponse>format map

Listed comment replies.

Retrieves a list of comments where they're sorted by oldest first, and marked comments are moved to the top of the list. Replies are sorted by newest first. The limit is set to 2 comments and 1 reply for each comment.

Request
cURL
curl GET https://wixapis.com/comments/v1/comments/list-by-resource \ -H 'Content-Type: application/json;charset=UTF-8' \ -H 'Authorization: <AUTH>' \ -d appId=148c2287-c669-d849-d153-463c7486a694 \ -d contextId=6f46dbf6-1a48-4870-86b2-f807d8f31b3e \ -d resourceId=fef60f63-1c88-40e1-bc31-4ac65aa56b03 \ -d commentSort.order=NEWEST_FIRST \ -d replySort.order=OLDEST_FIRST \ -d replySort.keepMarkedInOriginalOrder=true \ -d cursorPaging.limit=2 \ -d cursorPaging.repliesLimit=1
Response
JSON
{ "comments": [ { "id": "4d97c478-4854-4957-9911-8ff29aba35c7", "revision": "1", "createdDate": "2023-05-09T08: 25: 05.014Z", "updatedDate": "2023-05-09T08: 25: 05.014Z", "appId": "148c2287-c669-d849-d153-463c7486a694", "contextId": "6f46dbf6-1a48-4870-86b2-f807d8f31b3e", "resourceId": "fef60f63-1c88-40e1-bc31-4ac65aa56b03", "content": { "richContent": { "nodes": [ { "type": "PARAGRAPH", "id": "foo", "nodes": [ { "type": "TEXT", "textData": { "text": "Interesting 🤯" } } ] } ], "metadata": { "version": 1, "createdTimestamp": "2023-05-09T08: 25: 01.014Z", "updatedTimestamp": "2023-05-09T08: 25: 01.014Z", "id": "726cb137-a9c3-408b-9cc2-2b64c6be8a95" } }, "mentions": [], "attachments": [] }, "author": { "memberId": "81b3e2a2-60f4-4016-ab20-c2fda4c4c4f2" }, "parentIdsInThread": [], "replyCount": 0, "voteSummary": { "netVoteCount": 0, "upvoteCount": 0, "downvoteCount": 0 }, "status": "PUBLISHED", "reactionSummary": { "total": 0, "reactionCodeCount": {} }, "marked": false }, { "id": "90616636-cfe2-4f3d-88ce-1c3d8e3eaa67", "revision": "1", "createdDate": "2023-05-09T08: 25: 08.060Z", "updatedDate": "2023-05-18T11: 59: 38.251Z", "appId": "148c2287-c669-d849-d153-463c7486a694", "contextId": "6f46dbf6-1a48-4870-86b2-f807d8f31b3e", "resourceId": "fef60f63-1c88-40e1-bc31-4ac65aa56b03", "content": { "richContent": { "nodes": [ { "type": "PARAGRAPH", "id": "foo", "nodes": [ { "type": "TEXT", "textData": { "text": "Great insights!" } } ] } ], "metadata": { "version": 1, "createdTimestamp": "2023-05-09T08: 25: 02.060Z", "updatedTimestamp": "2023-05-09T08: 25: 02.060Z", "id": "726cb137-a9c3-408b-9cc2-2b64c6be8a95" } }, "mentions": [], "attachments": [] }, "author": { "memberId": "81b3e2a2-60f4-4016-ab20-c2fda4c4c4f2" }, "parentIdsInThread": [], "replyCount": 4, "voteSummary": { "netVoteCount": 0, "upvoteCount": 0, "downvoteCount": 0 }, "status": "PUBLISHED", "reactionSummary": { "total": 0, "reactionCodeCount": {} }, "marked": false } ], "pagingMetadata": { "count": 2, "cursors": { "next": "8537f74301bdbe97cc040d06ccaded37dd885983.EgoKBm1hcmtlZBABEg0KC2NyZWF0ZWREYXRlIgsKBm1hcmtlZBIBMCInCgtjcmVhdGVkRGF0ZRIYMjAyMy0wNS0wOVQwODoyNTowOC4wNjBa" }, "hasNext": true }, "commentReplies": { "4d97c478-4854-4957-9911-8ff29aba35c7": { "replies": [], "pagingMetadata": { "count": 0, "cursors": {}, "hasNext": false } }, "90616636-cfe2-4f3d-88ce-1c3d8e3eaa67": { "replies": [ { "id": "6521892d-0d48-4bf7-990f-3d1617b03ba7", "revision": "1", "createdDate": "2023-05-18T11: 59: 37.988Z", "updatedDate": "2023-05-18T11: 59: 37.988Z", "appId": "148c2287-c669-d849-d153-463c7486a694", "contextId": "6f46dbf6-1a48-4870-86b2-f807d8f31b3e", "resourceId": "fef60f63-1c88-40e1-bc31-4ac65aa56b03", "content": { "richContent": { "nodes": [ { "type": "PARAGRAPH", "id": "foo", "nodes": [ { "type": "TEXT", "textData": { "text": "Thanks!" } } ] } ], "metadata": { "version": 1, "createdTimestamp": "2023-05-18T11: 59: 31.988Z", "updatedTimestamp": "2023-05-18T11: 59: 31.988Z", "id": "726cb137-a9c3-408b-9cc2-2b64c6be8a95" } }, "mentions": [], "attachments": [] }, "author": { "visitorId": "6bbaac7c-c838-4865-930b-110b94edca90" }, "parentComment": { "id": "90616636-cfe2-4f3d-88ce-1c3d8e3eaa67", "author": { "memberId": "81b3e2a2-60f4-4016-ab20-c2fda4c4c4f2" } }, "parentIdsInThread": ["90616636-cfe2-4f3d-88ce-1c3d8e3eaa67"], "replyCount": 0, "voteSummary": { "netVoteCount": 0, "upvoteCount": 0, "downvoteCount": 0 }, "status": "PUBLISHED", "reactionSummary": { "total": 0, "reactionCodeCount": {} }, "marked": false } ], "pagingMetadata": { "count": 1, "cursors": { "next": "bb32e18e7d5ccd280ec74ceef6aa7a2d97e9b119.Eg8KC2NyZWF0ZWREYXRlEAEaJgokOTA2MTY2MzYtY2ZlMi00ZjNkLTg4Y2UtMWMzZDhlM2VhYTY3IicKC2NyZWF0ZWREYXRlEhgyMDIzLTA1LTE4VDExOjU5OjM3Ljk4OFo=" }, "hasNext": true } } } }
Errors

This method doesn’t return any custom errors, but may return standard errors. Learn more about standard Wix errors.

Did this help?