Skip to content

Comment API Specification

Suhwan Kim edited this page Nov 5, 2024 · 2 revisions
κΈ°λŠ₯ λ©”μ„œλ“œ URI λΉ„κ³ 
λŒ“κΈ€ 쑰회 GET /v2/feeds/{feed_id}/comments ❌
λŒ“κΈ€ μž‘μ„± POST /v2/feeds/{feed_id}/comments ❌
λŒ“κΈ€ 개수 쑰회 GET /v2/feeds/{feed_id}/comments/count ❌

1️⃣ λŒ“κΈ€ 쑰회

interface Request {
  uri: "/v2/feeds/{feed_id}/comments?page={}&count={}";
  method: "GET";
  query: {
    page: string; // default = 1
    count: string; // default = 10
  }
  body {}
}

interface Response {
  code: "2000";
  data: {
    comments: Comment[]; // 0️⃣ Comment
    currentPageNumber: number; // ν˜„μž¬ νŽ˜μ΄μ§€μ˜ 수
    pageSize: number; // νŽ˜μ΄μ§€ 크기
    numberOfElements: number; // μ‹€μ œ λ°μ΄ν„°μ˜ 수
    hasNext: boolean; // λ‹€μŒ μ‘΄μž¬ν•˜λŠ”μ§€
  };
}

2️⃣ λŒ“κΈ€ μž‘μ„±

interface Request {
  uri: "/v2/feeds/{feed_id}/comments";
  method: "POST";
  body: {
    content: string;
  };
}

interface Response {
  code: "2000";
  data: {};
}

3️⃣ λŒ“κΈ€ 개수 쑰회

interface Request {
  uri: "/v2/feeds/{feed_id}/comments/count";
  method: "GET";
  body: {};
}

interface Response {
  code: "2000";
  data: {
    totalCount: number;
  };
}