MakeNewChat

POST /chats

Create a chat with another user. If a chat with that data already exists, returns the data from that chat.

application/json

Body

  • idProduct string Required

Responses

  • 201 application/json

    Created

    Hide response attributes Show response attributes object
    • _id string Required
    • productId string Required

      Product ID

    • sellerId string Required

      User ID

    • buyerId string Required

      User ID

    • deletedBySeller boolean
    • deletedByBuyer boolean
  • 400

    Bad Request

  • 404

    Not Found

  • 500

    Internal Server Error

POST /chats
curl \
 --request POST 'https://garden-to-yours.herokuapp.com/chats' \
 --header "Authorization: Bearer $ACCESS_TOKEN" \
 --header "Content-Type: application/json" \
 --data '{"idProduct":"string"}'
Request examples
{
  "idProduct": "string"
}
Response examples (201)
{
  "_id": "string",
  "productId": "string",
  "sellerId": "string",
  "buyerId": "string",
  "deletedBySeller": true,
  "deletedByBuyer": true
}