Headers

application/json

Body

  • ids_ambassadors array[integer]

    Array of ambassador IDs. Must contain exactly two elements. Note: Either 'ids_ambassadors' or 'id_brand_tag' is required, but not both or none.

  • ID of the brand tag to be associated with the chatroom. Note: Either 'ids_ambassadors' or 'id_brand_tag' is required, but not both or none.

  • source integer Required

    Source of the chatroom.

    Values are 0, 1, or 2.

Responses

POST /chat/chatrooms
curl \
 -X POST https://domain.tld/api/v2/chat/chatrooms \
 -H "Authorization: Bearer $ACCESS_TOKEN" \
 -H "Content-Type: application/json" \
 -H "X-Popsell-Brand: 3" \
 -d '{"ids_ambassadors":[1,2],"id_brand_tag":1,"source":0}'
Request examples
# Headers
X-Popsell-Brand: 3

# Payload
{
  "ids_ambassadors": [
    1,
    2
  ],
  "id_brand_tag": 1,
  "source": 0
}
Response examples (201)
{
  "id_chatroom": 8,
  "ambassadors": [
    {
      "id_ambassador": 42,
      "image": "string",
      "firstname": "string",
      "lastname": "string",
      "username": "string",
      "email": "string",
      "email_tmp": "string",
      "active": 42,
      "status": 42,
      "online": true,
      "last_action_date": "2024-05-04T09:42:00+00:00",
      "customer_id": "string",
      "anonymized": true,
      "chatroom_pivot_data": [
        {
          "id_chatroom": 42,
          "id_ambassador": 42,
          "last_read_message": 42,
          "is_blocked": true,
          "archived": true
        }
      ]
    }
  ],
  "date_insert": "2023-10-06T13:41:09.123000Z",
  "last_message_date": "2023-10-06T13:41:09.123000Z",
  "type_chatroom": 0,
  "type_discussion": 2,
  "source": 2,
  "established_dialogue": "2023-10-06 13:41:09.123",
  "last_rating": {
    "value": 5,
    "comment": "Great ambassador"
  },
  "last_summary": {
    "date_insert": "string",
    "summary": "string",
    "anomaly": 42,
    "topic": 42
  }
}
Response examples (401)
{
  "message": "Unauthorized."
}
Response examples (422)
{
  "message": "field is required! (and 3 more error)",
  "errors": {
    "field": [
      "Error message details here"
    ],
    "additionalProperty1": [
      "Error message details here"
    ],
    "additionalProperty2": [
      "Error message details here"
    ]
  }
}