ChatConsultar conversas

Consultar conversas

Recuperar conversas

Este endpoint permite que o vendedor (seller) recupere uma coleção de conversas abertas por clientes utilizando filtros como referência.

Escopo requerido

ValorDescrição
conversations-seller:readPermite a leitura de conversas e mensagens.

Parâmetros da URL

CampoTipoDescriçãoObrigatório
_limitInteiroDetermina a quantidade de registros a serem retornados. Valor padrão 10.Não
_offsetInteiroPosição de registro de referência, a partir dele serão retornados os próximos N registros. Valor padrão 0.Não
statusStringStatus da mensagem, pode ser o seguintes valores: WAITING_RESPONSE, REJECTED_RESPONSE, APPROVEDNão
from_user_ref_keyStringIdentificador do cliente que criou a conversa.Não
last_interaction_at_startString (datetime ISO 8601)Filtra interações a partir da data informada (ex.: “2023-06-27T12:15:37.729Z”)Não
last_interaction_at_endString (datetime ISO 8601)Filtra interações até a data informada (ex.: “2023-06-27T12:15:37.729Z”)Não

Chamada:

curl -X 'GET' \
  'https://apps.eupreciso.com.br/v.1.0/chat/conversations?status=WAITING_RESPONSE&_offset=150&_limit=20' \
  -H 'accept: application/json' \
  -H 'Authorization: Bearer <Access Token>' \
  -H 'Content-Type: application/json' \

Resposta:

{
  "meta": {
    "page": {
      "limit": 20,
      "offset": 150,
      "max_limit": 100
    },
    "links": {
      "previous": "?_offset=130&_limit=20",
      "next": "?_offset=170&_limit=20",
      "self": "?_offset=150&_limit=20"
    }
  },
  "results": [
    {
      "id": "6628da4c11696b6967daf96c",
      "display_name": "Conversation Name",
      "from_user": {
        "id": "6628d7a3c01daebde56f5598",
        "full_name": "Daniel B. G.",
        "type": "CUSTOMER"
      },
      "to_user": {
        "id": "6628d7a3c01daebde56f5599",
        "full_name": "Loja A",
        "type": "SELLER"
      },
      "unread_from_count": 6,
      "unread_to_count": 0,
      "last_interaction_at": "2024-11-01T14:09:51.600Z",
      "status": "OPENED",
      "last_message": {
        "id": "6628da6211696b6967daf96f",
        "from_user": {
          "full_name": "Daniel",
          "type": "CUSTOMER"
        },
        "content": "Hello world",
        "when_at": "2024-11-01T13:36:15.935Z"
      },
      "is_new_to": false,
      "tags": [
        {
          "name": "productId",
          "value": "653576e93d455df0c8ff5010"
        },
        {
          "name": "productTitle",
          "value": "Guarda Roupa Casal Grande 6 Portas 4 Gavetas Branco Top"
        },
        {
          "name": "productImage",
          "value": "https://www.eupreciso.com.br/images/653576e93d455df0c8ff5010.jpg"
        },
        {
          "name": "productUrl",
          "value": "https://www.eupreciso.com.br/santa-catarina/norte-de-santa-catarina/para-sua-casa/guarda-roupa-casal-grande-6-portas-4-gavetas-branco-top-653576e93d455df0c8ff5010"
        }
      ],
      "created_at": "2024-10-24T11:48:02.312Z",
      "updated_at": "2024-11-01T12:27:10.353Z"
    }
  ]
}

Recuperar conversa pelo ID

Este endpoint permite que o vendedor (seller) recupere uma conversa pelo ID

Escopo requerido

ValorDescrição
conversations-seller:readPermite a leitura de conversas e mensagens.

Parâmetros da URL

CampoTipoDescriçãoObrigatório
conversation_idStringIdentificador da conversaSim

Chamada:

curl -X 'GET' \
  'https://apps.eupreciso.com.br/v.1.0/chat/conversations/{conversation_id}' \
  -H 'accept: application/json' \
  -H 'Authorization: Bearer <access_token>' \
  -H 'Content-Type: application/json' \

Resposta:

{
  "id": "6628da4c11696b6967daf96c",
  "display_name": "Conversation Name",
  "from_user": {
    "id": "6628d7a3c01daebde56f5598",
    "full_name": "Daniel B. G.",
    "type": "CUSTOMER"
  },
  "to_user": {
    "id": "6628d7a3c01daebde56f5599",
    "full_name": "Loja A",
    "type": "SELLER"
  },
  "unread_from_count": 6,
  "unread_to_count": 0,
  "last_interaction_at": "2024-11-01T14:09:51.600Z",
  "status": "OPENED",
  "last_message": {
    "id": "6628da6211696b6967daf96f",
    "from_user": {
      "full_name": "Daniel",
      "type": "CUSTOMER"
    },
    "content": "Hello world",
    "when_at": "2024-11-01T13:36:15.935Z"
  },
  "is_new_to": false,
  "tags": [
    {
      "name": "productId",
      "value": "653576e93d455df0c8ff5010"
    },
    {
      "name": "productTitle",
      "value": "Guarda Roupa Casal Grande 6 Portas 4 Gavetas Branco Top"
    },
    {
      "name": "productImage",
      "value": "https://www.eupreciso.com.br/images/653576e93d455df0c8ff5010.jpg"
    },
    {
      "name": "productUrl",
      "value": "https://www.eupreciso.com.br/santa-catarina/norte-de-santa-catarina/para-sua-casa/guarda-roupa-casal-grande-6-portas-4-gavetas-branco-top-653576e93d455df0c8ff5010"
    }
  ],
  "created_at": "2024-10-24T11:48:02.312Z",
  "updated_at": "2024-11-01T12:27:10.353Z"
}