API Polichat

General notes

Desenvolvedor, seja bem-vindo.

Tentamos facilitar ao máximo o uso desta API documentando as principais observações necessárias para o desenvolvedor.

Qualquer dúvida sobre o funcionamento desta API ou de como utilizá-la, entre em contato conosco!

Autenticação utilizando OAuth2

Nós valorizamos a segurança dos seus dados. Por isso, utilizamos o protocolo OAuth 2.0 para o acesso à API.

Você pode obter as credenciais de acesso em: https://app.polichat.com.br/integrations

Ao realizar o seu login na plataforma, você pode gerar as suas credenciais.

As suas credenciais de acesso se resumem em um “Client ID” e um “Secret”, que devem ser guardados e que serão utilizados para obter o Token propriamente dito, responsável por identificar uma requisição feita na API.

Mais informações sobre o acesso estão na seção de Auth.

Parâmetros de Seleção, Ordenação e Filtro

Todas as URLs do tipo GET que pertencem a esta API contam com até 3 parâmetros possíveis de serem inseridos junto à URL: parâmetro de Seleção, de Ordenação e de Filtragem específica.

Filtrar por campos

Podemos filtrar apenas campos específicos. Isso pode ser realizado utilizando o parâmetro filters.

Ex: Buscar apenas os campos id, customer_id e category_id na busca de chats abertos por usuário. Para isso, nossa URL deve ser criada da seguinte forma:

https://api.polichat.com.br/v1/customers/{id}/chats?filters=id,customer_id,category_id

Ordenação

A ordenação de uma busca é realizada através do parâmetro sort.

Ex: Buscar todos os chats com ordem crescente de id:

https://api.polichat.com.br/v1/customers/{id}/chats?sort=id

Ex2: Buscar todos os chats com ordem decrescente de id:

https://api.polichat.com.br/v1/customers/{id}/chats?sort=-id

Atente-se para o sinal (-) na ordenação decrescente.

Também é possível ordenar por dois ou mais parâmetros simultaneamente. Ex3: Buscar todos os chats com ordem crescente de id e, dentro desta ordem, buscar em ordem decrescente de customer_id

https://api.polichat.com.br/v1/customers/{id}/chats?sort=id,-user_id

Filtragem Específica

Esta API permite que você faça um filtro de um valor específico para um campo, retornando apenas os dados que possuem este filtro.

Ex: Buscar, entre todos os chats, apenas aqueles cujo nome do contato contenha ‘teste’.

https://api.polichat.com.br/v1/customers/{id}/?name=teste

É possível filtrar por dois ou mais campos simultaneamente, utilizando a seguinte sintaxe:

https://api.polichat.com.br/v1/customers/{id}/?name=teste&phone=981000000

Concatenar dois ou mais parâmetros

É possível utilizar seleção e ordenação ao mesmo tempo.

Ex: Buscar apenas os campos id, customer_id e category_id de todos os chats, ordenando por id decrescente.

https://api.polichat.com.br/v1/customers/{id}/chats?fields=id,customer_id,category_id&sort=-id

Também é possível utilizar filtragem específica e ordenação ao mesmo tempo.

Ex: Buscar, entre todos os chats, aqueles cujo nome do contato seja igual a ‘teste’, ordenados por id decrescente.

https://api.polichat.com.br/v1/customers/{id}/?name=teste&orderBy=-id

Possíveis Erros

Erros em parâmetros

Caso algum parâmetro passado não seja um campo correspondente ao(s) campo(s) da(s) tabela(s) relacionada(s), será retornado um erro 500.

Ex:

https://api.polichat.com.br/v1/customers/{id}/chats?filters=id,customer_id,category_id,teste

Possíveis erros retornados:

{
    "message": "Server Error"
}

O erro abaixo demonstra uma consulta com um ID que não consta no banco de dados.

{
    "message": "No query results for model [App\\Nome Da Model]."
}

API detail

Auth

getToken

Retorna o Bearer para acessar a API.

curl -X POST -H "Content-Type: application/x-www-form-urlencoded" -H "Content-Type: application/x-www-form-urlencoded" -H "Accept: application/json" -d "grant_type=password&client_id={{client_id}}&client_secret={{client_secret}}&username={{username}}&password={{password}}&scope=" "{{URL}}/oauth/token"
POST %7B%7BURL%7D%7D/oauth/token HTTP/1.1
Host: 
Content-Type: application/x-www-form-urlencoded
Accept: application/json
Content-Type: application/x-www-form-urlencoded

grant_type=password&client_id={{client_id}}&client_secret={{client_secret}}&username={{username}}&password={{password}}&scope=
Status200
Cache-Controlno-store, private
Connectionclose
DateMon, 17 Sep 2018 15:03:47 +0000
DateMon, 17 Sep 2018 15:03:47 GMT
Hostlocalhost:8000
X-Powered-ByPHP/7.2.8
X-RateLimit-Limit60
X-RateLimit-Remaining59
content-typeapplication/json; charset=UTF-8
pragmano-cache
{
    "token_type": "Bearer",
    "expires_in": 31536000,
    "access_token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImp0aSI6IjIzMjA4Y2FjOWQ2MTMzYTIwZWQwNDE2NjI5ZDJhNzU5ZTg2YjljMmNiNWZmNDQwNTY0ZGY3YjI1ZGVhYjg1MDYyMzFjN2FlYTQ5MjExN2RiIn0.eyJhdWQiOiIxMiIsImp0aSI6IjIzMjA4Y2FjOWQ2MTMzYTIwZWQwNDE2NjI5ZDJhNzU5ZTg2YjljMmNiNWZmNDQwNTY0ZGY3YjI1ZGVhYjg1MDYyMzFjN2FlYTQ5MjExN2RiIiwiaWF0IjoxNTM3MTk2NjI2LCJuYmYiOjE1MzcxOTY2MjYsImV4cCI6MTU2ODczMjYyNiwic3ViIjoiMjgxIiwic2NvcGVzIjpbXX0.aqwgAgXK_lXEVZIjvygn9suneSGLLtrv1yWgLkWQeVIpUpPuup8jUHitkatYA1WaHiC2GTCB7GcZSJyp0Oq33N9M1D5m21K-vFfEGQYCCMFpXoZLkvkgFLeffO9gKoYXOuehArO5h4HaHeDVywX6q5kULFM_aT6O_6XIdK_jx17vHbOQlVuQQDobGujRgFOcxCOf57JranHeX55PyNWo2VN37WUaW2gKjK0KOx_SXqMI_Ty-J2sSem2qSRExaM7skNh56Er1-euSwvwEFoUo8zdcmwciVRmfugScKXKg0bKi7gGs58X_1cAaKIMxPSBKOw4B-jLOj02toig7TEFGdk8iq2BlXErQN67ITWI7KASKPV-1f-m54AP92aI7VYNcwDxXbwRn8VTP81whM2Uh4aCyzoQZfnCLPFk3tdhXTDtz_jwl8t1LS5V2UMcCAmQBweq91S22VwxjUXxGDxH9E9sKTM90tYVmM4b18V-iCwWb8G7tdybtkynMuhdpBrvCWUPCdArmuGuh9ikjaqpvZEjUv-q-NiQXCNytidLylmNj-JKU6XBID_aLI7jYsCeeps7Y2Q_V9VcjbIACteTnNv80lHYcAjAJgE4_LW5I5ColRP1j092tMwk74Og4tvnKoId8YeOM3i36WMSWhO0bzFJjuNFDIroXtjuNAsbWkzY",
    "refresh_token": "def502000ba4e90d3cd37175fc18a4030aa24096dde8a8f398e8397f6e92a2ecd476da85274a3430da168144445a93a9080d6ccc5cdfa99fa20fb6aa32403faa4e8ee6c5fe3e84ca19a2cce554ea3a71d5ac1b35e36b67ff5b9faa40213caa4a5052f3abda3693c565501af7e56f7bd1b6319e59985cfe9f4e80bd776ae556a8522c40fdc3ee87852a149094d40f7e26c0c7d25465bddde61298c946007c20dbd0a03785962396743ec264a74941ee726725264be5877b4c3c4d5c6ed2c6e64f9d58390fc4555eedcfaea6076cc79a6aa6f94a23779a5d725d827843365145d49be07c76675c305a8b27939e322d0261cf46d434d2b3c2f9b75ae35ef4391a18519ccca198cf9704b4af1d91c8c2f2b01f21165dd44e2f8b4c97c5e33a672bce401f20636c03b088c68f9eb7259d0ddc350350a30ffbd0c02998c6f7ecba6c5677e85d6e55dd56fa9a2b255538116e8be9347329fba86f919f24196fcd273b988892d3d1"
}

authorize

curl -X GET "{{URL}}/oauth/authorize?client_id={{client_id}}&response_type=token&scope=&redirect_uri={{url}}"
GET %7B%7BURL%7D%7D/oauth/authorize?client_id={{client_id}}&response_type=token&scope=&redirect_uri={{url}} HTTP/1.1
Host: 

Channels

Dados dos canais da empresa.

showAllChannels

Retorna a lista de canais desta empresa, com seus respectivos status.

