From fc62ef976376918c3e3539860c41e0eece163ee5 Mon Sep 17 00:00:00 2001 From: ChunkyProgrammer <78101139+ChunkyProgrammer@users.noreply.github.com> Date: Sun, 19 Mar 2023 09:33:34 -0400 Subject: [PATCH] add documentation for channel community endpoint (#333) Co-authored-by: Samantaz Fox --- docs/api/channels_endpoint.md | 78 +++++++++++++++++++++++++++++++++++ 1 file changed, 78 insertions(+) diff --git a/docs/api/channels_endpoint.md b/docs/api/channels_endpoint.md index 4868f61..642577e 100644 --- a/docs/api/channels_endpoint.md +++ b/docs/api/channels_endpoint.md @@ -125,3 +125,81 @@ See: GET `/api/v1/channels/:id/videos` "continuation": String } ``` + +##### GET `/api/v1/channels/:id/community` + +Please refer to the [Community Post Attachment types](#community-post-attachment-types) below for more details on the attachment JSON objects used below. + +> Url parameters + +* `continuation`: A continuation token to get the next chunk of items. + +> Response: + +```javascript +{ + "authorId": String, + "comments": { + "attachment": ImageAttachment | MultiImageAttachment | VideoAttachment | PollAttachment + "author": String, + "authorIsChannelOwner": Boolean + "authorId": String, + "authorThumbnails": ImageObject[], + "authorUrl": String, + "commentId": String, + "content": String, + "contentHtml": String, + "isEdited": Boolean, + "likeCount": Number, + "published": Number, + "publishedText": String, + "replyCount": Number + }[] +} +``` +###### Community Post Attachment Types +__VideoAttachment__ +See [VideoObject](./common_types.md#videoobject) common type + +__ImageAttachment__ + +```javascript +{ + "type": "image", + "imageThumbnails": ImageObject[] +} +``` + +__MultiImageAttachment__ + +```javascript +{ + "type": "multiImage", + "images": ImageObject[][] +} +``` + +__PollAttachment__ + +```javascript +{ + "type": "poll", + "totalVotes": Number, + "choices": { + "text": String, + "image?": ImageObject[] + }[] + +} +``` + +__Unknown__ + +This usually means that parsing support for the attachment type has not yet been implemented. + +```javascript +{ + "type": "unknown", + "error": String +} +```