API
Webtoon
Asset API

웹툰 Asset API

웹툰 서비스에서 웹툰을 만들기위한 기본 에셋에 대한 API정의입니다. 메인화면에서 비디오를 시청한 만큼 사용자에게는 비디오와 연관된 webtoon의 다양한 에셋을 추가적으로 부여받을수 있습니다.

비디오 시청 정보 입력

사용자가 웹툰 비디오 시청 정보를 입력합니다. 사용자의 비디오 시청 구간과 완료 여부를 저장할 수 있습니다.

Operation

mutation CreateWebtoonVideoWatchedInfo($input: CreateWebtoonVideoWatchedInfoInput!) {
  createWebtoonVideoWatchedInfo(input: $input)
}

Variables

{
  "input": {
    "videoId": "비디오 ID",
    "playTimes": [
      {
        "start": 0,
        "end": 120,
        "timestamp": 1610000000
      }
    ],
    "isDone": true,
    "userNo": 123
  }
}

스토리 생성

새로운 웹툰 스토리를 생성합니다. 제목, 설명, 연관된 이미지 URL 등을 포함하여 스토리를 구성할 수 있습니다.

Operation

mutation CreateWebtoonStory($input: CreateWebtoonStoryInput!) {
  createWebtoonStory(input: $input) {
    id
    title
    description
    imageURLs
  }
}

Variables

{
  "input": {
    "title": "스토리 제목",
    "description": "스토리 설명",
    "imageURLs": ["이미지1 URL", "이미지2 URL"]
  }
}

스토리 수정

기존에 생성된 웹툰 스토리를 수정합니다. 스토리의 제목, 설명, 이미지 등을 업데이트할 수 있습니다.

Operation

mutation UpdateWebtoonStory($input: UpdateWebtoonStoryInput!) {
  updateWebtoonStory(input: $input)
}

Variables

{
  "input": {
    "id": "스토리 ID",
    "title": "새 스토리 제목",
    "description": "새 스토리 설명",
    "imageURLs": ["새 이미지1 URL", "새 이미지2 URL"]
  }
}

스토리 삭제

사용자가 생성한 웹툰 스토리를 삭제합니다.

Operation

mutation DeleteWebtoonStory($input: DeleteWebtoonStoryInput!) {
  deleteWebtoonStory(input: $input)
}

Variables

{
  "input": {
    "id": "스토리 ID"
  }
}

유저 스토리 생성

사용자가 자신의 유저 스토리를 생성합니다. 스토리의 제목과 이미지 URL을 포함하여 스토리를 구성할 수 있습니다.

Operation

mutation CreateWebtoonUserStory($input: CreateWebtoonUserStoryInput!) {
  createWebtoonUserStory(input: $input) {
    id
    title
    imageURL
  }
}

Variables

{
  "input": {
    "title": "유저 스토리 제목",
    "imageURL": "스토리 이미지 URL",
    "visibilityState": "PUBLIC",
    "userNo": 123
  }
}

유저 스토리 수정

사용자가 자신의 유저 스토리를 수정합니다. 제목 또는 이미지 URL을 변경할 수 있습니다.

Operation

mutation UpdateWebtoonUserStory($input: UpdateWebtoonUserStoryInput!) {
  updateWebtoonUserStory(input: $input)
}

Variables

{
  "input": {
    "id": "유저 스토리 ID",
    "title": "새 유저 스토리 제목",
    "imageURL": "새 스토리 이미지 URL",
    "visibilityState": "PRIVATE",
    "userNo": 123
  }
}

유저 스토리 삭제

사용자가 자신의 유저 스토리를 삭제합니다.

Operation

mutation DeleteWebtoonUserStory($input: DeleteWebtoonUserStoryInput!) {
  DeleteWebtoonUserStory(input: $input)
}

Variables

{
  "input": {
    "id": "유저 스토리 ID",
    "userNo": 123
  }
}

스토리 좋아요 토글

사용자가 특정 스토리에 대한 좋아요 상태를 토글합니다. 이미 좋아요 상태라면 해제하고, 그렇지 않다면 좋아요를 등록합니다.

Operation

mutation ToggleWebtoonLike($input: ToggleWebtoonLike!) {
  toggleWebtoonLike(input: $input)
}

Variables

{
  "input": {
    "target": "WEBTOON_STORY",
    "targetId": "스토리 ID",
    "userNo": 123
  }
}

배너 등록