curl -X GET -H "Content-Type: application/x-www-form-urlencoded" -H "Accept: application/json" -H "Authorization: Bearer {{bearer}}" "{{URL}}/api/v1/customers/{{customer}}/channels"
GET %7B%7BURL%7D%7D/api/v1/customers/%7B%7Bcustomer%7D%7D/channels HTTP/1.1
Host: 
Content-Type: application/x-www-form-urlencoded
Accept: application/json
Authorization: Bearer {{bearer}}
Status200
Cache-Controlno-cache, private
Connectionclose
Content-Typeapplication/json
DateThu, 20 Sep 2018 17:02:46 +0000
DateThu, 20 Sep 2018 17:02:46 GMT
Hostlocalhost:8000
X-Powered-ByPHP/7.2.8
{
    "current_page": 1,
    "data": [
        {
            "id": 177,
            "channel_id": 1,
            "customer_id": 163,
            "phone": "556281347866",
            "url": null,
            "name": null,
            "type": "whatsapp",
            "status": null,
            "history": null,
            "created_at": "2018-08-21 17:11:06",
            "updated_at": "2018-08-23 17:45:19"
        },
        {
            "id": 179,
            "channel_id": 1,
            "customer_id": 163,
            "phone": "556281000000",
            "url": null,
            "name": "teste",
            "type": "whatsapp",
            "status": {
                "id": 20736,
                "customer_id": 163,
                "channel_id": 179,
                "qr_code": null,
                "type": 0,
                "status": null,
                "uid": "556281000000@c.us",
                "history": 20,
                "created_at": "2018-08-27 14:08:11",
                "updated_at": "2018-08-27 14:08:11"
            },
            "history": 20,
            "created_at": "2018-08-27 14:08:11",
            "updated_at": "2018-08-27 14:08:11"
        },
        {
            "id": 180,
            "channel_id": 1,
            "customer_id": 163,
            "phone": "556481300000",
            "url": null,
            "name": "canal teste",
            "type": "whatsapp",
            "status": {
                "id": 20737,
                "customer_id": 163,
                "channel_id": 180,
                "qr_code": null,
                "type": 0,
                "status": null,
                "uid": "556481300000@c.us",
                "history": 20,
                "created_at": "2018-08-28 20:27:21",
                "updated_at": "2018-08-28 20:27:21"
            },
            "history": 20,
            "created_at": "2018-08-28 20:27:20",
            "updated_at": "2018-08-28 20:27:20"
        },
        {
            "id": 181,
            "channel_id": 1,
            "customer_id": 163,
            "phone": "555528103322",
            "url": null,
            "name": "canal teste 2",
            "type": "whatsapp",
            "status": {
                "id": 20738,
                "customer_id": 163,
                "channel_id": 181,
                "qr_code": null,
                "type": 0,
                "status": null,
                "uid": "556281002222@c.us",
                "history": 20,
                "created_at": "2018-08-28 20:35:00",
                "updated_at": "2018-08-28 20:35:00"
            },
            "history": null,
            "created_at": "2018-08-28 20:35:00",
            "updated_at": "2018-08-28 20:35:10"
        },
        {
            "id": 182,
            "channel_id": 1,
            "customer_id": 163,
            "phone": "556281000000",
            "url": null,
            "name": "teste",
            "type": "whatsapp",
            "status": {
                "id": 20739,
                "customer_id": 163,
                "channel_id": 182,
                "qr_code": null,
                "type": 0,
                "status": null,
                "uid": "556281000000@c.us",
                "history": 20,
                "created_at": "2018-08-28 20:35:34",
                "updated_at": "2018-08-28 20:35:34"
            },
            "history": null,
            "created_at": "2018-08-28 20:35:34",
            "updated_at": "2018-08-28 20:35:38"
        },
        {
            "id": 183,
            "channel_id": 1,
            "customer_id": 163,
            "phone": "551212121212",
            "url": null,
            "name": null,
            "type": "whatsapp",
            "status": null,
            "history": 20,
            "created_at": "2018-09-14 12:54:13",
            "updated_at": "2018-09-14 12:54:13"
        },
        {
            "id": 184,
            "channel_id": 1,
            "customer_id": 163,
            "phone": "556281000009",
            "url": null,
            "name": "Nome Fantasia",
            "type": "whatsapp",
            "status": {
                "id": 20740,
                "customer_id": 163,
                "channel_id": 184,
                "qr_code": null,
                "type": 0,
                "status": null,
                "uid": "556281000009@c.us",
                "history": 1,
                "created_at": "2018-09-17 13:31:56",
                "updated_at": "2018-09-17 13:31:56"
            },
            "history": 1,
            "created_at": "2018-09-17 13:31:56",
            "updated_at": "2018-09-17 13:31:56"
        },
        {
            "id": 185,
            "channel_id": 1,
            "customer_id": 163,
            "phone": "556280000000",
            "url": null,
            "name": "Nome Fantasia",
            "type": "whatsapp",
            "status": {
                "id": 20741,
                "customer_id": 163,
                "channel_id": 185,
                "qr_code": null,
                "type": 0,
                "status": null,
                "uid": "556280000000@c.us",
                "history": null,
                "created_at": "2018-09-17 13:41:50",
                "updated_at": "2018-09-17 13:41:50"
            },
            "history": null,
            "created_at": "2018-09-17 13:41:50",
            "updated_at": "2018-09-17 13:41:50"
        },
        {
            "id": 186,
            "channel_id": 1,
            "customer_id": 163,
            "phone": "556280000000",
            "url": null,
            "name": "Nome Fantasia",
            "type": "whatsapp",
            "status": {
                "id": 20742,
                "customer_id": 163,
                "channel_id": 186,
                "qr_code": null,
                "type": 0,
                "status": null,
                "uid": "556280000000@c.us",
                "history": null,
                "created_at": "2018-09-17 13:42:20",
                "updated_at": "2018-09-17 13:42:20"
            },
            "history": null,
            "created_at": "2018-09-17 13:42:20",
            "updated_at": "2018-09-17 13:42:20"
        },
        {
            "id": 187,
            "channel_id": 1,
            "customer_id": 163,
            "phone": "556280000000",
            "url": null,
            "name": "Nome Fantasia",
            "type": "whatsapp",
            "status": {
                "id": 20743,
                "customer_id": 163,
                "channel_id": 187,
                "qr_code": null,
                "type": 0,
                "status": null,
                "uid": "556280000000@c.us",
                "history": null,
                "created_at": "2018-09-17 13:42:44",
                "updated_at": "2018-09-17 13:42:44"
            },
            "history": null,
            "created_at": "2018-09-17 13:42:44",
            "updated_at": "2018-09-17 13:42:44"
        },
        {
            "id": 188,
            "channel_id": 1,
            "customer_id": 163,
            "phone": "556280000000",
            "url": null,
            "name": "Nome Fantasia",
            "type": "whatsapp",
            "status": {
                "id": 20744,
                "customer_id": 163,
                "channel_id": 188,
                "qr_code": null,
                "type": 0,
                "status": null,
                "uid": "556280000000@c.us",
                "history": null,
                "created_at": "2018-09-17 13:43:13",
                "updated_at": "2018-09-17 13:43:13"
            },
            "history": null,
            "created_at": "2018-09-17 13:43:13",
            "updated_at": "2018-09-17 13:43:13"
        },
        {
            "id": 189,
            "channel_id": 1,
            "customer_id": 163,
            "phone": "556280000000",
            "url": null,
            "name": "Nome Fantasia",
            "type": "whatsapp",
            "status": {
                "id": 20745,
                "customer_id": 163,
                "channel_id": 189,
                "qr_code": null,
                "type": 0,
                "status": null,
                "uid": "556280000000@c.us",
                "history": null,
                "created_at": "2018-09-17 13:43:30",
                "updated_at": "2018-09-17 13:43:30"
            },
            "history": null,
            "created_at": "2018-09-17 13:43:30",
            "updated_at": "2018-09-17 13:43:30"
        },
        {
            "id": 190,
            "channel_id": 1,
            "customer_id": 163,
            "phone": "556280000000",
            "url": null,
            "name": "Nome Fantasia",
            "type": "whatsapp",
            "status": {
                "id": 20746,
                "customer_id": 163,
                "channel_id": 190,
                "qr_code": null,
                "type": 0,
                "status": null,
                "uid": "556280000000@c.us",
                "history": null,
                "created_at": "2018-09-17 13:45:36",
                "updated_at": "2018-09-17 13:45:36"
            },
            "history": null,
            "created_at": "2018-09-17 13:45:36",
            "updated_at": "2018-09-17 13:45:36"
        },
        {
            "id": 191,
            "channel_id": 1,
            "customer_id": 163,
            "phone": "556280000000",
            "url": "http:\/\/www.facebook.com",
            "name": "Nome Fantasia",
            "type": "whatsapp",
            "status": {
                "id": 20747,
                "customer_id": 163,
                "channel_id": 191,
                "qr_code": null,
                "type": 0,
                "status": null,
                "uid": "556280000000@c.us",
                "history": null,
                "created_at": "2018-09-17 13:47:27",
                "updated_at": "2018-09-17 13:47:27"
            },
            "history": null,
            "created_at": "2018-09-17 13:47:27",
            "updated_at": "2018-09-18 17:04:20"
        },
        {
            "id": 192,
            "channel_id": 1,
            "customer_id": 163,
            "phone": "556280000000",
            "url": null,
            "name": "Nome Fantasia",
            "type": "whatsapp",
            "status": {
                "id": 20748,
                "customer_id": 163,
                "channel_id": 192,
                "qr_code": null,
                "type": 0,
                "status": null,
                "uid": "556280000000@c.us",
                "history": null,
                "created_at": "2018-09-17 13:48:19",
                "updated_at": "2018-09-17 13:48:19"
            },
            "history": null,
            "created_at": "2018-09-17 13:48:19",
            "updated_at": "2018-09-17 13:48:19"
        },
        {
            "id": 193,
            "channel_id": 1,
            "customer_id": 163,
            "phone": "556280000000",
            "url": "http:\/\/www.google.com",
            "name": "Nome Fantasia",
            "type": "whatsapp",
            "status": {
                "id": 20749,
                "customer_id": 163,
                "channel_id": 193,
                "qr_code": null,
                "type": 0,
                "status": null,
                "uid": "556280000000@c.us",
                "history": null,
                "created_at": "2018-09-17 13:49:24",
                "updated_at": "2018-09-17 13:49:24"
            },
            "history": null,
            "created_at": "2018-09-17 13:49:24",
            "updated_at": "2018-09-17 14:03:40"
        },
        {
            "id": 194,
            "channel_id": 1,
            "customer_id": 163,
            "phone": "556280000000",
            "url": null,
            "name": "Nome Fantasia",
            "type": "whatsapp",
            "status": {
                "id": 20750,
                "customer_id": 163,
                "channel_id": 194,
                "qr_code": null,
                "type": 0,
                "status": null,
                "uid": "556280000000@c.us",
                "history": null,
                "created_at": "2018-09-17 13:49:38",
                "updated_at": "2018-09-17 13:49:38"
            },
            "history": null,
            "created_at": "2018-09-17 13:49:38",
            "updated_at": "2018-09-17 13:49:38"
        },
        {
            "id": 195,
            "channel_id": 1,
            "customer_id": 163,
            "phone": "556280000000",
            "url": null,
            "name": "Nome Fantasia",
            "type": "whatsapp",
            "status": {
                "id": 20751,
                "customer_id": 163,
                "channel_id": 195,
                "qr_code": null,
                "type": 0,
                "status": null,
                "uid": "556280000000@c.us",
                "history": null,
                "created_at": "2018-09-17 13:50:09",
                "updated_at": "2018-09-17 13:50:09"
            },
            "history": null,
            "created_at": "2018-09-17 13:50:09",
            "updated_at": "2018-09-17 13:50:09"
        },
        {
            "id": 196,
            "channel_id": 1,
            "customer_id": 163,
            "phone": "556280000000",
            "url": null,
            "name": "Nome Fantasia",
            "type": "whatsapp",
            "status": {
                "id": 20752,
                "customer_id": 163,
                "channel_id": 196,
                "qr_code": null,
                "type": 0,
                "status": null,
                "uid": "556280000000@c.us",
                "history": null,
                "created_at": "2018-09-17 13:52:55",
                "updated_at": "2018-09-17 13:52:55"
            },
            "history": 20,
            "created_at": "2018-09-17 13:52:55",
            "updated_at": "2018-09-17 13:52:55"
        },
        {
            "id": 197,
            "channel_id": 1,
            "customer_id": 163,
            "phone": "556280000000",
            "url": "http:\/\/www.google.com",
            "name": "Nome Fantasia",
            "type": "whatsapp",
            "status": {
                "id": 20753,
                "customer_id": 163,
                "channel_id": 197,
                "qr_code": null,
                "type": 0,
                "status": null,
                "uid": "556280000000@c.us",
                "history": null,
                "created_at": "2018-09-17 14:03:13",
                "updated_at": "2018-09-17 14:03:13"
            },
            "history": 20,
            "created_at": "2018-09-17 14:03:13",
            "updated_at": "2018-09-17 14:03:13"
        }
    ],
    "first_page_url": "http:\/\/localhost:8000\/api\/v1\/customers\/163\/channels?page=1",
    "from": 1,
    "last_page": 2,
    "last_page_url": "http:\/\/localhost:8000\/api\/v1\/customers\/163\/channels?page=2",
    "next_page_url": "http:\/\/localhost:8000\/api\/v1\/customers\/163\/channels?page=2",
    "path": "http:\/\/localhost:8000\/api\/v1\/customers\/163\/channels",
    "per_page": 20,
    "prev_page_url": null,
    "to": 20,
    "total": 22
}

newChannel

Cria um novo canal.

curl -X POST -H "Content-Type: application/x-www-form-urlencoded" -H "Content-Type: application/x-www-form-urlencoded" -H "Accept: application/json" -H "Authorization: Bearer {{bearer}}" -d "channel={{channel}}&name={{name}}&history={{history}}&phone={{phone}}" "{{URL}}/api/v1/customers/{{customer}}/channels"
POST %7B%7BURL%7D%7D/api/v1/customers/%7B%7Bcustomer%7D%7D/channels HTTP/1.1
Host: 
Content-Type: application/x-www-form-urlencoded
Accept: application/json
Authorization: Bearer {{bearer}}
Content-Type: application/x-www-form-urlencoded

channel={{channel}}&name={{name}}&history={{history}}&phone={{phone}}
Status200
Cache-Controlno-cache, private
Connectionclose
Content-Typeapplication/json
DateMon, 17 Sep 2018 16:40:53 +0000
DateMon, 17 Sep 2018 16:40:53 GMT
Hostlocalhost:8000
X-Powered-ByPHP/7.2.8
{
    "channel_id": 1,
    "name": "Nome Fantasia",
    "customer_id": 163,
    "status": true,
    "type": 0,
    "phone": "556280000000",
    "url": null,
    "updated_at": "2018-09-17 16:40:53",
    "created_at": "2018-09-17 16:40:53",
    "id": 200
}

updateChannel

Edita um canal.

curl -X PUT -H "Content-Type: application/x-www-form-urlencoded" -H "Content-Type: application/x-www-form-urlencoded" -H "Accept: application/json" -H "Authorization: Bearer {{bearer}}" -d "channel={{channel}}&name={{name}}&url={{url}}&phone={{phone}}" "{{URL}}/api/v1/customers/{{customer}}/channels/{{channel}}"
PUT %7B%7BURL%7D%7D/api/v1/customers/%7B%7Bcustomer%7D%7D/channels/%7B%7Bchannel%7D%7D HTTP/1.1
Host: 
Content-Type: application/x-www-form-urlencoded
Accept: application/json
Authorization: Bearer {{bearer}}
Content-Type: application/x-www-form-urlencoded

channel={{channel}}&name={{name}}&url={{url}}&phone={{phone}}
Status200
Cache-Controlno-cache, private
Connectionclose
Content-Typeapplication/json
DateMon, 17 Sep 2018 16:40:38 +0000
DateMon, 17 Sep 2018 16:40:38 GMT
Hostlocalhost:8000
X-Powered-ByPHP/7.2.8
{
    "id": 191,
    "channel_id": 1,
    "customer_id": 163,
    "phone": "556280000000",
    "url": "http:\/\/www.google.com",
    "name": "Nome Fantasia",
    "type": 0,
    "status": true,
    "history": null,
    "created_at": "2018-09-17 13:47:27",
    "updated_at": "2018-09-17 16:40:38"
}

deleteChannel

Remove um canal.

curl -X DELETE -H "Content-Type: application/x-www-form-urlencoded" -H "Content-Type: application/x-www-form-urlencoded" -H "Accept: application/json" -H "Authorization: Bearer {{bearer}}" "{{URL}}/api/v1/customers/{{customer}}/channels/{{channel}}"
DELETE %7B%7BURL%7D%7D/api/v1/customers/%7B%7Bcustomer%7D%7D/channels/%7B%7Bchannel%7D%7D HTTP/1.1
Host: 
Content-Type: application/x-www-form-urlencoded
Accept: application/json
Authorization: Bearer {{bearer}}
Status200
Cache-Controlno-cache, private
Connectionclose
Content-Typeapplication/json
DateMon, 17 Sep 2018 16:40:00 +0000
DateMon, 17 Sep 2018 16:40:00 GMT
Hostlocalhost:8000
X-Powered-ByPHP/7.2.8
"Exclu\u00eddo com sucesso!"

Chats

newChat

Inicia um novo chat de um usuário (user) para um contato (contact).

