Para poder utilizar a API do Callwe, é necessário primeiro Gerar um Token.
Esta API deve ser utilizada para listar todos os ramais habilitados na central.
API URL - Listar todos os ramais: |
/api/v1/extensions |
Method |
GET |
Exemplos de requisição:
Listar todos os ramais:
curl -X GET \
'https://<EMPRESA>.callwe.io/api/v1/extensions' \
-H 'Content-Type: application/json' \
-H 'token: <EVOLUX_TOKEN>'
Retornos da API:
Retorno de sucesso:
{
"meta":{
"status": 200,
"message": "OK"
}, "data":[{
"id": 5,
"name": "Sala de Reuniões",
"number": "9009",
"email": "reunioes@email.com",
"group_name": "Diretoria",
"rules": [
{id: 10, name: "Celular Local"},
{id: 11, name: "Celular DDD"}
] },
{
"id": 15,
"name": "Michael Myers",
"number": "1978",
"email": "michael.myers@email.com",
"group_name": "Psiquiatria",
"rules": [
{id: 12, name: "Fixo Local"},
{id: 13, name: "Fixo DDD"}
]
},
{
"id": 13,
"name": "Jason Voorhees",
"number": "613",
"email": "jason.voorhees@email.com",
"group_name": "TGIF",
"rules": [
{id: 10, name: "Celular Local"},
{id: 12, name: "Fixo Local"}
]
},
{
"id": 7,
"name": "Samara Morgan",
"number": "7777",
"email": "samara.morgan@email.com",
"group_name": "Ring",
"rules": [
{id: 11, name: "Celular DDD"},
{id: 13, name: "Fixo DDD"}
]
}
],
"pagination": {
"max_limit": 100,
"limit": 1,
"first_url": "https://endereco/api/v1/extensions",
"next_url": null,
"items": 1,
"last_url": "https://endereco/api/v1/extensions?page=1",
"total": 2,
"current_url": "https://endereco/api/v1/extensions?page=1",
"prev_url": null
}
}
Retorno de erro:
{
"meta": {
"status": 404,
"message": "Extension not found."
}
}