새로운 웹툰 배너를 등록합니다. 배너의 이미지 URL을 포함하여 등록할 수 있습니다.

Operation

mutation CreateWebtoonBanner($input: CreateWebtoonBannerInput!) {
  createWebtoonBanner(input: $input) {
    id
    imageURL
  }
}

Variables

{
  "input": {
    "imageURL": "배너 이미지 URL"
  }
}

배너 수정

기존에 등록된 웹툰 배너의 정보를 수정합니다. 새로운 이미지 URL로 업데이트할 수 있습니다.

Operation

mutation UpdateWebtoonBanner($input: UpdateWebtoonBannerInput!) {
  updateWebtoonBanner(input: $input)
}

Variables

{
  "input": {
    "id": "배너 ID",
    "imageURL": "새 배너 이미지 URL"
  }
}

배너 삭제

등록된 웹툰 배너를 삭제합니다.

Operation

mutation DeleteWebtoonBanner($input: DeleteWebtoonBannerInput!) {
  deleteWebtoonBanner(input: $input)
}

Variables

{
  "input": {
    "id": "배너 ID"
  }
}

웹툰 생성

새로운 웹툰을 생성합니다. 웹툰의 제목, 키 이름, 배경 이미지, 카테고리 ID 등을 포함할 수 있습니다.

Operation

mutation CreateWebtoon($input: CreateWebtoonInput!) {
  createWebtoon(input: $input) {
    id
    title
    keyName
    imageURL
    category {
      id
      name
    }
  }
}

Variables

{
  "input": {
    "title": "웹툰 제목",
    "keyName": "고유 키 이름",
    "imageURL": "배경 이미지 URL",
    "categoryId": "카테고리 ID"
  }
}

웹툰 수정

기존 웹툰의 정보를 수정합니다. 웹툰의 제목, 배경 이미지, 카테고리 ID를 업데이트할 수 있습니다.

Operation

mutation UpdateWebtoon($input: UpdateWebtoonInput!) {
  updateWebtoon(input: $input)
}

Variables

{
  "input": {
    "id": "웹툰 ID",
    "title": "새 웹툰 제목",
    "imageURL": "새 배경 이미지 URL",
    "categoryId": "새 카테고리 ID"
  }
}

웹툰 삭제

특정 웹툰을 삭제합니다.

Operation

mutation DeleteWebtoon($input: DeleteWebtoonInput!) {
  deleteWebtoon(input: $input)
}

Variables

{
  "input": {
    "id": "웹툰 ID"
  }
}

카테고리 등록

새로운 웹툰 카테고리를 등록합니다. 카테고리의 이름과 부모 카테고리 ID, 뎁스를 설정할 수 있습니다.

Operation

mutation CreateWebtoonCategory($input: CreateWebtoonCategoryInput!) {
  createWebtoonCategory(input: $input) {
    id
    name
    depth
    parentCategory {
      id
      name
    }
  }
}

Variables

{
  "input": {
    "name": "카테고리 이름",
    "parentId": "부모 카테고리 ID",
    "depth": 1
  }
}

카테고리 수정

기존 카테고리의 정보를 수정합니다. 카테고리의 이름, 부모 카테고리 ID, 뎁스를 업데이트할 수 있습니다.

Operation

mutation UpdateWebtoonCategory($input: UpdateWebtoonCategoryInput!) {
  updateWebtoonCategory(input: $input)
}

Variables

{
  "input": {
    "id": "카테고리 ID",
    "name": "새 카테고리 이름",
    "parentId": "새 부모 카테고리 ID",
    "depth": 2
  }
}

카테고리 삭제

특정 카테고리를 삭제합니다.

Operation

mutation DeleteWebtoonCategory($input: DeleteWebtoonCategoryInput!) {
  deleteWebtoonCategory(input: $input)
}

Variables

{
  "input": {
    "id": "카테고리 ID"
  }
}

비디오 등록

새로운 웹툰 비디오를 등록합니다. 비디오의 제목, 재생시간, 스트리밍 URL 등을 포함할 수 있습니다.

Operation

mutation CreateWebtoonVideo($input: CreateWebtoonVideoInput!) {
  createWebtoonVideo(input: $input) {
    id
    title
    duration
    streamingURL
    videoURL
    videoSize
    thumbnailURL
  }
}

Variables

