Skip to content

문장 올리기

Haely edited this page Nov 9, 2020 · 8 revisions

문장 올리기 (/post/sentence)

문장등록

Request

URL

[POST] ~/post/sentence

Header

메소드 파라미터 설명
Content-Type application/json
token {token} 토큰

Body

변수 타입 설명
sentence String 작성할 문장
title String 작성할 문장이 속한 책 제목
author String 작성할 문장이 속한 책의 저자
publisher String 작성할 문장이 속한 책 출판사
thumbnail String 작성할 문장이 속한 책 사진
themeIdx Int 선택한 테마의 idx(0 : 테마 없는 테마, 그외 : 해당 테마)
{
    "sentence" : "테마 없는 문장",
    "title" : "책책책",
    "author" : "작가작가",
    "publisher" : "출판사출판사",
    "thumbnail" : "https://search1.kakaocdn.net/thumb/R120x174.q85/?fname=http%3A%2F%2Ft1.daumcdn.net%2Flbook%2Fimage%2F692555%3Ftimestamp%3D20200716134618",
    "themeIdx" : 0
}

Response

data : 올린 문장의 sentenceIdx

SUCCESS

{
    "status": 200,
    "success": true,
    "message": "문장 올리기 성공",
    "data": 25
}

FAIL : body 값이 없는 경우

{
    "status": 400,
    "success": false,
    "message": "필요한 값이 없습니다"
}

FAIL : 토큰이 존재하지 않는 경우

{
    "status": 400,
    "success": false,
    "message": "토큰이 없습니다"
}

FAIL : 토큰의 형식이 잘못된 경우

{
    "status": 401,
    "success": false,
    "message": "유효하지 않은 토큰입니다"
}

FAIL : 토큰이 만료되었을 경우

{
    "status": 401,
    "success": false,
    "message": "만료된 토큰입니다"
}

FAIL : 서버 내부 에러의 경우

{
    "status": 600,
    "success": false,
    "message": "서버 내부 오류"
}
Clone this wiki locally