curl -X POST -H "Content-Type: multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW" -H "Content-Type: application/x-www-form-urlencoded" -H "Accept: application/json" -H "Authorization: Bearer {{bearer}}" "{{URL}}/api/v1/customers/{{customer}}/chats/users/{{user}}/contacts/{{contact}}"
POST %7B%7BURL%7D%7D/api/v1/customers/%7B%7Bcustomer%7D%7D/chats/users/%7B%7Buser%7D%7D/contacts/%7B%7Bcontact%7D%7D HTTP/1.1
Host: 
Content-Type: application/x-www-form-urlencoded
Accept: application/json
Authorization: Bearer {{bearer}}
Status200
Cache-Controlno-cache, private
Connectionclose
Content-Typeapplication/json
DateMon, 17 Sep 2018 11:51:44 +0000
DateMon, 17 Sep 2018 11:51:44 GMT
Hostlocalhost:8000
X-Powered-ByPHP/7.2.8
{
    "id": 1,
    "customer_id": 163,
    "category_id": 1,
    "subcat": null,
    "name": "Nome Fantasia",
    "picture": null,
    "phone": "556281000009",
    "email": "testeapi@teste.com",
    "cpf": "00000000000",
    "address": "Endere\u00e7o xyz",
    "gender": "masculino",
    "type": "user",
    "channel_id": 177,
    "user_id": 1,
    "portfolio_user_id": 281,
    "chat_read": false,
    "status": 1,
    "origin": "i",
    "count_messages": 0,
    "data": null,
    "timestamp": null,
    "created_at": "2018-08-28 18:03:42",
    "updated_at": "2018-09-17 11:51:44"
}

turnRead

Altera o status da conversa com o contato para lida.

curl -X POST -H "Content-Type: application/x-www-form-urlencoded" -H "Content-Type: application/x-www-form-urlencoded" -H "Accept: application/json" -H "Authorization: Bearer {{bearer}}" -d "=" "{{URL}}/api/v1/customers/{{customer}}/chats/contacts/{{contact}}/read"
POST %7B%7BURL%7D%7D/api/v1/customers/%7B%7Bcustomer%7D%7D/chats/contacts/%7B%7Bcontact%7D%7D/read HTTP/1.1
Host: 
Content-Type: application/x-www-form-urlencoded
Accept: application/json
Authorization: Bearer {{bearer}}
Content-Type: application/x-www-form-urlencoded

=
Status200
Cache-Controlno-cache, private
Connectionclose
Content-Typeapplication/json
DateWed, 19 Sep 2018 14:44:09 +0000
DateWed, 19 Sep 2018 14:44:09 GMT
Hostlocalhost:8000
X-Powered-ByPHP/7.2.8
{
    "mensagem": "Este chat n\u00e3o existe ou j\u00e1 est\u00e1 lido."
}

showOpenChats

Retorna todos os chats que estão em aberto e a última mensagem de cada chat.

curl -X GET -H "Content-Type: application/x-www-form-urlencoded" -H "Accept: application/json" -H "Authorization: Bearer {{bearer}}" "{{URL}}/api/v1/customers/{{customer}}/chats"
GET %7B%7BURL%7D%7D/api/v1/customers/%7B%7Bcustomer%7D%7D/chats HTTP/1.1
Host: 
Content-Type: application/x-www-form-urlencoded
Accept: application/json
Authorization: Bearer {{bearer}}
Status200
Cache-Controlno-cache, private
Connectionclose
Content-Typeapplication/json
DateThu, 20 Sep 2018 17:06:29 +0000
DateThu, 20 Sep 2018 17:06:29 GMT
Hostlocalhost:8000
X-Powered-ByPHP/7.2.8
{
    "current_page": 1,
    "data": [
        {
            "id": 24,
            "customer_id": 163,
            "category_id": 1,
            "subcat": null,
            "name": "contact",
            "picture": null,
            "phone": "551198100",
            "email": "",
            "cpf": null,
            "address": null,
            "gender": null,
            "type": "user",
            "channel_id": 177,
            "user_id": 281,
            "portfolio_user_id": 281,
            "chat_read": 1,
            "status": 1,
            "origin": "o",
            "count_messages": 0,
            "data": null,
            "timestamp": null,
            "created_at": "2018-08-31 17:40:12",
            "updated_at": "2018-08-31 17:40:12"
        },
        {
            "id": 25,
            "customer_id": 163,
            "category_id": 1,
            "subcat": null,
            "name": "contact",
            "picture": null,
            "phone": "5511981002",
            "email": "",
            "cpf": null,
            "address": null,
            "gender": null,
            "type": "user",
            "channel_id": 177,
            "user_id": 281,
            "portfolio_user_id": 281,
            "chat_read": 1,
            "status": 1,
            "origin": "o",
            "count_messages": 0,
            "data": null,
            "timestamp": null,
            "created_at": "2018-08-31 17:40:39",
            "updated_at": "2018-08-31 17:48:14"
        },
        {
            "id": 28,
            "customer_id": 163,
            "category_id": 1,
            "subcat": null,
            "name": "contact",
            "picture": null,
            "phone": "55119810022",
            "email": "",
            "cpf": null,
            "address": null,
            "gender": null,
            "type": "user",
            "channel_id": 177,
            "user_id": 281,
            "portfolio_user_id": 281,
            "chat_read": 1,
            "status": 1,
            "origin": "o",
            "count_messages": 0,
            "data": null,
            "timestamp": null,
            "created_at": "2018-08-31 17:47:45",
            "updated_at": "2018-08-31 17:47:45"
        },
        {
            "id": 26,
            "customer_id": 163,
            "category_id": 1,
            "subcat": null,
            "name": "contact",
            "picture": null,
            "phone": "5511981002212",
            "email": "",
            "cpf": null,
            "address": null,
            "gender": null,
            "type": "user",
            "channel_id": 177,
            "user_id": 281,
            "portfolio_user_id": 281,
            "chat_read": 1,
            "status": 1,
            "origin": "o",
            "count_messages": 0,
            "data": null,
            "timestamp": null,
            "created_at": "2018-08-31 17:44:18",
            "updated_at": "2018-08-31 17:47:20"
        },
        {
            "id": 27,
            "customer_id": 163,
            "category_id": 1,
            "subcat": null,
            "name": "contact",
            "picture": null,
            "phone": "55119810022123",
            "email": "",
            "cpf": null,
            "address": null,
            "gender": null,
            "type": "user",
            "channel_id": 177,
            "user_id": 281,
            "portfolio_user_id": 281,
            "chat_read": 1,
            "status": 1,
            "origin": "o",
            "count_messages": 0,
            "data": null,
            "timestamp": null,
            "created_at": "2018-08-31 17:44:30",
            "updated_at": "2018-08-31 17:44:30"
        },
        {
            "id": 31,
            "customer_id": 163,
            "category_id": 1,
            "subcat": null,
            "name": "contact",
            "picture": null,
            "phone": "551198100222",
            "email": "",
            "cpf": null,
            "address": null,
            "gender": null,
            "type": "user",
            "channel_id": 179,
            "user_id": 282,
            "portfolio_user_id": 282,
            "chat_read": 1,
            "status": 1,
            "origin": "o",
            "count_messages": 0,
            "data": null,
            "timestamp": null,
            "created_at": "2018-09-03 12:14:37",
            "updated_at": "2018-09-03 12:14:37"
        },
        {
            "id": 29,
            "customer_id": 163,
            "category_id": 1,
            "subcat": null,
            "name": "contact",
            "picture": null,
            "phone": "5511981002222",
            "email": "",
            "cpf": null,
            "address": null,
            "gender": null,
            "type": "user",
            "channel_id": 177,
            "user_id": 281,
            "portfolio_user_id": 281,
            "chat_read": 1,
            "status": 1,
            "origin": "o",
            "count_messages": 0,
            "data": null,
            "timestamp": null,
            "created_at": "2018-08-31 17:48:25",
            "updated_at": "2018-09-03 12:10:56"
        },
        {
            "id": 30,
            "customer_id": 163,
            "category_id": 1,
            "subcat": null,
            "name": "contact",
            "picture": null,
            "phone": "55119810022226",
            "email": "",
            "cpf": null,
            "address": null,
            "gender": null,
            "type": "user",
            "channel_id": 177,
            "user_id": 282,
            "portfolio_user_id": 282,
            "chat_read": 1,
            "status": 1,
            "origin": "o",
            "count_messages": 0,
            "data": null,
            "timestamp": null,
            "created_at": "2018-08-31 17:49:45",
            "updated_at": "2018-09-03 12:09:38"
        },
        {
            "id": 32,
            "customer_id": 163,
            "category_id": 1,
            "subcat": null,
            "name": "contact",
            "picture": null,
            "phone": "5511981002244",
            "email": "",
            "cpf": null,
            "address": null,
            "gender": null,
            "type": "user",
            "channel_id": 179,
            "user_id": 282,
            "portfolio_user_id": 282,
            "chat_read": 1,
            "status": 1,
            "origin": "o",
            "count_messages": 0,
            "data": null,
            "timestamp": null,
            "created_at": "2018-09-03 12:20:00",
            "updated_at": "2018-09-03 12:20:49"
        },
        {
            "id": 23,
            "customer_id": 163,
            "category_id": 1,
            "subcat": null,
            "name": "contact",
            "picture": null,
            "phone": "5511981003",
            "email": "",
            "cpf": null,
            "address": null,
            "gender": null,
            "type": "user",
            "channel_id": 177,
            "user_id": 281,
            "portfolio_user_id": 281,
            "chat_read": 1,
            "status": 1,
            "origin": "o",
            "count_messages": 0,
            "data": null,
            "timestamp": null,
            "created_at": "2018-08-31 17:39:51",
            "updated_at": "2018-08-31 17:39:51"
        },
        {
            "id": 22,
            "customer_id": 163,
            "category_id": 1,
            "subcat": null,
            "name": "contact",
            "picture": null,
            "phone": "5511981003312",
            "email": "",
            "cpf": null,
            "address": null,
            "gender": null,
            "type": "user",
            "channel_id": 177,
            "user_id": 281,
            "portfolio_user_id": 281,
            "chat_read": 1,
            "status": 1,
            "origin": "i",
            "count_messages": 0,
            "data": null,
            "timestamp": null,
            "created_at": "2018-08-31 16:49:47",
            "updated_at": "2018-08-31 17:31:58"
        },
        {
            "id": 21,
            "customer_id": 163,
            "category_id": 1,
            "subcat": null,
            "name": "contact",
            "picture": null,
            "phone": "551198100333",
            "email": "",
            "cpf": null,
            "address": null,
            "gender": null,
            "type": "user",
            "channel_id": 177,
            "user_id": null,
            "portfolio_user_id": 281,
            "chat_read": 1,
            "status": 1,
            "origin": "i",
            "count_messages": 0,
            "data": null,
            "timestamp": null,
            "created_at": "2018-08-31 16:48:44",
            "updated_at": "2018-08-31 16:48:44"
        },
        {
            "id": 20,
            "customer_id": 163,
            "category_id": 1,
            "subcat": null,
            "name": "contact",
            "picture": null,
            "phone": "55119810033330",
            "email": "",
            "cpf": null,
            "address": null,
            "gender": null,
            "type": "user",
            "channel_id": 177,
            "user_id": null,
            "portfolio_user_id": 281,
            "chat_read": 1,
            "status": 1,
            "origin": "i",
            "count_messages": 0,
            "data": null,
            "timestamp": null,
            "created_at": "2018-08-31 16:36:02",
            "updated_at": "2018-08-31 16:48:11"
        },
        {
            "id": 19,
            "customer_id": 163,
            "category_id": 1,
            "subcat": null,
            "name": "contact",
            "picture": null,
            "phone": "551198100333300",
            "email": "",
            "cpf": null,
            "address": null,
            "gender": null,
            "type": "user",
            "channel_id": 177,
            "user_id": 282,
            "portfolio_user_id": 281,
            "chat_read": 1,
            "status": 1,
            "origin": "i",
            "count_messages": 0,
            "data": null,
            "timestamp": null,
            "created_at": "2018-08-31 16:35:03",
            "updated_at": "2018-08-31 16:45:36"
        },
        {
            "id": 18,
            "customer_id": 163,
            "category_id": 1,
            "subcat": null,
            "name": "contact",
            "picture": null,
            "phone": "55119810033330092",
            "email": "",
            "cpf": null,
            "address": null,
            "gender": null,
            "type": "user",
            "channel_id": 177,
            "user_id": 281,
            "portfolio_user_id": 281,
            "chat_read": 1,
            "status": 1,
            "origin": "i",
            "count_messages": 0,
            "data": null,
            "timestamp": null,
            "created_at": "2018-08-31 16:24:39",
            "updated_at": "2018-08-31 16:34:00"
        },
        {
            "id": 17,
            "customer_id": 163,
            "category_id": 1,
            "subcat": null,
            "name": "contact",
            "picture": null,
            "phone": "55119810033330098",
            "email": "",
            "cpf": null,
            "address": null,
            "gender": null,
            "type": "user",
            "channel_id": 177,
            "user_id": null,
            "portfolio_user_id": 281,
            "chat_read": 1,
            "status": 1,
            "origin": "i",
            "count_messages": 0,
            "data": null,
            "timestamp": null,
            "created_at": "2018-08-31 16:24:12",
            "updated_at": "2018-08-31 16:24:12"
        },
        {
            "id": 16,
            "customer_id": 163,
            "category_id": 1,
            "subcat": null,
            "name": "contact",
            "picture": null,
            "phone": "551198100333300987",
            "email": "",
            "cpf": null,
            "address": null,
            "gender": null,
            "type": "user",
            "channel_id": 177,
            "user_id": null,
            "portfolio_user_id": 281,
            "chat_read": 1,
            "status": 1,
            "origin": "i",
            "count_messages": 0,
            "data": null,
            "timestamp": null,
            "created_at": "2018-08-31 16:15:56",
            "updated_at": "2018-08-31 16:16:09"
        },
        {
            "id": 13,
            "customer_id": 163,
            "category_id": 1,
            "subcat": null,
            "name": "contact",
            "picture": null,
            "phone": "551198100333305634567",
            "email": "",
            "cpf": null,
            "address": null,
            "gender": null,
            "type": "user",
            "channel_id": 177,
            "user_id": 281,
            "portfolio_user_id": 281,
            "chat_read": 1,
            "status": 1,
            "origin": "i",
            "count_messages": 0,
            "data": null,
            "timestamp": null,
            "created_at": "2018-08-31 16:02:02",
            "updated_at": "2018-08-31 16:08:33"
        },
        {
            "id": 14,
            "customer_id": 163,
            "category_id": 1,
            "subcat": null,
            "name": "contact",
            "picture": null,
            "phone": "5511981003333056345670",
            "email": "",
            "cpf": null,
            "address": null,
            "gender": null,
            "type": "user",
            "channel_id": 177,
            "user_id": 281,
            "portfolio_user_id": 281,
            "chat_read": 1,
            "status": 1,
            "origin": "i",
            "count_messages": 0,
            "data": null,
            "timestamp": null,
            "created_at": "2018-08-31 16:11:15",
            "updated_at": "2018-08-31 16:12:04"
        },
        {
            "id": 15,
            "customer_id": 163,
            "category_id": 1,
            "subcat": null,
            "name": "contact",
            "picture": null,
            "phone": "55119810033330563456709",
            "email": "",
            "cpf": null,
            "address": null,
            "gender": null,
            "type": "user",
            "channel_id": 177,
            "user_id": 281,
            "portfolio_user_id": 281,
            "chat_read": 1,
            "status": 1,
            "origin": "i",
            "count_messages": 0,
            "data": null,
            "timestamp": null,
            "created_at": "2018-08-31 16:12:52",
            "updated_at": "2018-08-31 16:13:45"
        }
    ],
    "first_page_url": "http:\/\/localhost:8000\/api\/v1\/customers\/163\/chats?page=1",
    "from": 1,
    "last_page": 2,
    "last_page_url": "http:\/\/localhost:8000\/api\/v1\/customers\/163\/chats?page=2",
    "next_page_url": "http:\/\/localhost:8000\/api\/v1\/customers\/163\/chats?page=2",
    "path": "http:\/\/localhost:8000\/api\/v1\/customers\/163\/chats",
    "per_page": 20,
    "prev_page_url": null,
    "to": 20,
    "total": 33
}