{
  "input": {
    "webtoonId": "웹툰 ID",
    "title": "비디오 제목",
    "keyName": "고유 키 이름",
    "duration": 120.5,
    "streamingURL": "스트리밍 URL",
    "videoURL": "원본 비디오 URL",
    "videoSize": 102400,
    "thumbnailURL": "썸네일 URL"
  }
}

비디오 수정

기존에 등록된 웹툰 비디오의 정보를 수정합니다. 비디오의 제목, 재생시간, 스트리밍 URL 등을 업데이트할 수 있습니다.

Operation

mutation UpdateWebtoonVideo($input: UpdateWebtoonVideoInput!) {
  updateWebtoonVideo(input: $input)
}

Variables

{
  "input": {
    "id": "비디오 ID",
    "title": "새 비디오 제목",
    "duration": 130.0,
    "streamingURL": "새 스트리밍 URL",
    "videoURL": "새 원본 비디오 URL",
    "videoSize": 204800,
    "thumbnailURL": "새 썸네일 URL"
  }
}

비디오 삭제

등록된 웹툰 비디오를 삭제합니다.

Operation

mutation DeleteWebtoonVideo($input: DeleteWebtoonVideoInput!) {
  deleteWebtoonVideo(input: $input)
}

Variables

{
  "input": {
    "id": "비디오 ID"
  }
}

댓글 추가

웹툰이나 비디오에 댓글을 추가합니다.

Operation

mutation CreateWebtoonReview($input: CreateWebtoonReviewInput!) {
  createWebtoonReview(input: $input) {
    id
    content
    user {
      id
      name
    }
    createdAt
  }
}

Variables

{
  "input": {
    "target": "WEBTOON_STORY",
    "targetId": "대상 ID",
    "content": "댓글 내용",
    "userNo": 123
  }
}

댓글 삭제

웹툰이나 비디오에 달린 댓글을 삭제합니다.

Operation

mutation DeleteWebtoonReview($input: DeleteWebtoonReviewInput!) {
  deleteWebtoonReview(input: $input)
}

Variables

{
  "input": {
    "id": "댓글 ID",
    "userNo": 123
  }
}

에셋 등록

웹툰 스토리나 배경에 사용될 에셋을 등록합니다.

Operation

mutation CreateWebtoonAsset($input: CreateWebtoonAssetInput!) {
  createWebtoonAsset(input: $input) {
    id
    title
    imageURL
    groupType
  }
}

Variables

{
  "input": {
    "webtoonId": "웹툰 ID",
    "groupType": "BACKGROUND",
    "title": "에셋 제목",
    "imageURL": "에셋 이미지 URL"
  }
}

에셋 수정

등록된 웹툰 에셋의 정보를 수정합니다.

Operation

mutation UpdateWebtoonAsset($input: UpdateWebtoonAssetInput!) {
  updateWebtoonAsset(input: $input)
}

Variables

{
  "input": {
    "id": "에셋 ID",
    "title": "새 에셋 제목",
    "imageURL": "새 에셋 이미지 URL",
    "groupType": "ITEM"
  }
}

에셋 삭제

등록된 웹툰 에셋을 삭제합니다.

Operation

mutation DeleteWebtoonAsset($input: DeleteWebtoonAssetInput!) {
  DeleteWebtoonAsset(input: $input)
}

Variables

{
  "input": {
    "id": "에셋 ID"
  }
}

메인 배너 조회

웹툰의 메인 배너를 조회합니다.

Operation

query {
  webtoonBanners {
    id
    imageURL
    createdAt
    updatedAt
  }
}

비디오 목록

상위 10개, 내가 시청한 비디오 등 필터를 통해 비디오 목록을 검색합니다.

Operation

query WebtoonVideoConnection($input: WebtoonVideoConnectionInput!) {
  webtoonVideoConnection(input: $input) {
    nodes {
      id
      title
      duration
      streamingURL
      videoURL
      videoSize
      thumbnailURL
    }
    totalCount
    pageInfo {
      hasNextPage
      endCursor
    }
  }
}

Variables

{
  "input": {
    "first": 10,
    "after": "커서",
    "where": {
      "title": "비디오 제목",
      "filter": "MONTHLY_BEST"
    },
    "orderby": {
      "field": "CREATED_AT",
      "direction": "DESC"
    }
  }
}

웹툰 목록

웹툰 목록을 조회합니다.

Operation

query WebtoonConnection($input: WebtoonConnectionInput!) {
  webtoonConnection(input: $input) {
    nodes {
      id
      title
      keyName
      imageURL
      category {
        id
        name
      }
    }
    totalCount
    pageInfo {
      hasNextPage
      endCursor
    }
  }
}

