Skip to content

후기 등록하기

Hanhee Kang edited this page Mar 15, 2022 · 5 revisions

후기 등록하기

PATH

POST : /api/reviews

Request Header

Content-Type: application/json  
x-auth-token : 로그인  받는 jwt token (Ex:eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VyIjp7ImlkIjoiNjExMGNjMmFjNTBjZmY2YzdjOGIxZTZlIn0sImlhdCI6MTYyODU2NjQxMiwiZXhwIjoxNjI4NjAyNDEyfQ.SWMPObKmGjQcQOUgvHF1HNupO2OovuOHsCXz7O0HZck)

Request Params

params Example Description Default
None None None None

Request Body

Key Example Description Default
title : String(Required) 이동봉사후기 후기의 제목 None
endingCountry : String(Required) 캐나다 이동봉사를 진행했던 나라 None
endingAirport : String(Required) 벤쿠버 국제공항 이동봉사를 진행한 공항 None
hashtags : Array(Required) [이동봉사과정,일반후기] 검색에 사용되는 해시태그 None
isInstitution : String(Required) 개인구조자 단체인지 개인구조자인지. 개인구조자 or 단체 None
institutionName : String(Required) 웰컴독 코리아 이동봉사를 진행한 단체의 이름 None
content : String(Required) https://kkirukday.tistory.com/34 크롤링을 진행하여 내용을 가져올 url None

Response

Example URL : {{baseURL}}/api/reviews

Sucess : 200

{
    "review": {
        "hashtags": [
            "이동봉사과정",
            "일반후기"
        ],
        "_id": "61134e3bda587b36104d4515",
        "user": "6110cc2ac50cff6c7c8b1e6e",
        "title": "이동봉사후기",
        "endingCountry": "캐나다",
        "endingAirport": "밴쿠버 국제공항",
        "isInstitution": "개인구조자",
        "institutionName": "웰컴독 코리아",
        "content": "https://kkirukday.tistory.com/34",
        "crawlingData": [],
        "writeDate": "2021-08-11T04:12:43.092Z"
    },
    "message": "후기 등록 성공"
}

header의 content-type이 multipart/form-data가 아닌 경우 : 400

{
    "error": "request header's content-type is not multipart/form-data"
}

토큰이 없거나 잘못된 경우 : 401

{
    "error": "No token"
}

Request Body에 값이 없는 경우 : 400

{
    "error": "Null value is in request body"
}

Fail to Crawling : 400

{
    "error": "크롤링 실패."
}

Server Error : 500

{
    "error" : "Internal Server Error"
}