showChatsByUser

Retorna todos os chats de um usuário (user).

curl -X GET -H "Content-Type: application/x-www-form-urlencoded" -H "Accept: application/json" -H "Authorization: Bearer {{bearer}}" "{{URL}}/api/v1/customers/{{customer}}/chats/users/{{user}}"
GET %7B%7BURL%7D%7D/api/v1/customers/%7B%7Bcustomer%7D%7D/chats/users/%7B%7Buser%7D%7D HTTP/1.1
Host: 
Content-Type: application/x-www-form-urlencoded
Accept: application/json
Authorization: Bearer {{bearer}}
Status200
Cache-Controlno-cache, private
Connectionclose
Content-Typeapplication/json
DateThu, 20 Sep 2018 17:06:42 +0000
DateThu, 20 Sep 2018 17:06:42 GMT
Hostlocalhost:8000
X-Powered-ByPHP/7.2.8
{
    "current_page": 1,
    "data": [
        {
            "id": 1,
            "customer_id": 163,
            "category_id": 1,
            "subcat": null,
            "name": "Nome Fantasia",
            "picture": null,
            "phone": "556281000009",
            "email": "testeapi@teste.com",
            "cpf": "00000000000",
            "address": "Endere\u00e7o xyz",
            "gender": "masculino",
            "type": "user",
            "channel_id": 177,
            "user_id": 1,
            "portfolio_user_id": 281,
            "chat_read": 0,
            "status": 1,
            "origin": "i",
            "count_messages": 0,
            "data": null,
            "timestamp": null,
            "created_at": "2018-08-28 18:03:42",
            "updated_at": "2018-09-19 17:17:17"
        },
        {
            "id": 33,
            "customer_id": 163,
            "category_id": 1,
            "subcat": null,
            "name": "Nome Fantasia",
            "picture": null,
            "phone": "556281000000",
            "email": "testeapi@teste.com",
            "cpf": null,
            "address": null,
            "gender": null,
            "type": null,
            "channel_id": null,
            "user_id": 281,
            "portfolio_user_id": null,
            "chat_read": 0,
            "status": 1,
            "origin": null,
            "count_messages": 0,
            "data": null,
            "timestamp": null,
            "created_at": "2018-09-12 11:44:35",
            "updated_at": "2018-09-12 11:44:35"
        },
        {
            "id": 32,
            "customer_id": 163,
            "category_id": 1,
            "subcat": null,
            "name": "contact",
            "picture": null,
            "phone": "5511981002244",
            "email": "",
            "cpf": null,
            "address": null,
            "gender": null,
            "type": "user",
            "channel_id": 179,
            "user_id": 282,
            "portfolio_user_id": 282,
            "chat_read": 1,
            "status": 1,
            "origin": "o",
            "count_messages": 0,
            "data": null,
            "timestamp": null,
            "created_at": "2018-09-03 12:20:00",
            "updated_at": "2018-09-03 12:20:49"
        },
        {
            "id": 31,
            "customer_id": 163,
            "category_id": 1,
            "subcat": null,
            "name": "contact",
            "picture": null,
            "phone": "551198100222",
            "email": "",
            "cpf": null,
            "address": null,
            "gender": null,
            "type": "user",
            "channel_id": 179,
            "user_id": 282,
            "portfolio_user_id": 282,
            "chat_read": 1,
            "status": 1,
            "origin": "o",
            "count_messages": 0,
            "data": null,
            "timestamp": null,
            "created_at": "2018-09-03 12:14:37",
            "updated_at": "2018-09-03 12:14:37"
        },
        {
            "id": 29,
            "customer_id": 163,
            "category_id": 1,
            "subcat": null,
            "name": "contact",
            "picture": null,
            "phone": "5511981002222",
            "email": "",
            "cpf": null,
            "address": null,
            "gender": null,
            "type": "user",
            "channel_id": 177,
            "user_id": 281,
            "portfolio_user_id": 281,
            "chat_read": 1,
            "status": 1,
            "origin": "o",
            "count_messages": 0,
            "data": null,
            "timestamp": null,
            "created_at": "2018-08-31 17:48:25",
            "updated_at": "2018-09-03 12:10:56"
        },
        {
            "id": 30,
            "customer_id": 163,
            "category_id": 1,
            "subcat": null,
            "name": "contact",
            "picture": null,
            "phone": "55119810022226",
            "email": "",
            "cpf": null,
            "address": null,
            "gender": null,
            "type": "user",
            "channel_id": 177,
            "user_id": 282,
            "portfolio_user_id": 282,
            "chat_read": 1,
            "status": 1,
            "origin": "o",
            "count_messages": 0,
            "data": null,
            "timestamp": null,
            "created_at": "2018-08-31 17:49:45",
            "updated_at": "2018-09-03 12:09:38"
        },
        {
            "id": 25,
            "customer_id": 163,
            "category_id": 1,
            "subcat": null,
            "name": "contact",
            "picture": null,
            "phone": "5511981002",
            "email": "",
            "cpf": null,
            "address": null,
            "gender": null,
            "type": "user",
            "channel_id": 177,
            "user_id": 281,
            "portfolio_user_id": 281,
            "chat_read": 1,
            "status": 1,
            "origin": "o",
            "count_messages": 0,
            "data": null,
            "timestamp": null,
            "created_at": "2018-08-31 17:40:39",
            "updated_at": "2018-08-31 17:48:14"
        },
        {
            "id": 28,
            "customer_id": 163,
            "category_id": 1,
            "subcat": null,
            "name": "contact",
            "picture": null,
            "phone": "55119810022",
            "email": "",
            "cpf": null,
            "address": null,
            "gender": null,
            "type": "user",
            "channel_id": 177,
            "user_id": 281,
            "portfolio_user_id": 281,
            "chat_read": 1,
            "status": 1,
            "origin": "o",
            "count_messages": 0,
            "data": null,
            "timestamp": null,
            "created_at": "2018-08-31 17:47:45",
            "updated_at": "2018-08-31 17:47:45"
        },
        {
            "id": 26,
            "customer_id": 163,
            "category_id": 1,
            "subcat": null,
            "name": "contact",
            "picture": null,
            "phone": "5511981002212",
            "email": "",
            "cpf": null,
            "address": null,
            "gender": null,
            "type": "user",
            "channel_id": 177,
            "user_id": 281,
            "portfolio_user_id": 281,
            "chat_read": 1,
            "status": 1,
            "origin": "o",
            "count_messages": 0,
            "data": null,
            "timestamp": null,
            "created_at": "2018-08-31 17:44:18",
            "updated_at": "2018-08-31 17:47:20"
        },
        {
            "id": 27,
            "customer_id": 163,
            "category_id": 1,
            "subcat": null,
            "name": "contact",
            "picture": null,
            "phone": "55119810022123",
            "email": "",
            "cpf": null,
            "address": null,
            "gender": null,
            "type": "user",
            "channel_id": 177,
            "user_id": 281,
            "portfolio_user_id": 281,
            "chat_read": 1,
            "status": 1,
            "origin": "o",
            "count_messages": 0,
            "data": null,
            "timestamp": null,
            "created_at": "2018-08-31 17:44:30",
            "updated_at": "2018-08-31 17:44:30"
        },
        {
            "id": 24,
            "customer_id": 163,
            "category_id": 1,
            "subcat": null,
            "name": "contact",
            "picture": null,
            "phone": "551198100",
            "email": "",
            "cpf": null,
            "address": null,
            "gender": null,
            "type": "user",
            "channel_id": 177,
            "user_id": 281,
            "portfolio_user_id": 281,
            "chat_read": 1,
            "status": 1,
            "origin": "o",
            "count_messages": 0,
            "data": null,
            "timestamp": null,
            "created_at": "2018-08-31 17:40:12",
            "updated_at": "2018-08-31 17:40:12"
        },
        {
            "id": 23,
            "customer_id": 163,
            "category_id": 1,
            "subcat": null,
            "name": "contact",
            "picture": null,
            "phone": "5511981003",
            "email": "",
            "cpf": null,
            "address": null,
            "gender": null,
            "type": "user",
            "channel_id": 177,
            "user_id": 281,
            "portfolio_user_id": 281,
            "chat_read": 1,
            "status": 1,
            "origin": "o",
            "count_messages": 0,
            "data": null,
            "timestamp": null,
            "created_at": "2018-08-31 17:39:51",
            "updated_at": "2018-08-31 17:39:51"
        },
        {
            "id": 22,
            "customer_id": 163,
            "category_id": 1,
            "subcat": null,
            "name": "contact",
            "picture": null,
            "phone": "5511981003312",
            "email": "",
            "cpf": null,
            "address": null,
            "gender": null,
            "type": "user",
            "channel_id": 177,
            "user_id": 281,
            "portfolio_user_id": 281,
            "chat_read": 1,
            "status": 1,
            "origin": "i",
            "count_messages": 0,
            "data": null,
            "timestamp": null,
            "created_at": "2018-08-31 16:49:47",
            "updated_at": "2018-08-31 17:31:58"
        },
        {
            "id": 21,
            "customer_id": 163,
            "category_id": 1,
            "subcat": null,
            "name": "contact",
            "picture": null,
            "phone": "551198100333",
            "email": "",
            "cpf": null,
            "address": null,
            "gender": null,
            "type": "user",
            "channel_id": 177,
            "user_id": null,
            "portfolio_user_id": 281,
            "chat_read": 1,
            "status": 1,
            "origin": "i",
            "count_messages": 0,
            "data": null,
            "timestamp": null,
            "created_at": "2018-08-31 16:48:44",
            "updated_at": "2018-08-31 16:48:44"
        },
        {
            "id": 20,
            "customer_id": 163,
            "category_id": 1,
            "subcat": null,
            "name": "contact",
            "picture": null,
            "phone": "55119810033330",
            "email": "",
            "cpf": null,
            "address": null,
            "gender": null,
            "type": "user",
            "channel_id": 177,
            "user_id": null,
            "portfolio_user_id": 281,
            "chat_read": 1,
            "status": 1,
            "origin": "i",
            "count_messages": 0,
            "data": null,
            "timestamp": null,
            "created_at": "2018-08-31 16:36:02",
            "updated_at": "2018-08-31 16:48:11"
        },
        {
            "id": 19,
            "customer_id": 163,
            "category_id": 1,
            "subcat": null,
            "name": "contact",
            "picture": null,
            "phone": "551198100333300",
            "email": "",
            "cpf": null,
            "address": null,
            "gender": null,
            "type": "user",
            "channel_id": 177,
            "user_id": 282,
            "portfolio_user_id": 281,
            "chat_read": 1,
            "status": 1,
            "origin": "i",
            "count_messages": 0,
            "data": null,
            "timestamp": null,
            "created_at": "2018-08-31 16:35:03",
            "updated_at": "2018-08-31 16:45:36"
        },
        {
            "id": 18,
            "customer_id": 163,
            "category_id": 1,
            "subcat": null,
            "name": "contact",
            "picture": null,
            "phone": "55119810033330092",
            "email": "",
            "cpf": null,
            "address": null,
            "gender": null,
            "type": "user",
            "channel_id": 177,
            "user_id": 281,
            "portfolio_user_id": 281,
            "chat_read": 1,
            "status": 1,
            "origin": "i",
            "count_messages": 0,
            "data": null,
            "timestamp": null,
            "created_at": "2018-08-31 16:24:39",
            "updated_at": "2018-08-31 16:34:00"
        },
        {
            "id": 17,
            "customer_id": 163,
            "category_id": 1,
            "subcat": null,
            "name": "contact",
            "picture": null,
            "phone": "55119810033330098",
            "email": "",
            "cpf": null,
            "address": null,
            "gender": null,
            "type": "user",
            "channel_id": 177,
            "user_id": null,
            "portfolio_user_id": 281,
            "chat_read": 1,
            "status": 1,
            "origin": "i",
            "count_messages": 0,
            "data": null,
            "timestamp": null,
            "created_at": "2018-08-31 16:24:12",
            "updated_at": "2018-08-31 16:24:12"
        },
        {
            "id": 16,
            "customer_id": 163,
            "category_id": 1,
            "subcat": null,
            "name": "contact",
            "picture": null,
            "phone": "551198100333300987",
            "email": "",
            "cpf": null,
            "address": null,
            "gender": null,
            "type": "user",
            "channel_id": 177,
            "user_id": null,
            "portfolio_user_id": 281,
            "chat_read": 1,
            "status": 1,
            "origin": "i",
            "count_messages": 0,
            "data": null,
            "timestamp": null,
            "created_at": "2018-08-31 16:15:56",
            "updated_at": "2018-08-31 16:16:09"
        },
        {
            "id": 15,
            "customer_id": 163,
            "category_id": 1,
            "subcat": null,
            "name": "contact",
            "picture": null,
            "phone": "55119810033330563456709",
            "email": "",
            "cpf": null,
            "address": null,
            "gender": null,
            "type": "user",
            "channel_id": 177,
            "user_id": 281,
            "portfolio_user_id": 281,
            "chat_read": 1,
            "status": 1,
            "origin": "i",
            "count_messages": 0,
            "data": null,
            "timestamp": null,
            "created_at": "2018-08-31 16:12:52",
            "updated_at": "2018-08-31 16:13:45"
        }
    ],
    "first_page_url": "http:\/\/localhost:8000\/api\/v1\/customers\/163\/chats\/users\/1?page=1",
    "from": 1,
    "last_page": 2,
    "last_page_url": "http:\/\/localhost:8000\/api\/v1\/customers\/163\/chats\/users\/1?page=2",
    "next_page_url": "http:\/\/localhost:8000\/api\/v1\/customers\/163\/chats\/users\/1?page=2",
    "path": "http:\/\/localhost:8000\/api\/v1\/customers\/163\/chats\/users\/1",
    "per_page": 20,
    "prev_page_url": null,
    "to": 20,
    "total": 33
}