Variables

{
  "input": {
    "first": 10,
    "after": "커서",
    "where": {
      "title": "웹툰 제목"
    },
    "orderby": {
      "field": "CREATED_AT",
      "direction": "DESC"
    }
  }
}

웹툰 조회

특정 웹툰을 조회합니다.

Operation

query Webtoon($input: WebtoonInput!) {
  webtoon(input: $input) {
    id
    title
    keyName
    imageURL
    category {
      id
      name
    }
    stories {
      id
      title
      imageURL
    }
  }
}

Variables

{
  "input": {
    "webtoonId": "웹툰 ID"
  }
}

스토리 조회

조건에 기반한 친구 스토리, 내가 작업한 컷툰, 내가 좋아한 스토리 등을 검색합니다.

Operation

query WebtoonStoryConnection($input: WebtoonStoryConnectionInput!) {
  webtoonStoryConnection(input: $input) {
    nodes {
      id
      title
      imageURL
      createdAt
    }
    totalCount
    pageInfo {
      hasNextPage
      endCursor
    }
  }
}

Variables

{
  "input": {
    "first": 10,
    "after": "커서",
    "where": {
      "title": "스토리 제목",
      "filter": "MY_PUBLIC_STORY"
    },
    "orderby": {
      "field": "CREATED_AT",
      "direction": "DESC"
    }
  }
}

유저 스토리 조회

특정 조건에 맞는 유저 스토리를 조회합니다.

Operation

query WebtoonUserStoryConnection($input: WebtoonUserStoryConnectionInput!) {
  webtoonUserStoryConnection(input: $input) {
    nodes {
      id
      title
      imageURL
      user {
        id
        name
      }
      createdAt
    }
    totalCount
    pageInfo {
      hasNextPage
      endCursor
    }
  }
}

Variables

{
  "input": {
    "first": 10,
    "after": "커서",
    "where": {
      "title": "유저 스토리 제목",
      "filter": "FRIEND_STORY"
    },
    "orderby": {
      "field": "CREATED_AT",
      "direction": "DESC"
    }
  }
}

리뷰 조회

웹툰이나 비디오에 달린 리뷰를 조회합니다.

Operation

query WebtoonReviewConnection($input: WebtoonReviewConnectionInput!) {
  webtoonReviewConnection(input: $input) {
    nodes {
      id
      content
      user {
        id
        name
      }
      createdAt
    }
    totalCount
    pageInfo {
      hasNextPage
      endCursor
    }
  }
}

Variables

{
  "input": {
    "first": 10,
    "after": "커서",
    "where": {
      "userNo": 123,
      "target": "WEBTOON_STORY",
      "targetId": "대상 ID"
    },
    "orderby": {
      "field": "CREATED_AT",
      "direction": "DESC"
    }
  }
}

에셋 그룹 상세 조회

기본 에셋 그룹을 확인한 후, 추가된 에셋이 있는지 확인합니다.

Operation

query WebtoonAssetGroup($input: WebtoonAssetGroupInput!) {
  webtoonAssetGroup(input: $input) {
    webtoonId
    backgrounds {
      id
      title
      imageURL
    }
    items {
      id
      title
      imageURL
    }
  }
}

Variables

{
  "input": {
    "webtoonId": "웹툰 ID",
    "categoryIds": ["카테고리 ID"]
  }
}

에셋 목록 조회

기본 에셋 그룹을 확인한 후, 추가된 에셋이 있는지 여부를 검사합니다.

Operation

query WebtoonAssetConnection($input: WebtoonAssetConnectionInput!) {
  webtoonAssetConnection(input: $input) {
    nodes {
      id
      title
      imageURL
      groupType
    }
    totalCount
    pageInfo {
      hasNextPage
      endCursor
    }
  }
}

Variables

{
  "input": {
    "first": 10,
    "after": "커서",
    "where": {
      "excludeWebtoonIds": ["제외할 웹툰 ID"],
      "groupType": BACKGROUND,
      "categoryIds": ["카테고리 ID"]
    },
    "orderby": {
      "field": CREATED_AT,
      "direction": DESC
    }
  }
}

카테고리 조회

웹툰의 모든 카테고리를 조회합니다.

Operation

query {
  webtoonCategories {
    id
    name
    depth
    parentCategory {
      id
      name
    }
  }
}

Variables