# Thematic Channel API - The schemes only define the minimum data required from each endpoint for FE, BE might be sending more data over, For example `/posts` might have the same structure as `posts/${id}` since its a list of the same data model. - The `_sendbird` key is an unsafe parameter to use and FE should avoid using it, But considering our current infrastructure we will keep it for now for possible needs. ## Post ### [GET] `/thematic/posts` Returns a list of thematic channel posts for the current user. #### Response ```json { "meta": {}, "data": [ { "id": string, "title": string, "icon": string, "commentsCount": number, "_sendbird": { "id": string, } }, { "id": string, "title": string, "icon": string, "commentsCount": number, "_sendbird": { "id": string, } }, ] } ``` --- ### [GET] `/thematic/post/${id}` Returns the details of a thematic channel post. #### Response ```json { "id": string, "createdAt": number, "content": string, "commentsCount": number, "likesCount": number, "isLiked": boolean, "author": { "id": string, "roarTag": string, "displayName": string, "avatar": string, "isVerified": bolean, }, "_sendbird": { "id": string, } } ``` --- ## Comments ### [GET] `thematic/comments` Returns a list of comments for the given post/comment id, This endpoint has pagination. #### Request ```json { "id": string, "sort": string, "limit": number, "lastId": number, } ``` #### Response ```json { "meta": { "pagination": { // We will skip pagination data for now and use limit and offset. } }, "data": [ { "id": string, "createdAt": number, "content": string, "commentsCount": number, "likesCount": number, "isLiked": boolean, "isOwner": boolean, "author": { "id": string, "roarTag": string, "displayName": string, "avatar": string, "isVerified": bolean, }, "_sendbird": { "id": string, } } ] } ``` --- ### [POST] `thematic/comment` Submits a comment on the given post id. #### Request ```json { "id": string, "content": string, } ``` #### Response ```json [ { "id": string, "createdAt": number, "content": string, "commentsCount": number, "likesCount": number, "isLiked": boolean, "isOwner": boolean, "author": { "id": string, "roarTag": string, "displayName": string, "avatar": string, "isVerified": bolean, }, "_sendbird": { "id": string, } } ] ``` --- ### [GET] `thematic/comment/${id}` Returns the comment details for the given comment id. #### Response ```json { "id": string, "createdAt": number, "content": string, "commentsCount": number, "likesCount": number, "isLiked": boolean, "isOwner": boolean, "author": { "id": string, "roarTag": string, "displayName": string, "avatar": string, "isVerified": bolean, }, "_sendbird": { "id": string, } } ``` --- ### [PUT] `thematic/comment/${id}` Updates the given comment id. #### Request ```json { "content": string, "isLiked": boolean, } ``` #### Response ```json [ { "id": string, "createdAt": number, "content": string, "commentsCount": number, "likesCount": number, "isLiked": boolean, "isOwner": boolean, "author": { "id": string, "roarTag": string, "displayName": string, "avatar": string, "isVerified": bolean, }, "_sendbird": { "id": string, } } ] ```