showMessages

Retorna o histórico de mensagens de um contato.

curl -X GET -H "Content-Type: application/x-www-form-urlencoded" -H "Accept: application/json" -H "Authorization: Bearer {{bearer}}" "{{URL}}/api/v1/customers/{{customer}}/chats/contacts/{{contact}}/messages"
GET %7B%7BURL%7D%7D/api/v1/customers/%7B%7Bcustomer%7D%7D/chats/contacts/%7B%7Bcontact%7D%7D/messages HTTP/1.1
Host: 
Content-Type: application/x-www-form-urlencoded
Accept: application/json
Authorization: Bearer {{bearer}}
Status200
Cache-Controlno-cache, private
Connectionclose
Content-Typeapplication/json
DateThu, 20 Sep 2018 17:06:54 +0000
DateThu, 20 Sep 2018 17:06:54 GMT
Hostlocalhost:8000
X-Powered-ByPHP/7.2.8
{
    "current_page": 1,
    "data": [
        {
            "id": 219563,
            "channel_id": 177,
            "chat_id": 31859,
            "user_id": 281,
            "contact_id": 1,
            "contact_uid": "552181342862",
            "contact_name": "contact",
            "message_body": "asd",
            "message_body_url": "",
            "message_body_thumb": "",
            "message_body_caption": "",
            "message_body_mimetype": "",
            "message_body_contact": "",
            "message_body_vcard": "",
            "message_body_name": "",
            "message_body_lat": "",
            "message_body_lng": "",
            "message_dtm": "asd",
            "message_cuid": "bo",
            "message_dir": "o",
            "message_type": "chat",
            "event": "message",
            "created_at": "2018-08-28 18:23:02",
            "updated_at": "2018-08-28 18:23:02"
        },
        {
            "id": 219562,
            "channel_id": 177,
            "chat_id": 31859,
            "user_id": null,
            "contact_id": 1,
            "contact_uid": "552181342862",
            "contact_name": "contact",
            "message_body": "asd",
            "message_body_url": "",
            "message_body_thumb": "",
            "message_body_caption": "",
            "message_body_mimetype": "",
            "message_body_contact": "",
            "message_body_vcard": "",
            "message_body_name": "",
            "message_body_lat": "",
            "message_body_lng": "",
            "message_dtm": "asd",
            "message_cuid": "bo",
            "message_dir": "i",
            "message_type": "chat",
            "event": "message",
            "created_at": "2018-08-28 18:03:42",
            "updated_at": "2018-08-28 18:03:42"
        }
    ],
    "first_page_url": "http:\/\/localhost:8000\/api\/v1\/customers\/163\/chats\/contacts\/1\/messages?page=1",
    "from": 1,
    "last_page": 1,
    "last_page_url": "http:\/\/localhost:8000\/api\/v1\/customers\/163\/chats\/contacts\/1\/messages?page=1",
    "next_page_url": null,
    "path": "http:\/\/localhost:8000\/api\/v1\/customers\/163\/chats\/contacts\/1\/messages",
    "per_page": 20,
    "prev_page_url": null,
    "to": 2,
    "total": 2
}

showGalleries

Retorna todos os arquivos enviados e recebidos pela empresa.

