Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

S20 KIGI-951 - API para buscar um único operador #1

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
61 changes: 61 additions & 0 deletions docs/operators/get-operator.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
---
id: get-operator
title: Buscar um operador
---

## Método

`GET` https://api.plugchat.com.br/integrator/account/[ID_DA_CONTA]/operator/[ID_DO_OPERADOR]

---

## Conceituação

Neste método você pode buscar somente um operador de uma conta

---

:::caution Sobre a URL da API

Observe que a URL da API é composta pelo id da conta do cliente, o mesmo retornado na criação da conta, isso é necessário para que o Plug Chat busque o operador correto na conta do seu cliente.

:::

## Response

### 200

| Atributos | Tipo | Descrição |
| :---------- | :------------------- | :-------------------------- |
| name | string | Nome do operador |
| id | string | Identificador do operador |
| createdAt | timestamp in seconds | Data de criação do operador |
| active | boolean | Se está ativo ou não |
| accessToken | string | Token de acesso ao chat |

Exemplo

```json
{
"accessToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ8.eyJhY2NvdW50SWQiOiIyMTRkNjk03243205YmU4LTRmM2MtODA1My0xNDAzNTdmMTdhYTUiLCJvcGVyYXRvcklkIjoiOTBkNjNhYTMtMmZiMS00ZTdlLThlM2QtZjJhZTJj23jhuDkwIiwiaWF0IjoxNjU2NDI3MjY1LCJleHAiOjE2ODc5ODQxOTF9.EzoCzs_FZ7Lbuag03g2BHW709jJTZ12tFyv-xj3hiuyb",
"id": "90d63aa3-2fb1-4e7e-8e3d-f2ae2cb23890",
"name": "Operador 001",
"active": true,
"departments": ["421312-41232-412321-412312-412312"],
"createdAt": 1656427265615
}
```

### 405

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.

### 415

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"

---

## Code

<iframe src="//api.apiembed.com/?source=https://raw.githubusercontent.com/fourpixelit/plug-chat-partner-docs/main/json-examples/get-operator.json&targets=all" frameBorder="0" scrolling="no" width="100%" height="500px" seamless></iframe>
9 changes: 9 additions & 0 deletions json-examples/get-operator.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"method": "GET",
"url": "https://api.plugchat.com.br/integrator/account/[ID_DA_CONTA]/operator/[ID_DO_OPERADOR]",
"httpVersion": "HTTP/1.1",
"queryString": [],
"headers": [],
"cookies": [],
"postData": {}
}
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions sidebars.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ module.exports = {
'operators/create-operator',
'operators/list-operator',
'operators/update-operator',
'operators/get-operator',
],
URA: ['ura/introduction', 'ura/config-ura'],
SDK: [
Expand Down