Skip to content

Commit e16b797

Browse files
committed
ler chat
1 parent eb4f17c commit e16b797

File tree

4 files changed

+84
-2
lines changed

4 files changed

+84
-2
lines changed

docs/chats/archive-chat.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@ Exemplo
3434

3535
```json
3636
{
37-
"phone": "5544999999999",
38-
"action": "archive" ou "unarchive"
37+
"phone": "5544999999999",
38+
"action": "archive" ou "unarchive"
3939
}
4040
```
4141

docs/chats/read-chat.md

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
---
2+
id: read-chat
3+
title: Ler chats
4+
---
5+
6+
## Método
7+
8+
#### /modify-chat
9+
10+
`POST` https://api.z-api.io/instances/SUA_INSTANCIA/token/SEU_TOKEN/modify-chat
11+
12+
---
13+
14+
## Conceituação
15+
16+
Este método é reponsavel por realizar a ação de ler um chat como um todo, ou também marcar um chat como não lido
17+
18+
---
19+
20+
## Atributos
21+
22+
### Obrigatórios
23+
24+
| Atributos | Tipo | Descrição |
25+
| :-- | :-: | :-- |
26+
| phone | integer | Número de telefone que você deseja alterar no **SEU** chat |
27+
| action | string | Atributo para marcar o chat (read ou unread)|
28+
29+
---
30+
31+
## Request Body
32+
33+
Exemplo
34+
35+
```json
36+
{
37+
"phone": "5544999999999",
38+
"action": "read" ou "unread"
39+
}
40+
```
41+
42+
---
43+
44+
## Response
45+
46+
### 200
47+
48+
| Atributos | Tipo | Descrição |
49+
| :-------- | :------ | :------------------------------ |
50+
| value | boolean | Atributo de confirmaçaõ da ação |
51+
52+
Exemplo
53+
54+
```json
55+
{
56+
"value": true
57+
}
58+
```
59+
60+
### 405
61+
62+
Neste caso certifique que esteja enviando o corretamente a especificação do método, ou seja verifique se você enviou o POST ou GET conforme especificado no inicio deste tópico.
63+
64+
### 415
65+
66+
Caso você receba um erro 415, certifique de adicionar na headers da requisição o "Content-Type" do objeto que você está enviando, em sua grande maioria "application/json"
67+
68+
---
69+
70+
## Code
71+
72+
<iframe src="//api.apiembed.com/?source=https://raw.githubusercontent.com/Z-API/z-api-docs/main/json-examples/read-chat.json&targets=all" frameborder="0" scrolling="no" width="100%" height="500px" seamless></iframe>

json-examples/read-chat.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"method": "POST",
3+
"url": "https://api.z-api.io/instances/SUA_INSTANCIA/token/SEU_TOKEN/modify-chat",
4+
"httpVersion": "HTTP/1.1",
5+
"postData": {
6+
"mimeType": "application/json",
7+
"text": "{\"phone\": \"5544991515165\", \"action\": \"read / unread*\"}"
8+
}
9+
}

sidebars.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ module.exports = {
7171
'chats/get-chats',
7272
'chats/get-message-chats',
7373
'chats/get-metadata-chat',
74+
'chats/read-chat',
7475
'chats/archive-chat',
7576
'chats/delete-chat',
7677
],

0 commit comments

Comments
 (0)