curl -X GET -H "Content-Type: application/x-www-form-urlencoded" -H "Accept: application/json" -H "Authorization: Bearer {{bearer}}" "{{URL}}/api/v1/customers/{{customer}}/chats/galleries"
GET %7B%7BURL%7D%7D/api/v1/customers/%7B%7Bcustomer%7D%7D/chats/galleries HTTP/1.1
Host: 
Content-Type: application/x-www-form-urlencoded
Accept: application/json
Authorization: Bearer {{bearer}}
Status200
Cache-Controlno-cache, private
Connectionclose
Content-Typeapplication/json
DateFri, 14 Sep 2018 14:45:40 +0000
DateFri, 14 Sep 2018 14:45:40 GMT
Hostlocalhost:8000
X-Powered-ByPHP/7.2.8
{
    "current_page": 1,
    "data": [
        {
            "id": 24,
            "customer_id": 163,
            "category_id": 1,
            "subcat": null,
            "name": "contact",
            "picture": null,
            "phone": "551198100",
            "email": "",
            "cpf": null,
            "address": null,
            "gender": null,
            "type": "user",
            "channel_id": 177,
            "user_id": 281,
            "portfolio_user_id": 281,
            "chat_read": 1,
            "status": 1,
            "origin": "o",
            "count_messages": 0,
            "data": null,
            "timestamp": null,
            "created_at": "2018-08-31 17:40:12",
            "updated_at": "2018-08-31 17:40:12"
        },
        {
            "id": 25,
            "customer_id": 163,
            "category_id": 1,
            "subcat": null,
            "name": "contact",
            "picture": null,
            "phone": "5511981002",
            "email": "",
            "cpf": null,
            "address": null,
            "gender": null,
            "type": "user",
            "channel_id": 177,
            "user_id": 281,
            "portfolio_user_id": 281,
            "chat_read": 1,
            "status": 1,
            "origin": "o",
            "count_messages": 0,
            "data": null,
            "timestamp": null,
            "created_at": "2018-08-31 17:40:39",
            "updated_at": "2018-08-31 17:48:14"
        },
        {
            "id": 28,
            "customer_id": 163,
            "category_id": 1,
            "subcat": null,
            "name": "contact",
            "picture": null,
            "phone": "55119810022",
            "email": "",
            "cpf": null,
            "address": null,
            "gender": null,
            "type": "user",
            "channel_id": 177,
            "user_id": 281,
            "portfolio_user_id": 281,
            "chat_read": 1,
            "status": 1,
            "origin": "o",
            "count_messages": 0,
            "data": null,
            "timestamp": null,
            "created_at": "2018-08-31 17:47:45",
            "updated_at": "2018-08-31 17:47:45"
        },
        {
            "id": 26,
            "customer_id": 163,
            "category_id": 1,
            "subcat": null,
            "name": "contact",
            "picture": null,
            "phone": "5511981002212",
            "email": "",
            "cpf": null,
            "address": null,
            "gender": null,
            "type": "user",
            "channel_id": 177,
            "user_id": 281,
            "portfolio_user_id": 281,
            "chat_read": 1,
            "status": 1,
            "origin": "o",
            "count_messages": 0,
            "data": null,
            "timestamp": null,
            "created_at": "2018-08-31 17:44:18",
            "updated_at": "2018-08-31 17:47:20"
        },
        {
            "id": 27,
            "customer_id": 163,
            "category_id": 1,
            "subcat": null,
            "name": "contact",
            "picture": null,
            "phone": "55119810022123",
            "email": "",
            "cpf": null,
            "address": null,
            "gender": null,
            "type": "user",
            "channel_id": 177,
            "user_id": 281,
            "portfolio_user_id": 281,
            "chat_read": 1,
            "status": 1,
            "origin": "o",
            "count_messages": 0,
            "data": null,
            "timestamp": null,
            "created_at": "2018-08-31 17:44:30",
            "updated_at": "2018-08-31 17:44:30"
        },
        {
            "id": 31,
            "customer_id": 163,
            "category_id": 1,
            "subcat": null,
            "name": "contact",
            "picture": null,
            "phone": "551198100222",
            "email": "",
            "cpf": null,
            "address": null,
            "gender": null,
            "type": "user",
            "channel_id": 179,
            "user_id": 282,
            "portfolio_user_id": 282,
            "chat_read": 1,
            "status": 1,
            "origin": "o",
            "count_messages": 0,
            "data": null,
            "timestamp": null,
            "created_at": "2018-09-03 12:14:37",
            "updated_at": "2018-09-03 12:14:37"
        },
        {
            "id": 29,
            "customer_id": 163,
            "category_id": 1,
            "subcat": null,
            "name": "contact",
            "picture": null,
            "phone": "5511981002222",
            "email": "",
            "cpf": null,
            "address": null,
            "gender": null,
            "type": "user",
            "channel_id": 177,
            "user_id": 281,
            "portfolio_user_id": 281,
            "chat_read": 1,
            "status": 1,
            "origin": "o",
            "count_messages": 0,
            "data": null,
            "timestamp": null,
            "created_at": "2018-08-31 17:48:25",
            "updated_at": "2018-09-03 12:10:56"
        },
        {
            "id": 30,
            "customer_id": 163,
            "category_id": 1,
            "subcat": null,
            "name": "contact",
            "picture": null,
            "phone": "55119810022226",
            "email": "",
            "cpf": null,
            "address": null,
            "gender": null,
            "type": "user",
            "channel_id": 177,
            "user_id": 282,
            "portfolio_user_id": 282,
            "chat_read": 1,
            "status": 1,
            "origin": "o",
            "count_messages": 0,
            "data": null,
            "timestamp": null,
            "created_at": "2018-08-31 17:49:45",
            "updated_at": "2018-09-03 12:09:38"
        },
        {
            "id": 32,
            "customer_id": 163,
            "category_id": 1,
            "subcat": null,
            "name": "contact",
            "picture": null,
            "phone": "5511981002244",
            "email": "",
            "cpf": null,
            "address": null,
            "gender": null,
            "type": "user",
            "channel_id": 179,
            "user_id": 282,
            "portfolio_user_id": 282,
            "chat_read": 1,
            "status": 1,
            "origin": "o",
            "count_messages": 0,
            "data": null,
            "timestamp": null,
            "created_at": "2018-09-03 12:20:00",
            "updated_at": "2018-09-03 12:20:49"
        },
        {
            "id": 23,
            "customer_id": 163,
            "category_id": 1,
            "subcat": null,
            "name": "contact",
            "picture": null,
            "phone": "5511981003",
            "email": "",
            "cpf": null,
            "address": null,
            "gender": null,
            "type": "user",
            "channel_id": 177,
            "user_id": 281,
            "portfolio_user_id": 281,
            "chat_read": 1,
            "status": 1,
            "origin": "o",
            "count_messages": 0,
            "data": null,
            "timestamp": null,
            "created_at": "2018-08-31 17:39:51",
            "updated_at": "2018-08-31 17:39:51"
        },
        {
            "id": 22,
            "customer_id": 163,
            "category_id": 1,
            "subcat": null,
            "name": "contact",
            "picture": null,
            "phone": "5511981003312",
            "email": "",
            "cpf": null,
            "address": null,
            "gender": null,
            "type": "user",
            "channel_id": 177,
            "user_id": 281,
            "portfolio_user_id": 281,
            "chat_read": 1,
            "status": 1,
            "origin": "i",
            "count_messages": 0,
            "data": null,
            "timestamp": null,
            "created_at": "2018-08-31 16:49:47",
            "updated_at": "2018-08-31 17:31:58"
        },
        {
            "id": 21,
            "customer_id": 163,
            "category_id": 1,
            "subcat": null,
            "name": "contact",
            "picture": null,
            "phone": "551198100333",
            "email": "",
            "cpf": null,
            "address": null,
            "gender": null,
            "type": "user",
            "channel_id": 177,
            "user_id": null,
            "portfolio_user_id": 281,
            "chat_read": 1,
            "status": 1,
            "origin": "i",
            "count_messages": 0,
            "data": null,
            "timestamp": null,
            "created_at": "2018-08-31 16:48:44",
            "updated_at": "2018-08-31 16:48:44"
        },
        {
            "id": 20,
            "customer_id": 163,
            "category_id": 1,
            "subcat": null,
            "name": "contact",
            "picture": null,
            "phone": "55119810033330",
            "email": "",
            "cpf": null,
            "address": null,
            "gender": null,
            "type": "user",
            "channel_id": 177,
            "user_id": null,
            "portfolio_user_id": 281,
            "chat_read": 1,
            "status": 1,
            "origin": "i",
            "count_messages": 0,
            "data": null,
            "timestamp": null,
            "created_at": "2018-08-31 16:36:02",
            "updated_at": "2018-08-31 16:48:11"
        },
        {
            "id": 19,
            "customer_id": 163,
            "category_id": 1,
            "subcat": null,
            "name": "contact",
            "picture": null,
            "phone": "551198100333300",
            "email": "",
            "cpf": null,
            "address": null,
            "gender": null,
            "type": "user",
            "channel_id": 177,
            "user_id": 282,
            "portfolio_user_id": 281,
            "chat_read": 1,
            "status": 1,
            "origin": "i",
            "count_messages": 0,
            "data": null,
            "timestamp": null,
            "created_at": "2018-08-31 16:35:03",
            "updated_at": "2018-08-31 16:45:36"
        },
        {
            "id": 18,
            "customer_id": 163,
            "category_id": 1,
            "subcat": null,
            "name": "contact",
            "picture": null,
            "phone": "55119810033330092",
            "email": "",
            "cpf": null,
            "address": null,
            "gender": null,
            "type": "user",
            "channel_id": 177,
            "user_id": 281,
            "portfolio_user_id": 281,
            "chat_read": 1,
            "status": 1,
            "origin": "i",
            "count_messages": 0,
            "data": null,
            "timestamp": null,
            "created_at": "2018-08-31 16:24:39",
            "updated_at": "2018-08-31 16:34:00"
        },
        {
            "id": 17,
            "customer_id": 163,
            "category_id": 1,
            "subcat": null,
            "name": "contact",
            "picture": null,
            "phone": "55119810033330098",
            "email": "",
            "cpf": null,
            "address": null,
            "gender": null,
            "type": "user",
            "channel_id": 177,
            "user_id": null,
            "portfolio_user_id": 281,
            "chat_read": 1,
            "status": 1,
            "origin": "i",
            "count_messages": 0,
            "data": null,
            "timestamp": null,
            "created_at": "2018-08-31 16:24:12",
            "updated_at": "2018-08-31 16:24:12"
        },
        {
            "id": 16,
            "customer_id": 163,
            "category_id": 1,
            "subcat": null,
            "name": "contact",
            "picture": null,
            "phone": "551198100333300987",
            "email": "",
            "cpf": null,
            "address": null,
            "gender": null,
            "type": "user",
            "channel_id": 177,
            "user_id": null,
            "portfolio_user_id": 281,
            "chat_read": 1,
            "status": 1,
            "origin": "i",
            "count_messages": 0,
            "data": null,
            "timestamp": null,
            "created_at": "2018-08-31 16:15:56",
            "updated_at": "2018-08-31 16:16:09"
        },
        {
            "id": 13,
            "customer_id": 163,
            "category_id": 1,
            "subcat": null,
            "name": "contact",
            "picture": null,
            "phone": "551198100333305634567",
            "email": "",
            "cpf": null,
            "address": null,
            "gender": null,
            "type": "user",
            "channel_id": 177,
            "user_id": 281,
            "portfolio_user_id": 281,
            "chat_read": 1,
            "status": 1,
            "origin": "i",
            "count_messages": 0,
            "data": null,
            "timestamp": null,
            "created_at": "2018-08-31 16:02:02",
            "updated_at": "2018-08-31 16:08:33"
        },
        {
            "id": 14,
            "customer_id": 163,
            "category_id": 1,
            "subcat": null,
            "name": "contact",
            "picture": null,
            "phone": "5511981003333056345670",
            "email": "",
            "cpf": null,
            "address": null,
            "gender": null,
            "type": "user",
            "channel_id": 177,
            "user_id": 281,
            "portfolio_user_id": 281,
            "chat_read": 1,
            "status": 1,
            "origin": "i",
            "count_messages": 0,
            "data": null,
            "timestamp": null,
            "created_at": "2018-08-31 16:11:15",
            "updated_at": "2018-08-31 16:12:04"
        },
        {
            "id": 15,
            "customer_id": 163,
            "category_id": 1,
            "subcat": null,
            "name": "contact",
            "picture": null,
            "phone": "55119810033330563456709",
            "email": "",
            "cpf": null,
            "address": null,
            "gender": null,
            "type": "user",
            "channel_id": 177,
            "user_id": 281,
            "portfolio_user_id": 281,
            "chat_read": 1,
            "status": 1,
            "origin": "i",
            "count_messages": 0,
            "data": null,
            "timestamp": null,
            "created_at": "2018-08-31 16:12:52",
            "updated_at": "2018-08-31 16:13:45"
        }
    ],
    "first_page_url": "http:\/\/localhost:8000\/api\/v1\/customers\/163\/chats\/galleries?page=1",
    "from": 1,
    "last_page": 2,
    "last_page_url": "http:\/\/localhost:8000\/api\/v1\/customers\/163\/chats\/galleries?page=2",
    "next_page_url": "http:\/\/localhost:8000\/api\/v1\/customers\/163\/chats\/galleries?page=2",
    "path": "http:\/\/localhost:8000\/api\/v1\/customers\/163\/chats\/galleries",
    "per_page": 20,
    "prev_page_url": null,
    "to": 20,
    "total": 33
}

showGalleriesByChat

Mostra todos os arquivos enviados e recebidos por um chat.

curl -X GET -H "Content-Type: application/x-www-form-urlencoded" -H "Accept: application/json" -H "Authorization: Bearer {{bearer}}" "{{URL}}/api/v1/customers/{{customer}}/chats/galleries/byChat/{{chat}}"
GET %7B%7BURL%7D%7D/api/v1/customers/%7B%7Bcustomer%7D%7D/chats/galleries/byChat/%7B%7Bchat%7D%7D HTTP/1.1
Host: 
Content-Type: application/x-www-form-urlencoded
Accept: application/json
Authorization: Bearer {{bearer}}
Status200
Cache-Controlno-cache, private
Connectionclose
Content-Typeapplication/json
DateThu, 20 Sep 2018 17:47:58 +0000
DateThu, 20 Sep 2018 17:47:58 GMT
Hostlocalhost:8000
X-Powered-ByPHP/7.2.8
{
    "current_page": 1,
    "data": [
        {
            "id": 219533,
            "contact_id": 2,
            "message_body_url": "https:\/\/vignette.wikia.nocookie.net\/insanopedia\/images\/0\/0f\/Exemplo.jpg\/revision\/latest?cb=20090811163700&path-prefix=pt-br",
            "message_body_thumb": "",
            "message_body_caption": "",
            "message_body_mimetype": "",
            "message_dtm": "1487082303",
            "message_dir": "o",
            "message_type": "chat"
        },
        {
            "id": 219532,
            "contact_id": 2,
            "message_body_url": "https:\/\/vignette.wikia.nocookie.net\/insanopedia\/images\/0\/0f\/Exemplo.jpg\/revision\/latest?cb=20090811163700&path-prefix=pt-br",
            "message_body_thumb": "",
            "message_body_caption": "",
            "message_body_mimetype": "",
            "message_dtm": "1487082303",
            "message_dir": "i",
            "message_type": "chat"
        }
    ],
    "first_page_url": "http:\/\/localhost:8000\/api\/v1\/customers\/163\/chats\/galleries\/byChat\/31845?page=1",
    "from": 1,
    "last_page": 1,
    "last_page_url": "http:\/\/localhost:8000\/api\/v1\/customers\/163\/chats\/galleries\/byChat\/31845?page=1",
    "next_page_url": null,
    "path": "http:\/\/localhost:8000\/api\/v1\/customers\/163\/chats\/galleries\/byChat\/31845",
    "per_page": 20,
    "prev_page_url": null,
    "to": 2,
    "total": 2
}

showGalleriesByContact

Mostra os arquivos enviados ou recebidos de um determinado contato.

curl -X GET -H "Content-Type: application/x-www-form-urlencoded" -H "Accept: application/json" -H "Authorization: Bearer {{bearer}}" "{{URL}}/api/v1/customers/{{customer}}/chats/galleries/byContact/{{contact2}}"
GET %7B%7BURL%7D%7D/api/v1/customers/%7B%7Bcustomer%7D%7D/chats/galleries/byContact/%7B%7Bcontact2%7D%7D HTTP/1.1
Host: 
Content-Type: application/x-www-form-urlencoded
Accept: application/json
Authorization: Bearer {{bearer}}
Status200
Cache-Controlno-cache, private
Connectionclose
Content-Typeapplication/json
DateThu, 20 Sep 2018 17:52:27 +0000
DateThu, 20 Sep 2018 17:52:27 GMT
Hostlocalhost:8000
X-Powered-ByPHP/7.2.8
{
    "current_page": 1,
    "data": [
        {
            "id": 219534,
            "contact_id": 2,
            "message_body_url": "https:\/\/vignette.wikia.nocookie.net\/insanopedia\/images\/0\/0f\/Exemplo.jpg\/revision\/latest?cb=20090811163700&path-prefix=pt-br",
            "message_body_thumb": "",
            "message_body_caption": "",
            "message_body_mimetype": "",
            "message_dtm": "1487082303",
            "message_dir": "i",
            "message_type": "chat"
        },
        {
            "id": 219533,
            "contact_id": 2,
            "message_body_url": "https:\/\/vignette.wikia.nocookie.net\/insanopedia\/images\/0\/0f\/Exemplo.jpg\/revision\/latest?cb=20090811163700&path-prefix=pt-br",
            "message_body_thumb": "",
            "message_body_caption": "",
            "message_body_mimetype": "",
            "message_dtm": "1487082303",
            "message_dir": "o",
            "message_type": "chat"
        },
        {
            "id": 219532,
            "contact_id": 2,
            "message_body_url": "https:\/\/vignette.wikia.nocookie.net\/insanopedia\/images\/0\/0f\/Exemplo.jpg\/revision\/latest?cb=20090811163700&path-prefix=pt-br",
            "message_body_thumb": "",
            "message_body_caption": "",
            "message_body_mimetype": "",
            "message_dtm": "1487082303",
            "message_dir": "i",
            "message_type": "chat"
        }
    ],
    "first_page_url": "http:\/\/localhost:8000\/api\/v1\/customers\/163\/chats\/galleries\/byContact\/2?page=1",
    "from": 1,
    "last_page": 1,
    "last_page_url": "http:\/\/localhost:8000\/api\/v1\/customers\/163\/chats\/galleries\/byContact\/2?page=1",
    "next_page_url": null,
    "path": "http:\/\/localhost:8000\/api\/v1\/customers\/163\/chats\/galleries\/byContact\/2",
    "per_page": 20,
    "prev_page_url": null,
    "to": 3,
    "total": 3
}

Contacts

showAllContacts

Retorna a lista de todos os contatos da empresa.

