AnswerDownVoteRelation Create

"질문 비추천"

(질문 추천 취소와는 다름)

로그인한 사용자를 user로 가지고, Client에서 보낸 데이터의 pk에 해당하는 질문을 answer로 가지는 AnswerDownVoteRelation(유저-질문 비추천 관계) object을 생성합니다.

URL

/user/answer-downvote-relation/

Method

POST

Header

Key Value
Authorization Token(로그인 성공했을 때 받은 Token key값)

Data Params

Key Description Type Require
answer 비추천할 질문의 pk(primary key) 값 Integer True

Success Response

201 Created

HTTP Status Code

201

Content

{
    # 생성한 AnswerDownVoteRelation object의 pk
    "follow_relation_pk": 3,
    "user": 3,
    "answer": 1
}

Error Response

Bad Request Error

HTTP Status Code

400

Content

# 필수 항목 누락
{
    "answer": [
        "이 필드는 필수 항목입니다."
    ]
}

Bad Request Error

HTTP Status Code

400

Content

# 존재하지 않는 질문을 비추천하려한 경우
{
    "answer": [
        "유효하지 않은 pk \"2\" - 객체가 존재하지 않습니다."
    ]
}

Bad Request Error

HTTP Status Code

400

Content

# 이미 비추천한 답변을 비추천하려 한 경우
{
    "answer": [
        "이미 비추천한 답변입니다."
    ]
}

Unauthorized Error

HTTP Status Code

401

Content

# 유저 Token을 헤더에 담지 않고 요청을 보낸 경우

{
    "detail": "자격 인증데이터(authentication credentials)가 제공되지 않았습니다."
}

Unauthorized Error

HTTP Status Code

401

Content

# 존재하지 않는 유저 Token을 헤더에 담아 요청을 보낸 경우

{
    "detail": "토큰이 유효하지 않습니다."
}

results matching ""

    No results matching ""