API Obter Empresas
Estimated reading: 1 minute
237 views
Obter TODAS as empresas da instância.
- É necessário uso do TOKEN de uma conexão do Super Admin
- Apesar de retornar todas as empresas, é necessário colocar o ID no payload
Endpoint GET
https://Erro: valor 'backendurl' não encontrado./api/companies/all
API
Utilize o código em requisições HTTPS com ferramentas como cURL ou bibliotecas de integração.
'https://Erro: valor 'backendurl' não encontrado./companies/all',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'GET',
CURLOPT_POSTFIELDS =>'{
"id":"1"
}',
CURLOPT_HTTPHEADER => array(
'Content-Type: application/json',
'Authorization: Bearer {seutokenaqui}' //Token cadastrado na conexão
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
Retorno de API (Payload de Resposta)
Exemplo de retorno ao obter todas as empresas:
{
"id": 9,
"name": "MeuSorteio",
"phone": "5511999999999",
"namecomplete": "João da Silva",
"pais": "BR",
"indicator": "",
"email": "joao@meudominio.com.br",
"status": true,
"importar": false,
"logar": true,
"blockGroups": false,
"blockRead": false,
"document": "",
"dueDate": "2025-11-04T03:00:00.000Z",
"recurrence": "MENSAL",
"messageCount": "8384",
"typebotUrl": "",
"typebotName": "",
"iframeUser": "",
"iframeUserUrl": "",
"iframeUserB": "",
"iframeUserUrlB": "",
"iframeAdmin": "",
"iframeAdminUrl": "",
"keystorage": "newmongo",
"apiUsada": "baileys",
"useProxy": "noproxy",
"proxyURL": "",
"schedules": [],
"planId": 1,
"excluded": true,
"removido": false,
"createdAt": "2024-11-01T19:58:40.121Z",
"updatedAt": "2025-03-26T12:13:02.186Z",
"plan": {
"id": 1,
"name": "GOLD",
"value": 970
},
"settings": [
{
"id": 548,
"key": "notifyTEXT",
"value": "Existe atendimento aguardando sua atenção na plataforma.",
"companyId": 9,
"createdAt": "2024-11-01T19:58:40.709Z",
"updatedAt": "2024-11-01T19:58:40.709Z"
},
{
"id": 547,
"key": "movingTEXT",
"value": "{{ms}} *{{name}}*, em alguns instantes um atendente irá prosseguir com seu atendimento.",
"companyId": 9,
"createdAt": "2024-11-01T19:58:40.687Z",
"updatedAt": "2024-11-01T19:58:40.687Z"
},
{
"id": 545,
"key": "callTEXT",
"value": "*INFORMAÇÃO* As chamadas de voz e vídeo estão desabilitas para este WhatsApp! Envie uma mensagem de texto ou áudio.",
"companyId": 9,
"createdAt": "2024-11-01T19:58:40.659Z",
"updatedAt": "2024-11-01T19:58:40.659Z"
},
{
"id": 544,
"key": "quitTEXT",
"value": "*Você encerrou este atendimento usando o comando SAIR*",
"companyId": 9,
"createdAt": "2024-11-01T19:58:40.642Z",
"updatedAt": "2024-11-01T19:58:40.642Z"
},
{
"id": 543,
"key": "cantaudioTEXT",
"value": "*INFORMAÇÃO* Infelizmente não é possível enviar ou escutar áudios por este canal de atendimento. Envie uma mensagem de *texto*!",
"companyId": 9,
"createdAt": "2024-11-01T19:58:40.633Z",
"updatedAt": "2024-11-01T19:58:40.633Z"
},
{
"id": 542,
"key": "sendQueuePositionTEXT",
"value": "{{ms}} *{{name}}*, sua posição na fila de atendimento é:",
"companyId": 9,
"createdAt": "2024-11-01T19:58:40.622Z",
"updatedAt": "2024-11-01T19:58:40.622Z"
},
{
"id": 540,
"key": "tempofila",
"value": "10",
"companyId": 9,
"createdAt": "2024-11-01T19:58:40.607Z",
"updatedAt": "2024-11-01T19:58:40.607Z"
},
{
"id": 539,
"key": "idfila",
"value": "0",
"companyId": 9,
"createdAt": "2024-11-01T19:58:40.600Z",
"updatedAt": "2024-11-01T19:58:40.600Z"
},
{
"id": 538,
"key": "moveQueue",
"value": "disabled",
"companyId": 9,
"createdAt": "2024-11-01T19:58:40.588Z",
"updatedAt": "2024-11-01T19:58:40.588Z"
},
{
"id": 537,
"key": "viewppw",
"value": "enabled",
"companyId": 9,
"createdAt": "2024-11-01T19:58:40.582Z",
"updatedAt": "2024-11-01T19:58:40.582Z"
},
{
"id": 536,
"key": "viewnoti",
"value": "disabled",
"companyId": 9,
"createdAt": "2024-11-01T19:58:40.576Z",
"updatedAt": "2024-11-01T19:58:40.576Z"
},
{
"id": 535,
"key": "viewgroups",
"value": "enabled",
"companyId": 9,
"createdAt": "2024-11-01T19:58:40.571Z",
"updatedAt": "2024-11-01T19:58:40.571Z"
},
{
"id": 534,
"key": "viewclosednew",
"value": "enabled",
"companyId": 9,
"createdAt": "2024-11-01T19:58:40.566Z",
"updatedAt": "2024-11-01T19:58:40.566Z"
},
{
"id": 533,
"key": "viewclosed",
"value": "disabled",
"companyId": 9,
"createdAt": "2024-11-01T19:58:40.529Z",
"updatedAt": "2024-11-01T19:58:40.529Z"
},
{
"id": 532,
"key": "sendQueuePosition",
"value": "enabled",
"companyId": 9,
"createdAt": "2024-11-01T19:58:40.494Z",
"updatedAt": "2024-11-01T19:58:40.494Z"
},
{
"id": 531,
"key": "sendGreetingMessageOneQueues",
"value": "enabled",
"companyId": 9,
"createdAt": "2024-11-01T19:58:40.485Z",
"updatedAt": "2024-11-01T19:58:40.485Z"
},
{
"id": 530,
"key": "sendSignMessage",
"value": "enabled",
"companyId": 9,
"createdAt": "2024-11-01T19:58:40.462Z",
"updatedAt": "2024-11-01T19:58:40.462Z"
},
{
"id": 529,
"key": "sendFarewellWaitingTicket",
"value": "disabled",
"companyId": 9,
"createdAt": "2024-11-01T19:58:40.451Z",
"updatedAt": "2024-11-01T19:58:40.451Z"
},
{
"id": 528,
"key": "sendTransferAlert",
"value": "disabled",
"companyId": 9,
"createdAt": "2024-11-01T19:58:40.442Z",
"updatedAt": "2024-11-01T19:58:40.442Z"
},
{
"id": 527,
"key": "sendGreetingAccepted",
"value": "disabled",
"companyId": 9,
"createdAt": "2024-11-01T19:58:40.427Z",
"updatedAt": "2024-11-01T19:58:40.427Z"
},
{
"id": 526,
"key": "outsidemessage",
"value": "disabled",
"companyId": 9,
"createdAt": "2024-11-01T19:58:40.417Z",
"updatedAt": "2024-11-01T19:58:40.417Z"
},
{
"id": 524,
"key": "userRatingOut",
"value": "disabled",
"companyId": 9,
"createdAt": "2024-11-01T19:58:40.393Z",
"updatedAt": "2024-11-01T19:58:40.393Z"
},
{
"id": 523,
"key": "userRating",
"value": "disabled",
"companyId": 9,
"createdAt": "2024-11-01T19:58:40.387Z",
"updatedAt": "2024-11-01T19:58:40.387Z"
},
{
"id": 522,
"key": "scheduleType",
"value": "disabled",
"companyId": 9,
"createdAt": "2024-11-01T19:58:40.376Z",
"updatedAt": "2024-11-01T19:58:40.376Z"
},
{
"id": 521,
"key": "call",
"value": "disabled",
"companyId": 9,
"createdAt": "2024-11-01T19:58:40.354Z",
"updatedAt": "2024-11-01T19:58:40.354Z"
},
{
"id": 520,
"key": "enabled",
"value": "",
"companyId": 9,
"createdAt": "2024-11-01T19:58:40.330Z",
"updatedAt": "2024-11-01T19:58:40.330Z"
},
{
"id": 519,
"key": "clientidmkauth",
"value": "",
"companyId": 9,
"createdAt": "2024-11-01T19:58:40.322Z",
"updatedAt": "2024-11-01T19:58:40.322Z"
},
{
"id": 518,
"key": "clientsecretmkauth",
"value": "",
"companyId": 9,
"createdAt": "2024-11-01T19:58:40.297Z",
"updatedAt": "2024-11-01T19:58:40.297Z"
},
{
"id": 517,
"key": "ipmkauth",
"value": "",
"companyId": 9,
"createdAt": "2024-11-01T19:58:40.286Z",
"updatedAt": "2024-11-01T19:58:40.286Z"
},
{
"id": 577,
"key": "openaitoken",
"value": "sk-proj-X3joH1ewqeqeq_WlIh4PaRzjkUBFy2zZFu2Sqcf4j5xnkGjjO-zQEaT3BlbkFJy1ow1Krp0XwvNeru4vpgdgdjdteKiekOsnMUA",
"companyId": 9,
"createdAt": "2024-11-09T14:26:56.050Z",
"updatedAt": "2024-11-16T19:34:58.855Z"
},
{
"id": 516,
"key": "ipixc",
"value": "",
"companyId": 9,
"createdAt": "2024-11-01T19:58:40.281Z",
"updatedAt": "2024-11-01T19:58:40.281Z"
},
{
"id": 515,
"key": "tokenixc",
"value": "",
"companyId": 9,
"createdAt": "2024-11-01T19:58:40.271Z",
"updatedAt": "2024-11-01T19:58:40.271Z"
},
{
"id": 514,
"key": "asaas",
"value": "",
"companyId": 9,
"createdAt": "2024-11-01T19:58:40.235Z",
"updatedAt": "2024-11-01T19:58:40.235Z"
},
{
"id": 576,
"key": "atraso",
"value": "10",
"companyId": 9,
"createdAt": "2024-11-06T17:05:43.921Z",
"updatedAt": "2024-11-06T17:05:43.931Z"
},
{
"id": 575,
"key": "viewwhisper",
"value": "enabled",
"companyId": 9,
"createdAt": "2024-11-06T17:05:39.894Z",
"updatedAt": "2024-11-06T17:05:39.894Z"
},
{
"id": 574,
"key": "mostrarlogs",
"value": "disabled",
"companyId": 9,
"createdAt": "2024-11-06T17:05:34.311Z",
"updatedAt": "2024-11-06T17:05:34.311Z"
},
{
"id": 573,
"key": "carteiraself",
"value": "disabled",
"companyId": 9,
"createdAt": "2024-11-06T17:04:41.799Z",
"updatedAt": "2024-11-06T17:04:41.799Z"
},
{
"id": 578,
"key": "openaimodel",
"value": "whisper-1",
"companyId": 9,
"createdAt": "2024-11-09T14:26:58.575Z",
"updatedAt": "2024-11-09T14:27:00.395Z"
},
{
"id": 579,
"key": "openailang",
"value": "pt",
"companyId": 9,
"createdAt": "2024-11-09T14:27:03.762Z",
"updatedAt": "2024-11-09T14:27:03.870Z"
},
{
"id": 555,
"key": "modosomchat",
"value": "alertSound5",
"companyId": 9,
"createdAt": "2024-11-01T19:58:40.770Z",
"updatedAt": "2024-11-11T13:13:13.376Z"
},
{
"id": 558,
"key": "modosenha",
"value": "both",
"companyId": 9,
"createdAt": "2024-11-01T19:58:40.797Z",
"updatedAt": "2024-11-06T17:03:18.923Z"
},
{
"id": 550,
"key": "changetab",
"value": "disabled",
"companyId": 9,
"createdAt": "2024-11-01T19:58:40.730Z",
"updatedAt": "2024-11-06T17:03:13.907Z"
},
{
"id": 546,
"key": "transferTEXT",
"value": "",
"companyId": 9,
"createdAt": "2024-11-01T19:58:40.676Z",
"updatedAt": "2024-11-06T17:02:20.590Z"
},
{
"id": 541,
"key": "sendGreetingAcceptedTEXT",
"value": "{{ms}} *{{name}}*, meu nome é *{{user}}* e darei continuidade em seu atendimento.",
"companyId": 9,
"createdAt": "2024-11-01T19:58:40.617Z",
"updatedAt": "2024-11-06T17:02:15.821Z"
},
{
"id": 525,
"key": "chatBotType",
"value": "list",
"companyId": 9,
"createdAt": "2024-11-01T19:58:40.401Z",
"updatedAt": "2024-11-06T17:01:55.205Z"
},
{
"id": 572,
"key": "campaignsEnabled",
"value": "false",
"companyId": 9,
"createdAt": "2024-11-01T19:58:40.934Z",
"updatedAt": "2024-11-01T19:58:40.934Z"
},
{
"id": 571,
"key": "bloquearaudio",
"value": "disabled",
"companyId": 9,
"createdAt": "2024-11-01T19:58:40.923Z",
"updatedAt": "2024-11-01T19:58:40.923Z"
},
{
"id": 570,
"key": "mostrartodos",
"value": "enabled",
"companyId": 9,
"createdAt": "2024-11-01T19:58:40.917Z",
"updatedAt": "2024-11-01T19:58:40.917Z"
},
{
"id": 569,
"key": "validarcontato",
"value": "enabled",
"companyId": 9,
"createdAt": "2024-11-01T19:58:40.911Z",
"updatedAt": "2024-11-01T19:58:40.911Z"
},
{
"id": 568,
"key": "repetindo",
"value": "0",
"companyId": 9,
"createdAt": "2024-11-01T19:58:40.906Z",
"updatedAt": "2024-11-01T19:58:40.906Z"
},
{
"id": 567,
"key": "userespia",
"value": "enabled",
"companyId": 9,
"createdAt": "2024-11-01T19:58:40.888Z",
"updatedAt": "2024-11-01T19:58:40.888Z"
},
{
"id": 566,
"key": "versetor",
"value": "enabled",
"companyId": 9,
"createdAt": "2024-11-01T19:58:40.883Z",
"updatedAt": "2024-11-01T19:58:40.883Z"
},
{
"id": 565,
"key": "chatinterno",
"value": "enabled",
"companyId": 9,
"createdAt": "2024-11-01T19:58:40.878Z",
"updatedAt": "2024-11-01T19:58:40.878Z"
},
{
"id": 564,
"key": "carteiraOPEN",
"value": "disabled",
"companyId": 9,
"createdAt": "2024-11-01T19:58:40.872Z",
"updatedAt": "2024-11-01T19:58:40.872Z"
},
{
"id": 563,
"key": "carteira",
"value": "disabled",
"companyId": 9,
"createdAt": "2024-11-01T19:58:40.866Z",
"updatedAt": "2024-11-01T19:58:40.866Z"
},
{
"id": 562,
"key": "idiomaBot",
"value": "br",
"companyId": 9,
"createdAt": "2024-11-01T19:58:40.859Z",
"updatedAt": "2024-11-01T19:58:40.859Z"
},
{
"id": 561,
"key": "modoconexao",
"value": "disabled",
"companyId": 9,
"createdAt": "2024-11-01T19:58:40.851Z",
"updatedAt": "2024-11-01T19:58:40.851Z"
},
{
"id": 560,
"key": "modotransferencia",
"value": "disabled",
"companyId": 9,
"createdAt": "2024-11-01T19:58:40.839Z",
"updatedAt": "2024-11-01T19:58:40.839Z"
},
{
"id": 559,
"key": "modoroteador",
"value": "online",
"companyId": 9,
"createdAt": "2024-11-01T19:58:40.823Z",
"updatedAt": "2024-11-01T19:58:40.823Z"
},
{
"id": 557,
"key": "modosomnoti",
"value": "off",
"companyId": 9,
"createdAt": "2024-11-01T19:58:40.784Z",
"updatedAt": "2024-11-01T19:58:40.784Z"
},
{
"id": 556,
"key": "modosomgrupo",
"value": "alertSound1",
"companyId": 9,
"createdAt": "2024-11-01T19:58:40.776Z",
"updatedAt": "2024-11-01T19:58:40.776Z"
},
{
"id": 554,
"key": "backgroundPages",
"value": "linear-gradient(to right, #3c6afb , #3c6afb , #C5AEF2)",
"companyId": 9,
"createdAt": "2024-11-01T19:58:40.765Z",
"updatedAt": "2024-11-01T19:58:40.765Z"
},
{
"id": 553,
"key": "toolbarBackground",
"value": "#4a90e2",
"companyId": 9,
"createdAt": "2024-11-01T19:58:40.760Z",
"updatedAt": "2024-11-01T19:58:40.760Z"
},
{
"id": 552,
"key": "scrollbarColor",
"value": "#4a90e2",
"companyId": 9,
"createdAt": "2024-11-01T19:58:40.752Z",
"updatedAt": "2024-11-01T19:58:40.752Z"
},
{
"id": 551,
"key": "mainColor",
"value": "#4a90e2",
"companyId": 9,
"createdAt": "2024-11-01T19:58:40.744Z",
"updatedAt": "2024-11-01T19:58:40.744Z"
},
{
"id": 549,
"key": "outsidequeue",
"value": "disabled",
"companyId": 9,
"createdAt": "2024-11-01T19:58:40.721Z",
"updatedAt": "2024-11-01T19:58:40.721Z"
}
],
"whatsapps": [
{
"id": 13,
"name": "MeuSorteio",
"number": "5511999999999",
"status": "CONNECTED",
"plugged": null,
"battery": null,
"removido": false
},
{
"id": 21,
"name": "oioi_1740075145302_REMOVIDO",
"number": "",
"status": "DISCONNECTED",
"plugged": null,
"battery": null,
"removido": true
}
]
},
{ ... repete para cada empresa existente ... }
Caso sua conexão não seja um Super Admin
{
"error": "Você não tem permissão para acessar este recurso!"
}