curl -X GET -H "Content-Type: application/x-www-form-urlencoded" -H "Accept: application/json" -H "Authorization: Bearer {{bearer}}" "{{URL}}/api/v1/customers/{{customer}}/contacts"
GET %7B%7BURL%7D%7D/api/v1/customers/%7B%7Bcustomer%7D%7D/contacts HTTP/1.1
Host: 
Content-Type: application/x-www-form-urlencoded
Accept: application/json
Authorization: Bearer {{bearer}}
Status200
Cache-Controlno-cache, private
Connectionclose
Content-Typeapplication/json
DateThu, 20 Sep 2018 17:13:02 +0000
DateThu, 20 Sep 2018 17:13:02 GMT
Hostlocalhost:8000
X-Powered-ByPHP/7.2.8
{
    "current_page": 1,
    "data": [
        {
            "id": 24,
            "customer_id": 163,
            "category_id": 1,
            "subcat": null,
            "name": "contact",
            "picture": null,
            "phone": "551198100",
            "email": "",
            "cpf": null,
            "address": null,
            "gender": null,
            "type": "user",
            "channel_id": 177,
            "user_id": 281,
            "portfolio_user_id": 281,
            "chat_read": 1,
            "status": 1,
            "origin": "o",
            "count_messages": 0,
            "data": null,
            "timestamp": null,
            "created_at": "2018-08-31 17:40:12",
            "updated_at": "2018-08-31 17:40:12"
        },
        {
            "id": 25,
            "customer_id": 163,
            "category_id": 1,
            "subcat": null,
            "name": "contact",
            "picture": null,
            "phone": "5511981002",
            "email": "",
            "cpf": null,
            "address": null,
            "gender": null,
            "type": "user",
            "channel_id": 177,
            "user_id": 281,
            "portfolio_user_id": 281,
            "chat_read": 1,
            "status": 1,
            "origin": "o",
            "count_messages": 0,
            "data": null,
            "timestamp": null,
            "created_at": "2018-08-31 17:40:39",
            "updated_at": "2018-08-31 17:48:14"
        },
        {
            "id": 28,
            "customer_id": 163,
            "category_id": 1,
            "subcat": null,
            "name": "contact",
            "picture": null,
            "phone": "55119810022",
            "email": "",
            "cpf": null,
            "address": null,
            "gender": null,
            "type": "user",
            "channel_id": 177,
            "user_id": 281,
            "portfolio_user_id": 281,
            "chat_read": 1,
            "status": 1,
            "origin": "o",
            "count_messages": 0,
            "data": null,
            "timestamp": null,
            "created_at": "2018-08-31 17:47:45",
            "updated_at": "2018-08-31 17:47:45"
        },
        {
            "id": 26,
            "customer_id": 163,
            "category_id": 1,
            "subcat": null,
            "name": "contact",
            "picture": null,
            "phone": "5511981002212",
            "email": "",
            "cpf": null,
            "address": null,
            "gender": null,
            "type": "user",
            "channel_id": 177,
            "user_id": 281,
            "portfolio_user_id": 281,
            "chat_read": 1,
            "status": 1,
            "origin": "o",
            "count_messages": 0,
            "data": null,
            "timestamp": null,
            "created_at": "2018-08-31 17:44:18",
            "updated_at": "2018-08-31 17:47:20"
        },
        {
            "id": 27,
            "customer_id": 163,
            "category_id": 1,
            "subcat": null,
            "name": "contact",
            "picture": null,
            "phone": "55119810022123",
            "email": "",
            "cpf": null,
            "address": null,
            "gender": null,
            "type": "user",
            "channel_id": 177,
            "user_id": 281,
            "portfolio_user_id": 281,
            "chat_read": 1,
            "status": 1,
            "origin": "o",
            "count_messages": 0,
            "data": null,
            "timestamp": null,
            "created_at": "2018-08-31 17:44:30",
            "updated_at": "2018-08-31 17:44:30"
        },
        {
            "id": 31,
            "customer_id": 163,
            "category_id": 1,
            "subcat": null,
            "name": "contact",
            "picture": null,
            "phone": "551198100222",
            "email": "",
            "cpf": null,
            "address": null,
            "gender": null,
            "type": "user",
            "channel_id": 179,
            "user_id": 282,
            "portfolio_user_id": 282,
            "chat_read": 1,
            "status": 1,
            "origin": "o",
            "count_messages": 0,
            "data": null,
            "timestamp": null,
            "created_at": "2018-09-03 12:14:37",
            "updated_at": "2018-09-03 12:14:37"
        },
        {
            "id": 29,
            "customer_id": 163,
            "category_id": 1,
            "subcat": null,
            "name": "contact",
            "picture": null,
            "phone": "5511981002222",
            "email": "",
            "cpf": null,
            "address": null,
            "gender": null,
            "type": "user",
            "channel_id": 177,
            "user_id": 281,
            "portfolio_user_id": 281,
            "chat_read": 1,
            "status": 1,
            "origin": "o",
            "count_messages": 0,
            "data": null,
            "timestamp": null,
            "created_at": "2018-08-31 17:48:25",
            "updated_at": "2018-09-03 12:10:56"
        },
        {
            "id": 30,
            "customer_id": 163,
            "category_id": 1,
            "subcat": null,
            "name": "contact",
            "picture": null,
            "phone": "55119810022226",
            "email": "",
            "cpf": null,
            "address": null,
            "gender": null,
            "type": "user",
            "channel_id": 177,
            "user_id": 282,
            "portfolio_user_id": 282,
            "chat_read": 1,
            "status": 1,
            "origin": "o",
            "count_messages": 0,
            "data": null,
            "timestamp": null,
            "created_at": "2018-08-31 17:49:45",
            "updated_at": "2018-09-03 12:09:38"
        },
        {
            "id": 32,
            "customer_id": 163,
            "category_id": 1,
            "subcat": null,
            "name": "contact",
            "picture": null,
            "phone": "5511981002244",
            "email": "",
            "cpf": null,
            "address": null,
            "gender": null,
            "type": "user",
            "channel_id": 179,
            "user_id": 282,
            "portfolio_user_id": 282,
            "chat_read": 1,
            "status": 1,
            "origin": "o",
            "count_messages": 0,
            "data": null,
            "timestamp": null,
            "created_at": "2018-09-03 12:20:00",
            "updated_at": "2018-09-03 12:20:49"
        },
        {
            "id": 23,
            "customer_id": 163,
            "category_id": 1,
            "subcat": null,
            "name": "contact",
            "picture": null,
            "phone": "5511981003",
            "email": "",
            "cpf": null,
            "address": null,
            "gender": null,
            "type": "user",
            "channel_id": 177,
            "user_id": 281,
            "portfolio_user_id": 281,
            "chat_read": 1,
            "status": 1,
            "origin": "o",
            "count_messages": 0,
            "data": null,
            "timestamp": null,
            "created_at": "2018-08-31 17:39:51",
            "updated_at": "2018-08-31 17:39:51"
        },
        {
            "id": 22,
            "customer_id": 163,
            "category_id": 1,
            "subcat": null,
            "name": "contact",
            "picture": null,
            "phone": "5511981003312",
            "email": "",
            "cpf": null,
            "address": null,
            "gender": null,
            "type": "user",
            "channel_id": 177,
            "user_id": 281,
            "portfolio_user_id": 281,
            "chat_read": 1,
            "status": 1,
            "origin": "i",
            "count_messages": 0,
            "data": null,
            "timestamp": null,
            "created_at": "2018-08-31 16:49:47",
            "updated_at": "2018-08-31 17:31:58"
        },
        {
            "id": 21,
            "customer_id": 163,
            "category_id": 1,
            "subcat": null,
            "name": "contact",
            "picture": null,
            "phone": "551198100333",
            "email": "",
            "cpf": null,
            "address": null,
            "gender": null,
            "type": "user",
            "channel_id": 177,
            "user_id": null,
            "portfolio_user_id": 281,
            "chat_read": 1,
            "status": 1,
            "origin": "i",
            "count_messages": 0,
            "data": null,
            "timestamp": null,
            "created_at": "2018-08-31 16:48:44",
            "updated_at": "2018-08-31 16:48:44"
        },
        {
            "id": 20,
            "customer_id": 163,
            "category_id": 1,
            "subcat": null,
            "name": "contact",
            "picture": null,
            "phone": "55119810033330",
            "email": "",
            "cpf": null,
            "address": null,
            "gender": null,
            "type": "user",
            "channel_id": 177,
            "user_id": null,
            "portfolio_user_id": 281,
            "chat_read": 1,
            "status": 1,
            "origin": "i",
            "count_messages": 0,
            "data": null,
            "timestamp": null,
            "created_at": "2018-08-31 16:36:02",
            "updated_at": "2018-08-31 16:48:11"
        },
        {
            "id": 19,
            "customer_id": 163,
            "category_id": 1,
            "subcat": null,
            "name": "contact",
            "picture": null,
            "phone": "551198100333300",
            "email": "",
            "cpf": null,
            "address": null,
            "gender": null,
            "type": "user",
            "channel_id": 177,
            "user_id": 282,
            "portfolio_user_id": 281,
            "chat_read": 1,
            "status": 1,
            "origin": "i",
            "count_messages": 0,
            "data": null,
            "timestamp": null,
            "created_at": "2018-08-31 16:35:03",
            "updated_at": "2018-08-31 16:45:36"
        },
        {
            "id": 18,
            "customer_id": 163,
            "category_id": 1,
            "subcat": null,
            "name": "contact",
            "picture": null,
            "phone": "55119810033330092",
            "email": "",
            "cpf": null,
            "address": null,
            "gender": null,
            "type": "user",
            "channel_id": 177,
            "user_id": 281,
            "portfolio_user_id": 281,
            "chat_read": 1,
            "status": 1,
            "origin": "i",
            "count_messages": 0,
            "data": null,
            "timestamp": null,
            "created_at": "2018-08-31 16:24:39",
            "updated_at": "2018-08-31 16:34:00"
        },
        {
            "id": 17,
            "customer_id": 163,
            "category_id": 1,
            "subcat": null,
            "name": "contact",
            "picture": null,
            "phone": "55119810033330098",
            "email": "",
            "cpf": null,
            "address": null,
            "gender": null,
            "type": "user",
            "channel_id": 177,
            "user_id": null,
            "portfolio_user_id": 281,
            "chat_read": 1,
            "status": 1,
            "origin": "i",
            "count_messages": 0,
            "data": null,
            "timestamp": null,
            "created_at": "2018-08-31 16:24:12",
            "updated_at": "2018-08-31 16:24:12"
        },
        {
            "id": 16,
            "customer_id": 163,
            "category_id": 1,
            "subcat": null,
            "name": "contact",
            "picture": null,
            "phone": "551198100333300987",
            "email": "",
            "cpf": null,
            "address": null,
            "gender": null,
            "type": "user",
            "channel_id": 177,
            "user_id": null,
            "portfolio_user_id": 281,
            "chat_read": 1,
            "status": 1,
            "origin": "i",
            "count_messages": 0,
            "data": null,
            "timestamp": null,
            "created_at": "2018-08-31 16:15:56",
            "updated_at": "2018-08-31 16:16:09"
        },
        {
            "id": 13,
            "customer_id": 163,
            "category_id": 1,
            "subcat": null,
            "name": "contact",
            "picture": null,
            "phone": "551198100333305634567",
            "email": "",
            "cpf": null,
            "address": null,
            "gender": null,
            "type": "user",
            "channel_id": 177,
            "user_id": 281,
            "portfolio_user_id": 281,
            "chat_read": 1,
            "status": 1,
            "origin": "i",
            "count_messages": 0,
            "data": null,
            "timestamp": null,
            "created_at": "2018-08-31 16:02:02",
            "updated_at": "2018-08-31 16:08:33"
        },
        {
            "id": 14,
            "customer_id": 163,
            "category_id": 1,
            "subcat": null,
            "name": "contact",
            "picture": null,
            "phone": "5511981003333056345670",
            "email": "",
            "cpf": null,
            "address": null,
            "gender": null,
            "type": "user",
            "channel_id": 177,
            "user_id": 281,
            "portfolio_user_id": 281,
            "chat_read": 1,
            "status": 1,
            "origin": "i",
            "count_messages": 0,
            "data": null,
            "timestamp": null,
            "created_at": "2018-08-31 16:11:15",
            "updated_at": "2018-08-31 16:12:04"
        },
        {
            "id": 15,
            "customer_id": 163,
            "category_id": 1,
            "subcat": null,
            "name": "contact",
            "picture": null,
            "phone": "55119810033330563456709",
            "email": "",
            "cpf": null,
            "address": null,
            "gender": null,
            "type": "user",
            "channel_id": 177,
            "user_id": 281,
            "portfolio_user_id": 281,
            "chat_read": 1,
            "status": 1,
            "origin": "i",
            "count_messages": 0,
            "data": null,
            "timestamp": null,
            "created_at": "2018-08-31 16:12:52",
            "updated_at": "2018-08-31 16:13:45"
        }
    ],
    "first_page_url": "http:\/\/localhost:8000\/api\/v1\/customers\/163\/contacts?page=1",
    "from": 1,
    "last_page": 2,
    "last_page_url": "http:\/\/localhost:8000\/api\/v1\/customers\/163\/contacts?page=2",
    "next_page_url": "http:\/\/localhost:8000\/api\/v1\/customers\/163\/contacts?page=2",
    "path": "http:\/\/localhost:8000\/api\/v1\/customers\/163\/contacts",
    "per_page": 20,
    "prev_page_url": null,
    "to": 20,
    "total": 33
}

showContact

Retorna um contato.

curl -X GET -H "Content-Type: application/x-www-form-urlencoded" -H "Accept: application/json" -H "Authorization: Bearer {{bearer}}" "{{URL}}/api/v1/customers/{{customer}}/contacts/{{contact}}"
GET %7B%7BURL%7D%7D/api/v1/customers/%7B%7Bcustomer%7D%7D/contacts/%7B%7Bcontact%7D%7D HTTP/1.1
Host: 
Content-Type: application/x-www-form-urlencoded
Accept: application/json
Authorization: Bearer {{bearer}}
Status200
Cache-Controlno-cache, private
Connectionclose
Content-Typeapplication/json
DateThu, 20 Sep 2018 17:13:39 +0000
DateThu, 20 Sep 2018 17:13:39 GMT
Hostlocalhost:8000
X-Powered-ByPHP/7.2.8
{
    "id": 1,
    "customer_id": 163,
    "category_id": 1,
    "subcat": null,
    "name": "Nome Fantasia",
    "picture": null,
    "phone": "556281000009",
    "email": "testeapi@teste.com",
    "cpf": "00000000000",
    "address": "Endere\u00e7o xyz",
    "gender": "masculino",
    "type": "user",
    "channel_id": 177,
    "user_id": 1,
    "portfolio_user_id": 281,
    "chat_read": 0,
    "status": 1,
    "origin": "i",
    "count_messages": 0,
    "data": null,
    "timestamp": null,
    "created_at": "2018-08-28 18:03:42",
    "updated_at": "2018-09-19 17:17:17"
}

newContact

Salva um novo contato.

curl -X POST -H "Content-Type: application/x-www-form-urlencoded" -H "Content-Type: application/x-www-form-urlencoded" -H "Accept: application/json" -H "Authorization: Bearer {{bearer}}" -d "phone={{phone}}&email={{email}}&name={{name}}" "{{URL}}/api/v1/customers/{{customer}}/contacts"
POST %7B%7BURL%7D%7D/api/v1/customers/%7B%7Bcustomer%7D%7D/contacts HTTP/1.1
Host: 
Content-Type: application/x-www-form-urlencoded
Accept: application/json
Authorization: Bearer {{bearer}}
Content-Type: application/x-www-form-urlencoded

phone={{phone}}&email={{email}}&name={{name}}
Status200
Cache-Controlno-cache, private
Connectionclose
Content-Typeapplication/json
DateWed, 12 Sep 2018 16:53:51 +0000
DateWed, 12 Sep 2018 16:53:51 GMT
Hostlocalhost:8000
X-Powered-ByPHP/7.2.8
{
    "id": 33,
    "customer_id": 163,
    "category_id": 1,
    "subcat": null,
    "name": "Nome Fantasia",
    "picture": null,
    "phone": "556281000000",
    "email": "testeapi@teste.com",
    "cpf": null,
    "address": null,
    "gender": null,
    "type": null,
    "channel_id": null,
    "user_id": 281,
    "portfolio_user_id": null,
    "chat_read": 0,
    "status": 1,
    "origin": null,
    "count_messages": 0,
    "data": null,
    "timestamp": null,
    "created_at": "2018-09-12 11:44:35",
    "updated_at": "2018-09-12 11:44:35"
}
Status200
Cache-Controlno-cache, private
Connectionclose
Content-Typeapplication/json
DateWed, 12 Sep 2018 17:41:20 +0000
DateWed, 12 Sep 2018 17:41:20 GMT
Hostlocalhost:8000
X-Powered-ByPHP/7.2.8
{
    "id": 1,
    "customer_id": 163,
    "category_id": 1,
    "subcat": null,
    "name": "Nome Fantasia",
    "picture": null,
    "phone": "556281000009",
    "email": "testeapi@teste.com",
    "cpf": "00000000000",
    "address": "Endere\u00e7o xyz",
    "gender": "masculino",
    "type": "user",
    "channel_id": 177,
    "user_id": 1,
    "portfolio_user_id": 281,
    "chat_read": 0,
    "status": 1,
    "origin": "i",
    "count_messages": 0,
    "data": null,
    "timestamp": null,
    "created_at": "2018-08-28 18:03:42",
    "updated_at": "2018-09-12 17:31:25"
}
Status200
Cache-Controlno-cache, private
Connectionclose
Content-Typeapplication/json
DateWed, 12 Sep 2018 17:55:07 +0000
DateWed, 12 Sep 2018 17:55:07 GMT
Hostlocalhost:8000
X-Powered-ByPHP/7.2.8
{
    "id": 1,
    "customer_id": 163,
    "category_id": 1,
    "subcat": null,
    "name": "Nome Fantasia",
    "picture": null,
    "phone": "556281000009",
    "email": "testeapi@teste.com",
    "cpf": "00000000000",
    "address": "Endere\u00e7o xyz",
    "gender": "masculino",
    "type": "user",
    "channel_id": 177,
    "user_id": 1,
    "portfolio_user_id": 281,
    "chat_read": 0,
    "status": 1,
    "origin": "i",
    "count_messages": 0,
    "data": null,
    "timestamp": null,
    "created_at": "2018-08-28 18:03:42",
    "updated_at": "2018-09-12 17:53:43"
}

updateContact

Atualiza um contato já existente.

curl -X PUT -H "Content-Type: application/x-www-form-urlencoded" -H "Content-Type: application/x-www-form-urlencoded" -H "Accept: application/json" -H "Authorization: Bearer {{bearer}}" -d "id={{contact_id}}&phone={{phone}}&email={{email}}&name={{name}}&user_id={{user}}&cpf={{cpf}}&address={{address}}&gender={{gender}}" "{{URL}}/api/v1/customers/{{customer}}/contacts/{{contact}}"
PUT %7B%7BURL%7D%7D/api/v1/customers/%7B%7Bcustomer%7D%7D/contacts/%7B%7Bcontact%7D%7D HTTP/1.1
Host: 
Content-Type: application/x-www-form-urlencoded
Accept: application/json
Authorization: Bearer {{bearer}}
Content-Type: application/x-www-form-urlencoded

id={{contact_id}}&phone={{phone}}&email={{email}}&name={{name}}&user_id={{user}}&cpf={{cpf}}&address={{address}}&gender={{gender}}
Status200
Cache-Controlno-cache, private
Connectionclose
Content-Typeapplication/json
DateWed, 12 Sep 2018 17:55:27 +0000
DateWed, 12 Sep 2018 17:55:27 GMT
Hostlocalhost:8000
X-Powered-ByPHP/7.2.8
{
    "id": 1,
    "customer_id": 163,
    "category_id": 1,
    "subcat": null,
    "name": "Nome Fantasia",
    "picture": null,
    "phone": "556281000009",
    "email": "testeapi@teste.com",
    "cpf": "00000000000",
    "address": "Endere\u00e7o xyz",
    "gender": "masculino",
    "type": "user",
    "channel_id": 177,
    "user_id": "1",
    "portfolio_user_id": 281,
    "chat_read": 0,
    "status": 1,
    "origin": "i",
    "count_messages": 0,
    "data": null,
    "timestamp": null,
    "created_at": "2018-08-28 18:03:42",
    "updated_at": "2018-09-12 17:53:43"
}
Status200
Cache-Controlno-cache, private
Connectionclose
Content-Typeapplication/json
DateWed, 12 Sep 2018 17:42:08 +0000
DateWed, 12 Sep 2018 17:42:08 GMT
Hostlocalhost:8000
X-Powered-ByPHP/7.2.8
{
    "id": 1,
    "customer_id": 163,
    "category_id": 1,
    "subcat": null,
    "name": "Nome Fantasia",
    "picture": null,
    "phone": "556281000009",
    "email": "testeapi@teste.com",
    "cpf": "00000000000",
    "address": "Endere\u00e7o xyz",
    "gender": "masculino",
    "type": "user",
    "channel_id": 177,
    "user_id": "1",
    "portfolio_user_id": 281,
    "chat_read": 0,
    "status": 1,
    "origin": "i",
    "count_messages": 0,
    "data": null,
    "timestamp": null,
    "created_at": "2018-08-28 18:03:42",
    "updated_at": "2018-09-12 17:31:25"
}

redirectContact

Redireciona um contato para outro operador.

curl -X POST -H "Content-Type: application/x-www-form-urlencoded" -H "Content-Type: application/x-www-form-urlencoded" -H "Accept: application/json" -H "Authorization: Bearer {{bearer}}" -d "user_id={{user}}" "{{URL}}/api/v1/customers/{{customer}}/contacts/redirect/contacts/{{contact}}"
POST %7B%7BURL%7D%7D/api/v1/customers/%7B%7Bcustomer%7D%7D/contacts/redirect/contacts/%7B%7Bcontact%7D%7D HTTP/1.1
Host: 
Content-Type: application/x-www-form-urlencoded
Accept: application/json
Authorization: Bearer {{bearer}}
Content-Type: application/x-www-form-urlencoded

user_id={{user}}
Status200
Cache-Controlno-cache, private
Connectionclose
Content-Typeapplication/json
DateMon, 17 Sep 2018 12:29:46 +0000
DateMon, 17 Sep 2018 12:29:46 GMT
Hostlocalhost:8000
X-Powered-ByPHP/7.2.8
{
    "customer_id": 163,
    "channel_id": 177,
    "contact_id": 1,
    "origin_id": 1,
    "type": 2,
    "updated_at": "2018-09-17 12:29:46",
    "created_at": "2018-09-17 12:29:46",
    "id": 33337
}

openContactChat

Inicia um chat com o contato.

curl -X POST -H "Content-Type: application/x-www-form-urlencoded" -H "Content-Type: application/x-www-form-urlencoded" -H "Accept: application/json" -H "Authorization: Bearer {{bearer}}" "{{URL}}/api/v1/customers/{{customer}}/contacts/{{contact}}/open"
POST %7B%7BURL%7D%7D/api/v1/customers/%7B%7Bcustomer%7D%7D/contacts/%7B%7Bcontact%7D%7D/open HTTP/1.1
Host: 
Content-Type: application/x-www-form-urlencoded
Accept: application/json
Authorization: Bearer {{bearer}}
Status200
Cache-Controlno-cache, private
Connectionclose
Content-Typeapplication/json
DateWed, 12 Sep 2018 17:43:28 +0000
DateWed, 12 Sep 2018 17:43:28 GMT
Hostlocalhost:8000
X-Powered-ByPHP/7.2.8
{
    "id": 1,
    "customer_id": 163,
    "category_id": 1,
    "subcat": null,
    "name": "Nome Fantasia",
    "picture": null,
    "phone": "556281000009",
    "email": "testeapi@teste.com",
    "cpf": "00000000000",
    "address": "Endere\u00e7o xyz",
    "gender": "masculino",
    "type": "user",
    "channel_id": 177,
    "user_id": 1,
    "portfolio_user_id": 281,
    "chat_read": 0,
    "status": 1,
    "origin": "i",
    "count_messages": 0,
    "data": null,
    "timestamp": null,
    "created_at": "2018-08-28 18:03:42",
    "updated_at": "2018-09-12 17:31:25"
}

closeContactChat

Finaliza o chat com o contato.

curl -X POST -H "Content-Type: application/x-www-form-urlencoded" -H "Content-Type: application/x-www-form-urlencoded" -H "Accept: application/json" -H "Authorization: Bearer {{bearer}}" "{{URL}}/api/v1/customers/{{customer}}/contacts/{{contact}}/close"
POST %7B%7BURL%7D%7D/api/v1/customers/%7B%7Bcustomer%7D%7D/contacts/%7B%7Bcontact%7D%7D/close HTTP/1.1
Host: 
Content-Type: application/x-www-form-urlencoded
Accept: application/json
Authorization: Bearer {{bearer}}
Status200
Cache-Controlno-cache, private
Connectionclose
Content-Typeapplication/json
DateWed, 12 Sep 2018 17:56:40 +0000
DateWed, 12 Sep 2018 17:56:40 GMT
Hostlocalhost:8000
X-Powered-ByPHP/7.2.8
{
    "id": 1,
    "customer_id": 163,
    "category_id": 1,
    "subcat": null,
    "name": "Nome Fantasia",
    "picture": null,
    "phone": "556281000009",
    "email": "testeapi@teste.com",
    "cpf": "00000000000",
    "address": "Endere\u00e7o xyz",
    "gender": "masculino",
    "type": "user",
    "channel_id": 177,
    "user_id": 1,
    "portfolio_user_id": 281,
    "chat_read": 0,
    "status": 0,
    "origin": "i",
    "count_messages": 0,
    "data": null,
    "timestamp": null,
    "created_at": "2018-08-28 18:03:42",
    "updated_at": "2018-09-12 17:56:40"
}

Messages

Envio e recebimento de mensagens.

sendWhatsappMessage

Envia uma mensagem de whatsapp de um usuário para um contato através de um canal.

curl -X POST -H "Content-Type: application/x-www-form-urlencoded" -H "Content-Type: application/x-www-form-urlencoded" -H "Accept: application/json" -H "Authorization: Bearer {{bearer}}" -d "usermsg=Mensagem teste" "{{URL}}/api/v1/customers/{{customer}}/whatsapp/send_text/channels/{{channel}}/contacts/{{contact}}/users/{{user}}"
POST %7B%7BURL%7D%7D/api/v1/customers/%7B%7Bcustomer%7D%7D/whatsapp/send_text/channels/%7B%7Bchannel%7D%7D/contacts/%7B%7Bcontact%7D%7D/users/%7B%7Buser%7D%7D HTTP/1.1
Host: 
Content-Type: application/x-www-form-urlencoded
Accept: application/json
Authorization: Bearer {{bearer}}
Content-Type: application/x-www-form-urlencoded

usermsg=Mensagem teste
Status200
Acceptapplication/json
Connectionclose
Content-Typeapplication/json
DateTue, 18 Sep 2018 18:01:37 +0000
Hostlocalhost:8000
X-Powered-ByPHP/7.2.8
{
    "send": false,
    "http_code": 403,
    "success": true,
    "message_cuid": "s----msg-1537293694-393"
}