Este documento relaciona a documentação referente à utilização da API Maxbot. A API Maxbot permite integração do Maxbot com sistemas externos como RPs e CRMs. A API permite fazer o download dos dados dos contatos, protocolos, diálogo do protocolo, bem como o disparo de mensagens de texto, imagem, arquivo e áudio.
Para ativar a API Maxbot faça o login em sua conta Maxbot e vá para Configuração/API Maxbot. Clique no botão de ativação. Um token de identificação da conta será gerado e a API será ativada para a sua conta. Caso precise gerar um novo token de identificação, clique no botão Gerar Novo Token. O token informado na tela será o token de identificação de conta que será usado na validação de comunicação com a API Maxbot.
A API (sigla em inglês para Interface de Programação de Aplicativos) é um conjunto de rotinas e padrões de programação para acesso a um aplicativo de software ou plataforma baseado na Web. A plataforma Maxbot oferece uma API REST de comunicação que permite a integração do Maxbot com sistemas externos, possibilitando:
A documentação está organizada de forma a apresentar de maneira sucinta as orientações técnicas necessárias para a integração. Os exemplos operacionais estão disponíveis na linguagem PHP 7.3 que servem de modelo de entendimento de como a integração externa com o Maxbot pode ser feita. Ela deve ser adaptada conforme a necessidade.
Utilize a requisição de inclusão de uma nova segmentação no Contato Maxbot, para adcionar uma segmentação ao Contato Maxbot.
{
"token": "xxxx",
"cmd": "add_contact_segmentation",
"segmentation_ids": "113, 211",
"contact_id": "1155",
}
{
"status": 1,
"msg": "Success",
}
Este exemplo funcional em PHP 7.3 executa um post para a API e apresenta o retorno na tela para validação. Modifique o código para se adequar às suas necessidades. Para outras linguagens, adapte o código de acordo.
<?php
header('Content-Type: text/html; charset=utf-8');
# Parametros
$_TOKEN = 'xxxxxx';
$_CMD = 'add_contact_segmentation';
$_SEGMENTATION_ID = '123';
$_ID_CONTACT = '1155';
# URL
$_URL = 'https://app.maxbot.com.br/api/v1.php';
# START
$_TXT = "[POST]:<br/><br/>";
$_TXT .= " API_URL => ".$_URL."<br/>";
$_TXT .= " token => ".$_TOKEN."<br/>";
$_TXT .= " cmd => ".$_CMD."<br/>";
$_TXT .= " segmentation_ids => ".$_SEGMENTATION_ID."<br/>";
$_TXT .= " contact_id => ".$_ID_CONTACT."<br/>";
$_TXT .= "<br/>";
$_TXT .= "[retorno]:<br/><br/>";
$_TXT .= "<textarea rows=10 cols=90>";
echo $_TXT;
# Request API
$_REQUEST = array(
"token" => "$_TOKEN",
"cmd" => "$_CMD",
"segmentation_ids" => "$_SEGMENTATION_ID",
"contact_id" => "$_ID_CONTACT",
);
$json = json_encode($_REQUEST);
$ch = curl_init($_URL);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
curl_setopt($ch, CURLOPT_POSTFIELDS, $json);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Content-Type: application/json',
'Content-Length: ' . strlen($json))
);
$_result = curl_exec($ch);
curl_close($ch);
echo $_result;
echo "</textarea>";
exit;
?>
Utilize a requisição de criação de Segmentação no Maxbot, para criar uma nova Segmentação no maxbot.
{
"token": "xxxx",
"cmd": "add_segmentation",
"segmentation_name": "Texto Segmentação, Texto Segmentação 2",
"type": "0",
}
{
"status": 1,
"msg": "Success",
"seg_id": "1",
}
Este exemplo funcional em PHP 7.3 executa um post para a API e apresenta o retorno na tela para validação. Modifique o código para se adequar às suas necessidades. Para outras linguagens, adapte o código de acordo.
<?php
header('Content-Type: text/html; charset=utf-8');
# Parametros
$_TOKEN = 'xxxxxx';
$_CMD = 'add_segmentation';
$_SEGMENTATION_NAME = 'teste segmentação';
$_TYPE = '0';
# URL
$_URL = 'https://app.maxbot.com.br/api/v1.php';
# START
$_TXT = "[POST]:<br/><br/>";
$_TXT .= " API_URL => ".$_URL."<br/>";
$_TXT .= " token => ".$_TOKEN."<br/>";
$_TXT .= " cmd => ".$_CMD."<br/>";
$_TXT .= " segmentation_name => ".$_SEGMENTATION_NAME."<br/>";
$_TXT .= " type => ".$_TYPE."<br/>";
$_TXT .= "<br/>";
$_TXT .= "[retorno]:<br/><br/>";
$_TXT .= "<textarea rows=10 cols=90>";
echo $_TXT;
# Request API
$_REQUEST = array(
"token" => "$_TOKEN",
"cmd" => "$_CMD",
"segmentation_name" => "$_SEGMENTATION_NAME",
"type" => "$_TYPE",
);
$json = json_encode($_REQUEST);
$ch = curl_init($_URL);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
curl_setopt($ch, CURLOPT_POSTFIELDS, $json);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Content-Type: application/json',
'Content-Length: ' . strlen($json))
);
$_result = curl_exec($ch);
curl_close($ch);
echo $_result;
echo "</textarea>";
exit;
?>
Utilize a requisição de situação para verificar a situação atual da API Maxbot para verificação e monitoramento da condição atual da API.
{
"token": "xxxx",
"cmd": "get_status"
}
{
"status": 1,
"msg": "Success",
"data":[{
"created_at": "2020-08-22",
"status": "Active",
"last_execution_at": "2020-08-29 21:21:32",
"last_operation": "Sound Shooting"
}]
}
Este exemplo funcional em PHP 7.3 executa um post para a API e apresenta o retorno na tela para validação. Modifique o código para se adequar às suas necessidades. Para outras linguagens, adapte o código de acordo.
<?php
header('Content-Type: text/html; charset=utf-8');
# Parametros
$_TOKEN = 'xxxxxx';
$_CMD = 'get_status';
# URL
$_URL = 'https://app.maxbot.com.br/api/v1.php';
# START
$_TXT = "[POST]:<br/><br/>";
$_TXT .= " API_URL => ".$_URL."<br/>";
$_TXT .= " token => ".$_TOKEN."<br/>";
$_TXT .= " cmd => ".$_CMD."<br/>";
$_TXT .= "<br/>";
$_TXT .= "[retorno]:<br/><br/>";
$_TXT .= "<textarea rows=10 cols=90>";
echo $_TXT;
# Request API
$_REQUEST = array(
"token" => "$_TOKEN",
"cmd" => "$_CMD"
);
$json = json_encode($_REQUEST);
$ch = curl_init($_URL);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
curl_setopt($ch, CURLOPT_POSTFIELDS, $json);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Content-Type: application/json',
'Content-Length: ' . strlen($json))
);
$_result = curl_exec($ch);
curl_close($ch);
echo $_result;
echo "</textarea>";
exit;
?>
Utilize a requisição de listagem de segmentações para importar a relação de segmentações cadastradas na conta Maxbot.
{
"token": "xxxx",
"cmd": "get_segmentation"
"type": "0"
}
{
"status": 1,
"msg": "Success",
"segmentation": [
{
"id": 1452,
"type": "0",
"title": "Negocia\u00e7\u00e3o"
},
{
"id": 2267,
"type": "0",
"title": "Proposta Enviada"
}
]
}
Este exemplo funcional em PHP 7.3 executa um post para a API e apresenta o retorno na tela para validação. Modifique o código para se adequar às suas necessidades. Para outras linguagens, adapte o código de acordo.
<?php
header('Content-Type: text/html; charset=utf-8');
# Parametros
$_TOKEN = 'xxxxxx';
$_CMD = 'get_segmentation';
$_TYPE = '0';
# URL
$_URL = 'https://app.maxbot.com.br/api/v1.php';
# START
$_TXT = "[POST]:<br/><br/>";
$_TXT .= " API_URL => ".$_URL."<br/>";
$_TXT .= " token => ".$_TOKEN."<br/>";
$_TXT .= " cmd => ".$_CMD."<br/>";
$_TXT .= " type => ".$_TYPE."<br/>";
$_TXT .= "<br/>";
$_TXT .= "[retorno]:<br/><br/>";
$_TXT .= "<textarea rows=10 cols=90>";
echo $_TXT;
# Request API
$_REQUEST = array(
"token" => "$_TOKEN",
"cmd" => "$_CMD",
"type" => "$_TYPE"
);
$json = json_encode($_REQUEST);
$ch = curl_init($_URL);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
curl_setopt($ch, CURLOPT_POSTFIELDS, $json);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Content-Type: application/json',
'Content-Length: ' . strlen($json))
);
$_result = curl_exec($ch);
curl_close($ch);
echo $_result;
echo "</textarea>";
exit;
?>
Utilize a requisição de listagem de categorias de templates para importar a relação das categorias cadastradas na conta Maxbot.
{
"token": "xxxxxx",
"cmd": "get_template_category"
}
{
"status": 1,
"msg": "Success",
"template_categories": [
{
"category_id": 0,
"category_title": "Geral"
},
{
"category_id": 2,
"category_title": "DETALHES DE PLANO"
},
{
"category_id": 1,
"category_title": "INFORMA\u00c7\u00d5ES"
},
{
"category_id": 3,
"category_title": "NEGOCIA\u00c7\u00c3O"
}
]
}
Este exemplo funcional em PHP 7.3 executa um post para a API e apresenta o retorno na tela para validação. Modifique o código para se adequar às suas necessidades. Para outras linguagens, adapte o código de acordo.
<?php
header('Content-Type: text/html; charset=utf-8');
# Parametros
$_TOKEN = 'xxxxxx';
$_CMD = 'get_template_category';
# URL
$_URL = 'https://app.maxbot.com.br/api/v1.php';
# START
$_TXT = "[POST]:<br/><br/>";
$_TXT .= " API_URL => ".$_URL."<br/>";
$_TXT .= " token => ".$_TOKEN."<br/>";
$_TXT .= " cmd => ".$_CMD."<br/>";
$_TXT .= "<br/>";
$_TXT .= "[retorno]:<br/><br/>";
$_TXT .= "<textarea rows=10 cols=90>";
echo $_TXT;
# Request API
$_REQUEST = array(
"token" => "$_TOKEN"
"cmd" => "$_CMD",
);
$json = json_encode($_REQUEST);
$ch = curl_init($_URL);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
curl_setopt($ch, CURLOPT_POSTFIELDS, $json);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Content-Type: application/json',
'Content-Length: ' . strlen($json))
);
$_result = curl_exec($ch);
curl_close($ch);
echo $_result;
echo "</textarea>";
exit;
?>
Utilize a requisição de listagem de templates para importar a relação de templates cadastrados na conta Maxbot.
{
"token": "xxxxxx",
"cmd": "get_template"
"type": ""
"category_id": ""
}
{
"status": 1,
"msg": "Success",
"template": [
{
"id": 1,
"type": "C",
"category_id": "0",
"category_title": "Geral",
"title": "Negocia\u00e7\u00e3o",
"msg": "Ol\u00e1, [NOME], tudo bem? \ud83d\ude03\ud83d\ude03",
"img1": "https://app.maxbot.com.br/anexos_docs/534404093e4ff33534bffd35291043c5.png",
"img2": "https://app.maxbot.com.br/anexos_docs/534404093e4ff33534bffd3529344422.png",
"img3": "https://app.maxbot.com.br/anexos_docs/534404093e4ff33534bffd3529108457.png",
"img4": "https://app.maxbot.com.br/anexos_docs/534404093e4ff33534bffd3529106535.png",
"img5": "https://app.maxbot.com.br/anexos_docs/534404093e4ff33534bffd3529105753.png",
"img6": "https://app.maxbot.com.br/anexos_docs/534404093e4ff33534bffd3529105473.png",
"arq1": "https://app.maxbot.com.br/anexos_docs/534404093e4ff33534bffd3529145665.pdf",
"arq2": "https://app.maxbot.com.br/anexos_docs/534404093e4ff33534bffd3529145656.pdf",
"arq3": "https://app.maxbot.com.br/anexos_docs/534404093e4ff33534bffd3529149986.pdf",
"waba_category": "",
"waba_language": "",
"waba_status": "",
"for_use": 0
},
{
"id": 2,
"type": "F",
"category_id": "0",
"category_title": "Geral",
"title": "Abertura de Protocolo",
"msg": "Bom dia.",
"img1": "https://app.maxbot.com.br/anexos_docs/534404093e4ff33534bffd35291043c5.png",
"img2": "",
"img3": "",
"img4": "",
"img5": "",
"img6": "",
"arq1": "https://app.maxbot.com.br/anexos_docs/534404093e4ff33534bffd3529145665.pdf",
"arq2": "",
"arq3": "",
"waba_category": "",
"waba_language": "",
"waba_status": "",
"for_use": 1
},
{
"id": 3,
"type": "A",
"category_id": "0",
"category_title": "Geral",
"title": "Aviso de Postado nos Correios",
"msg": "",
"img1": "",
"img2": "",
"img3": "",
"img4": "",
"img5": "",
"img6": "",
"arq1": "",
"arq2": "",
"arq3": "",
"waba_category": "",
"waba_language": "",
"waba_status": "",
"for_use": 1
}
]
}
Este exemplo funcional em PHP 7.3 executa um post para a API e apresenta o retorno na tela para validação. Modifique o código para se adequar às suas necessidades. Para outras linguagens, adapte o código de acordo.
<?php
header('Content-Type: text/html; charset=utf-8');
# Parametros
$_TOKEN = 'xxxxxx';
$_CMD = 'get_template';
$_TYPE = '';
$_CATEGORY_ID = '';
# URL
$_URL = 'https://app.maxbot.com.br/api/v1.php';
# START
$_TXT = "[POST]:<br/><br/>";
$_TXT .= " API_URL => ".$_URL."<br/>";
$_TXT .= " token => ".$_TOKEN."<br/>";
$_TXT .= " cmd => ".$_CMD."<br/>";
$_TXT .= " type => ".$_TYPE."<br/>";
$_TXT .= " category_id => ".$_CATEGORY_ID."<br/>";
$_TXT .= "<br/>";
$_TXT .= "[retorno]:<br/><br/>";
$_TXT .= "<textarea rows=10 cols=90>";
echo $_TXT;
# Request API
$_REQUEST = array(
"token" => "$_TOKEN",
"cmd" => "$_CMD"
"type" => "$_TYPE"
"category_id" => "$_CATEGORY_ID"
);
$json = json_encode($_REQUEST);
$ch = curl_init($_URL);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
curl_setopt($ch, CURLOPT_POSTFIELDS, $json);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Content-Type: application/json',
'Content-Length: ' . strlen($json))
);
$_result = curl_exec($ch);
curl_close($ch);
echo $_result;
echo "</textarea>";
exit;
?>
Utilize a requisição de listagem de setores de atendimento para importar a relação de setores de atendimento cadastrados na conta Maxbot.
{
"token": "xxxx",
"cmd": "get_service_sector"
}
{
"status": 1,
"msg": "Success",
"service_sector": [
{
"id": 1,
"code": "CO",
"name": "Comercial",
"responsible_name": "Rodrigo Gomide",
"responsible_email": "rodrigo@email.com",
"responsible_whatsapp": "553111116666",
"responsible_mobile_phone": "553111116666",
"responsible_phone_extension": "5454",
"operation_monday_answer": 1,
"operation_monday_shift1": "08:00-12:00",
"operation_monday_shift2": "13:00-18:00",
"operation_tuesday_answer": 1,
"operation_tuesday_shift1": "08:00-12:00",
"operation_tuesday_shift2": "13:00-18:00",
"operation_wednesday_answer": 1,
"operation_wednesday_shift1": "08:00-12:00",
"operation_wednesday_shift2": "13:00-18:00",
"operation_thursday_answer": 1,
"operation_thursday_shift1": "08:00-12:00",
"operation_thursday_shift2": "13:00-18:00",
"operation_friday_answer": 1,
"operation_friday_shift1": "08:00-12:00",
"operation_friday_shift2": "13:00-18:00",
"operation_saturday_answer": 1,
"operation_saturday_shift1": "08:00-12:00",
"operation_saturday_shift2": "13:00-18:00",
"operation_sunday_answer": 1,
"operation_sunday_shift1": "08:00-12:00",
"operation_sunday_shift2": "13:00-18:00",
"allow_service_with_unavailable_attendants": 0
},
{
"id": 2,
"code": "LO",
"name": "Log\u00edstica",
"responsible_name": "Romulo Balga",
"responsible_email": "romulo@email.com",
"responsible_whatsapp": "553122226666",
"responsible_mobile_phone": "553122226666",
"responsible_phone_extension": "5451",
"operation_monday_answer": 1,
"operation_monday_shift1": "08:00-12:00",
"operation_monday_shift2": "13:00-18:00",
"operation_tuesday_answer": 1,
"operation_tuesday_shift1": "08:00-12:00",
"operation_tuesday_shift2": "13:00-18:00",
"operation_wednesday_answer": 1,
"operation_wednesday_shift1": "08:00-12:00",
"operation_wednesday_shift2": "13:00-18:00",
"operation_thursday_answer": 1,
"operation_thursday_shift1": "08:00-12:00",
"operation_thursday_shift2": "13:00-18:00",
"operation_friday_answer": 1,
"operation_friday_shift1": "08:00-12:00",
"operation_friday_shift2": "13:00-18:00",
"operation_saturday_answer": 1,
"operation_saturday_shift1": "08:00-12:00",
"operation_saturday_shift2": "13:00-18:00",
"operation_sunday_answer": 1,
"operation_sunday_shift1": "08:00-12:00",
"operation_sunday_shift2": "13:00-18:00",
"allow_service_with_unavailable_attendants": 1
},
{
"id": 2,
"code": "MA",
"name": "Manuten\u00e7\u00e3o",
"responsible_name": "Dilson Lana",
"responsible_email": "dilson@email.com",
"responsible_whatsapp": "553122227766",
"responsible_mobile_phone": "",
"responsible_phone_extension": "5400",
"operation_monday_answer": 2,
"operation_monday_shift1": "08:00-12:00",
"operation_monday_shift2": "13:00-18:00",
"operation_tuesday_answer": 2,
"operation_tuesday_shift1": "08:00-12:00",
"operation_tuesday_shift2": "13:00-18:00",
"operation_wednesday_answer": 2,
"operation_wednesday_shift1": "08:00-12:00",
"operation_wednesday_shift2": "13:00-18:00",
"operation_thursday_answer": 2,
"operation_thursday_shift1": "08:00-12:00",
"operation_thursday_shift2": "13:00-18:00",
"operation_friday_answer": 2,
"operation_friday_shift1": "08:00-12:00",
"operation_friday_shift2": "13:00-18:00",
"operation_saturday_answer": 2,
"operation_saturday_shift1": "08:00-12:00",
"operation_saturday_shift2": "13:00-18:00",
"operation_sunday_answer": 0,
"operation_sunday_shift1": "08:00-12:00",
"operation_sunday_shift2": "13:00-18:00",
"allow_service_with_unavailable_attendants": 1
}
]
}
Este exemplo funcional em PHP 7.3 executa um post para a API e apresenta o retorno na tela para validação. Modifique o código para se adequar às suas necessidades. Para outras linguagens, adapte o código de acordo.
<?php
header('Content-Type: text/html; charset=utf-8');
# Parametros
$_TOKEN = 'xxxxxx';
$_CMD = 'get_service_sector';
# URL
$_URL = 'https://app.maxbot.com.br/api/v1.php';
# START
$_TXT = "[POST]:<br/><br/>";
$_TXT .= " API_URL => ".$_URL."<br/>";
$_TXT .= " token => ".$_TOKEN."<br/>";
$_TXT .= " cmd => ".$_CMD."<br/>";
$_TXT .= "<br/>";
$_TXT .= "[retorno]:<br/><br/>";
$_TXT .= "<textarea rows=10 cols=90>";
echo $_TXT;
# Request API
$_REQUEST = array(
"token" => "$_TOKEN",
"cmd" => "$_CMD"
);
$json = json_encode($_REQUEST);
$ch = curl_init($_URL);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
curl_setopt($ch, CURLOPT_POSTFIELDS, $json);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Content-Type: application/json',
'Content-Length: ' . strlen($json))
);
$_result = curl_exec($ch);
curl_close($ch);
echo $_result;
echo "</textarea>";
exit;
?>
Utilize a requisição de listagem de atendentes para importar a relação de atendentes cadastrados na conta Maxbot.
{
"token": "xxxx",
"cmd": "get_attendant"
}
{
"status": 1,
"msg": "Success",
"attendant": [
{
"id": 1,
"service_sector_id": [1],
"collaborator_id": 1,
"name": "Pedro Silva",
"status": 1
},
{
"id": 2,
"service_sector_id": [2,3],
"collaborator_id": 2,
"name": "Jos\u00e9 Nogueira",
"status": 0
},
{
"id": 3,
"service_sector_id": [1,3,8,29],
"collaborator_id": 3,
"name": "Ant\u00f4nio Prado",
"status": 1
}
]
}
Este exemplo funcional em PHP 7.3 executa um post para a API e apresenta o retorno na tela para validação. Modifique o código para se adequar às suas necessidades. Para outras linguagens, adapte o código de acordo.
<?php
header('Content-Type: text/html; charset=utf-8');
# Parametros
$_TOKEN = 'xxxxxx';
$_CMD = 'get_attendant';
# URL
$_URL = 'https://app.maxbot.com.br/api/v1.php';
# START
$_TXT = "[POST]:<br/><br/>";
$_TXT .= " API_URL => ".$_URL."<br/>";
$_TXT .= " token => ".$_TOKEN."<br/>";
$_TXT .= " cmd => ".$_CMD."<br/>";
$_TXT .= "<br/>";
$_TXT .= "[retorno]:<br/><br/>";
$_TXT .= "<textarea rows=10 cols=90>";
echo $_TXT;
# Request API
$_REQUEST = array(
"token" => "$_TOKEN",
"cmd" => "$_CMD"
);
$json = json_encode($_REQUEST);
$ch = curl_init($_URL);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
curl_setopt($ch, CURLOPT_POSTFIELDS, $json);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Content-Type: application/json',
'Content-Length: ' . strlen($json))
);
$_result = curl_exec($ch);
curl_close($ch);
echo $_result;
echo "</textarea>";
exit;
?>
Utilize a requisição de listagem de tipos de processos do controle de fluxo para importar a relação de tipos cadastrados na conta Maxbot.
{
"token": "xxxx",
"cmd": "get_cfx_type"
}
{
"status": 1,
"msg": "Success",
"cfx_type_list": [
{
"id": 1,
"title": "COMERCIAL",
"ind_display_value": 1
},
{
"id": 2,
"title": "SUPORTE T\u00c9CNICO N1",
"ind_display_value": 0
},
{
"id": 3,
"title": "IMPORTA\u00c7\u00c3O DE CONTATOS",
"ind_display_value": 1
},
"id": 4,
"title": "SEMANA DE ATENDIMENTO AO Cliente",
"ind_display_value": 0
{
"id": 5,
"title": "TESTE RODRIGO",
"ind_display_value": 0
}
]
}
Este exemplo funcional em PHP 7.3 executa um post para a API e apresenta o retorno na tela para validação. Modifique o código para se adequar às suas necessidades. Para outras linguagens, adapte o código de acordo.
<?php
header('Content-Type: text/html; charset=utf-8');
# Parametros
$_TOKEN = 'xxxxxx';
$_CMD = 'get_cfx_type';
# URL
$_URL = 'https://app.maxbot.com.br/api/v1.php';
# START
$_TXT = "[POST]:<br/><br/>";
$_TXT .= " API_URL => ".$_URL."<br/>";
$_TXT .= " token => ".$_TOKEN."<br/>";
$_TXT .= " cmd => ".$_CMD."<br/>";
$_TXT .= "<br/>";
$_TXT .= "[retorno]:<br/><br/>";
$_TXT .= "<textarea rows=10 cols=90>";
echo $_TXT;
# Request API
$_REQUEST = array(
"token" => "$_TOKEN",
"cmd" => "$_CMD"
);
$json = json_encode($_REQUEST);
$ch = curl_init($_URL);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
curl_setopt($ch, CURLOPT_POSTFIELDS, $json);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Content-Type: application/json',
'Content-Length: ' . strlen($json))
);
$_result = curl_exec($ch);
curl_close($ch);
echo $_result;
echo "</textarea>";
exit;
?>
Utilize a requisição de listagem de etapas do processo do controle de fluxo para importar a relação de tipos cadastrados na conta Maxbot.
{
"token": "xxxx",
"cmd": "get_cfx_stage",
"cfx_type_id": "1"
}
{
"status": 1,
"msg": "Success",
"cfx_stage_list": [
{
"id": 1,
"code": "C01",
"title": "PROSPECTO"
},
{
"id": 2,
"code":"C02",
"title": "LEVANTAMENTO DE DEMANDA"
},
{
"id": 3,
"code":"C03",
"title": "DEMONSTRA\u00c7\u00c3O"
},
{
"id": 4,
"code":"C04",
"title": "PER\u00cdODO DE TESTES"
},
{
"id": 5,
"code":"C05",
"title": "NEGOCIA\u00c7\u00c3O"
},
{
"id": 6,
"code":"C06",
"title": "CONTRATADO"
},
{
"id": 7,
"code":"C07",
"title": "PERDIDO"
}
]
}
Este exemplo funcional em PHP 7.3 executa um post para a API e apresenta o retorno na tela para validação. Modifique o código para se adequar às suas necessidades. Para outras linguagens, adapte o código de acordo.
<?php
header('Content-Type: text/html; charset=utf-8');
# Parametros
$_TOKEN = 'xxxxxx';
$_CMD = 'get_cfx_stage';
$_CFX_TYPE_ID = '1';
# URL
$_URL = 'https://app.maxbot.com.br/api/v1.php';
# START
$_TXT = "[POST]:<br/><br/>";
$_TXT .= " API_URL => ".$_URL."<br/>";
$_TXT .= " token => ".$_TOKEN."<br/>";
$_TXT .= " cmd => ".$_CMD."<br/>";
$_TXT .= "cfx_type_id => ".$_CFX_TYPE_ID."<br/>";
$_TXT .= "<br/>";
$_TXT .= "[retorno]:<br/><br/>";
$_TXT .= "<textarea rows=10 cols=90>";
echo $_TXT;
# Request API
$_REQUEST = array(
"token" => "$_TOKEN",
"cmd" => "$_CMD",
"cfx_type_id" => "$_CFX_TYPE_ID"
);
$json = json_encode($_REQUEST);
$ch = curl_init($_URL);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
curl_setopt($ch, CURLOPT_POSTFIELDS, $json);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Content-Type: application/json',
'Content-Length: ' . strlen($json))
);
$_result = curl_exec($ch);
curl_close($ch);
echo $_result;
echo "</textarea>";
exit;
?>
Utilize a requisição de listagem de processos do controle de fluxo para importar a relação dos processos cadastrados na conta Maxbot.
{
"token": "xxxx",
"cmd": "get_cfx_process_list",
"date_start": "2021-10-01",
"date_stop": "2021-10-16",
"focus_of_period": "1",
"cfx_type_id": "",
"cfx_stage_id": "",
"number": "",
"prot_num": "",
"contact_id": "",
"collaborator_id": "",
"title": "",
"external_id_1": "",
"external_id_2": "",
"value": "",
"archived": ""
}
{
"status": 1,
"msg": "Success",
"data": [
{
"id": 128,
"title": "INTERESSADO NO MAXBOT",
"cfx_type_id": 1,
"cfx_stage_id": 2,
"number": "96",
"code": "202110-959E-8C3B-6119",
"token": "202110538BEAA0EB43-7F934A-B06CFF",
"type": "COMERCIAL",
"stage_title": "DEMANDA",
"stage_actual_term_min": "15 Minutos",
"activity": "2",
"realized": "0%",
"name_contact": "EDUARDO GON\u00c7ALVES",
"name_resp": "EDUARDO GON\u00c7ALVES FILHO",
"prot_num": "1400",
"external_id_1": "126",
"external_id_2": "96",
"ind_display_value": 1,
"value": "407.00",
"date_last_evolution": "2021-10-16 09:54:12",
"opening_date": "2021-10-16 00:00:00",
"notes": "1",
"annex": "6",
"delivery_date": "2021-10-20 00:00:00",
"closing_date": "2021-11-01 00:00:00",
"archived": 0,
"archived_date": "0000-00-00 00:00:00"
}
]
}
Este exemplo funcional em PHP 7.3 executa um post para a API e apresenta o retorno na tela para validação. Modifique o código para se adequar às suas necessidades. Para outras linguagens, adapte o código de acordo.
<?php
header('Content-Type: text/html; charset=utf-8');
# Parametros
$_TOKEN = 'xxxxxx';
$_CMD = 'get_cfx_process_list';
$_DATE_START = '2021-10-01';
$_DATE_STOP = '2021-10-16';
$_FOCUS_OF_PERIOD = '1';
$_CFX_TYPE_ID = '';
$_CFX_STAGE_ID = '';
$_NUMBER = '';
$_PROT_NUM = '';
$_CONTACT_ID = '';
$_COLLABORATOR_ID = '';
$_TITLE = '';
$_EXTERNAL_ID_1 = '';
$_EXTERNAL_ID_2 = '';
$_VALUE = '';
$_ARCHIVED = '';
# URL
$_URL = 'https://app.maxbot.com.br/api/v1.php';
# START
$_TXT = "[POST]:<br/><br/>";
$_TXT .= " API_URL => ".$_URL."<br/>";
$_TXT .= " cmd => ".$_CMD."<br/>";
$_TXT .= " token => ".$_TOKEN."<br/>";
$_TXT .= " date_start => ".$_DATE_START."<br/>";
$_TXT .= " date_stop => ".$_DATE_STOP."<br/>";
$_TXT .= " focus_of_period => ".$_FOCUS_OF_PERIOD."<br/>";
$_TXT .= " cfx_type_id => ".$_CFX_TYPE_ID."<br/>";
$_TXT .= " cfx_stage_id => ".$_CFX_STAGE_ID."<br/>";
$_TXT .= " number => ".$_NUMBER."<br/>";
$_TXT .= " prot_num => ".$_PROT_NUM."<br/>";
$_TXT .= " contact_id => ".$_CONTACT_ID."<br/>";
$_TXT .= " collaborator_id => ".$_COLLABORATOR_ID."<br/>";
$_TXT .= " title => ".$_TITLE."<br/>";
$_TXT .= " external_id_1 => ".$_EXTERNAL_ID_1."<br/>";
$_TXT .= " external_id_2 => ".$_EXTERNAL_ID_2."<br/>";
$_TXT .= " value => ".$_VALUE."<br/>";
$_TXT .= " archived => ".$_ARCHIVED_IAQ."<br/>";
$_TXT .= "<br/>";
$_TXT .= "[retorno]:<br/><br/>";
$_TXT .= "<textarea rows=10 cols=90>";
echo $_TXT;
# Request API
$_REQUEST = array(
"token" => "$_TOKEN",
"cmd" => "$_CMD",
"date_start" => "$_DATE_START",
"date_stop" => "$_DATE_STOP",
"focus_of_period" => "$_FOCUS_OF_PERIOD",
"cfx_type_id" => "$_CFX_TYPE_ID",
"cfx_stage_id" => "$_CFX_STAGE_ID",
"number" => "$_NUMBER",
"protocol" => "$_PROTOCOL",
"contact_id" => "$_CONTACT_ID",
"collaborator_id" => "$_COLLABORATOR_ID",
"title" => "$_TITLE",
"external_id_1" => "$_EXTERNAL_ID_1",
"external_id_2" => "$_EXTERNAL_ID_2",
"value" => "$_VALUE",
"archived" => "$_ARCHIVED_IAQ"
);
$json = json_encode($_REQUEST);
$ch = curl_init($_URL);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
curl_setopt($ch, CURLOPT_POSTFIELDS, $json);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Content-Type: application/json',
'Content-Length: ' . strlen($json))
);
$_result = curl_exec($ch);
curl_close($ch);
echo $_result;
echo "</textarea>";
exit;
?>
Utilize a requisição de dados do processo para importar os dados do processo indicado do controle de fluxo da conta Maxbot.
{
"token": "xxxx",
"cmd": "get_cfx_process",
"for_process_id": "128"
}
{
"status": 1,
"msg": "Success",
"process": [
{
"id": 128,
"number": "96",
"code": "202110-959E-8C3B-6119",
"type": "COMERCIAL",
"name_contact": "EDUARDO GON\u00c7ALVES",
"name_resp": "EDUARDO GON\u00c7ALVES FILHO",
"title": "INTERESSADO NO MAXBOT",
"prot_num": "1400",
"external_id_1": "126",
"external_id_2": "96",
"description": "Descri\u00e7\u00e3o",
"ind_display_value": 0,
"value": "407.00",
"delivery_date": "2021-10-20 00:00:00",
"closing_date": "2021-11-01 00:00:00",
"opening_date": "2021-10-16 00:00:00",
"archived": 0,
"archived_date": "0000-00-00 00:00:00",
"obs": "Observa\u00e7\u00e3o",
"last_update_user": "eduardoatendente",
"last_update_date": "2021-10-16 09:54:12"
}
],
"notes": [
{
"note_date": "16\/10\/21 09h50",
"note_resp": "EDUARDO GON\u00c7ALVES FILHO",
"note_text": "Marcado demostra\u00e7\u00e3o para Cliente dia 18\/10\/2021."
}
],
"annexes": [
{
"annex_date": "16\/10\/21 09h53",
"annex_resp": "EDUARDO GON\u00c7ALVES FILHO",
"annex_title": "TESTE ARQUIVO 1",
"annex_url": "https:\/\/app.maxbot.com.br\/anexos_docs\/bc4b65e1e3b4805a28ec837f22b159f2.jpg",
"annex_info": "bc4b65e1e3b4805a28ec837f22b159f2.jpg",
"annex_size": "1.28M"
},
{
"annex_date": "16\/10\/21 09h53",
"annex_resp": "EDUARDO GON\u00c7ALVES FILHO",
"annex_title": "TESTE ARQUIVO 2",
"annex_url": "https:\/\/app.maxbot.com.br\/anexos_docs\/d977a35386915f754cce9c805ff63cbf.jpg",
"annex_info": "d977a35386915f754cce9c805ff63cbf.jpg",
"annex_size": "2.83M"
},
{
"annex_date": "16\/10\/21 09h53",
"annex_resp": "EDUARDO GON\u00c7ALVES FILHO",
"annex_title": "TESTE ARQUIVO 3",
"annex_url": "https:\/\/app.maxbot.com.br\/anexos_docs\/34d4d9d9705aa01713841b949724da02.jpg",
"annex_info": "34d4d9d9705aa01713841b949724da02.jpg",
"annex_size": "1.34M"
},
{
"annex_date": "16\/10\/21 09h53",
"annex_resp": "EDUARDO GON\u00c7ALVES FILHO",
"annex_title": "TESTE ARQUIVO 4",
"annex_url": "https:\/\/app.maxbot.com.br\/anexos_docs\/6bb3b947e93d70532b9ae237be8b27bd.jpg",
"annex_info": "6bb3b947e93d70532b9ae237be8b27bd.jpg",
"annex_size": "2.59M"
},
{
"annex_date": "16\/10\/21 09h53",
"annex_resp": "EDUARDO GON\u00c7ALVES FILHO",
"annex_title": "TESTE ARQUIVO 5",
"annex_url": "https:\/\/app.maxbot.com.br\/anexos_docs\/25c2c6fb5593c6a992b3b4b9697e99d4.jpg",
"annex_info": "25c2c6fb5593c6a992b3b4b9697e99d4.jpg",
"annex_size": "2.93M"
},
{
"annex_date": "16\/10\/21 09h53",
"annex_resp": "EDUARDO GON\u00c7ALVES FILHO",
"annex_title": "TESTE ARQUIVO 6",
"annex_url": "https:\/\/app.maxbot.com.br\/anexos_docs\/491e82c1420052a6be2ff9dda13dc0e5.jpg",
"annex_info": "491e82c1420052a6be2ff9dda13dc0e5.jpg",
"annex_size": "2.75M"
}
],
"stages": [
{
"stage_id": 1,
"stage_current": 0,
"stage_code": "C01",
"stage_title": "PROSPECTO",
"activity": [
{
"activity_id": 1,
"activity_current": 0,
"activity_code": "E1",
"activity_title": "Completar ficha cadastral",
"activity_descr": "Completar a ficha do contato.",
"activity_term": "5 Minutos",
"activity_exe": "16\/10\/2021 09:50",
"activity_exe_resp": "Eduardo Gon\u00e7alves Filho",
"activity_exe_obs_pub": "Observa\u00e7\u00e3o p\u00fablica da execu\u00e7\u00e3o da atividade. A informa\u00e7\u00e3o \u00e9 mostrada para todos.",
"activity_exe_obs_int": "Observa\u00e7\u00e3o interna da execu\u00e7\u00e3o da atividade. A informa\u00e7\u00e3o \u00e9 mostrada apenas para a equipe interna da empresa."
}
]
},
{
"stage_id": 2,
"stage_current": 1,
"stage_code": "C02",
"stage_title": "DEMANDA",
"activity": [
{
"activity_id": 2,
"activity_current": 1,
"activity_code": "E1",
"activity_title": "Determinar a \u00e1rea de atua\u00e7\u00e3o",
"activity_descr": "Descobrir qual a \u00e1rea de atua\u00e7\u00e3o do Cliente.",
"activity_term": "5 Minutos",
"activity_exe": "Pendente",
"activity_exe_resp": "",
"activity_exe_obs_pub": "",
"activity_exe_obs_int": ""
},
{
"activity_id": 3,
"activity_current": 1,
"activity_code": "E2",
"activity_title": "Levantar limites de conta (CT, AT, CB adicional)",
"activity_descr": "Perguntar a qtde de contatos, atendentes para a conta.",
"activity_term": "5 Minutos",
"activity_exe": "Pendente",
"activity_exe_resp": "",
"activity_exe_obs_pub": "",
"activity_exe_obs_int": ""
}
]
},
{
"stage_id": 3,
"stage_current": 0,
"stage_code": "C03",
"stage_title": "DEMONSTRA\u00c7\u00c3O",
"activity": [
{
"activity_id": 4,
"activity_current": 0,
"activity_code": "E1",
"activity_title": "Apresentar Maxbot com foco no neg\u00f3cio do Cliente",
"activity_descr": "Apresentar a plataforma focada no neg\u00f3cio do Cliente.",
"activity_term": "40 Minutos",
"activity_exe": "Pendente",
"activity_exe_resp": "",
"activity_exe_obs_pub": "",
"activity_exe_obs_int": ""
},
{
"activity_id": 5,
"activity_current": 0,
"activity_code": "E2",
"activity_title": "Iniciar per\u00edodo de teste gratu\u00edto de 3 dias",
"activity_descr": "Criar o cadastro do Cliente, orientando a criar um username comercial para a empresa. Ajudar na configura\u00e7\u00e3o inicial para que ele comece o per\u00edodo de teste.",
"activity_term": "10 Minutos",
"activity_exe": "Pendente",
"activity_exe_resp": "",
"activity_exe_obs_pub": "",
"activity_exe_obs_int": ""
}
]
},
{
"stage_id": 4,
"stage_current": 0,
"stage_code": "C04",
"stage_title": "PER\u00cdODO DE TESTES",
"activity": [
{
"activity_id": 6,
"activity_current": 0,
"activity_code": "E1",
"activity_title": "Configura\u00e7\u00e3o inicial",
"activity_descr": "Ajudar na configura\u00e7\u00e3o inicial para que ele comece os testes.",
"activity_term": "10 Minutos",
"activity_exe": "Pendente",
"activity_exe_resp": "",
"activity_exe_obs_pub": "",
"activity_exe_obs_int": ""
},
{
"activity_id": 7,
"activity_current": 0,
"activity_code": "E2",
"activity_title": "Entrar em contato no dia 2",
"activity_descr": "Entrar em contato para ver se est\u00e1 tudo ok e se os testes est\u00e3o caminhando bem.",
"activity_term": "10 Minutos",
"activity_exe": "Pendente",
"activity_exe_resp": "",
"activity_exe_obs_pub": "",
"activity_exe_obs_int": ""
},
{
"activity_id": 8,
"activity_current": 0,
"activity_code": "E3",
"activity_title": "Entrar em contato no dia 3",
"activity_descr": "Entrar em contato para ver se est\u00e1 tudo ok. Come\u00e7ar a levantar a demanda final do Cliente para or\u00e7amento da solu\u00e7\u00e3o.",
"activity_term": "10 Minutos",
"activity_exe": "Pendente",
"activity_exe_resp": "",
"activity_exe_obs_pub": "",
"activity_exe_obs_int": ""
}
]
},
{
"stage_id": 5,
"stage_current": 0,
"stage_code": "C05",
"stage_title": "NEGOCIA\u00c7\u00c3O",
"activity": [
{
"activity_id": 9,
"activity_current": 0,
"activity_code": "E1",
"activity_title": "Negocia\u00e7\u00e3o da licen\u00e7a",
"activity_descr": "Fechar com o Cliente a licen\u00e7a Maxbot com os limites, canais e m\u00f3dulos que ele necessita.",
"activity_term": "10 Minutos",
"activity_exe": "Pendente",
"activity_exe_resp": "",
"activity_exe_obs_pub": "",
"activity_exe_obs_int": ""
},
{
"activity_id": 10,
"activity_current": 0,
"activity_code": "E2",
"activity_title": "Tentar fechar anuidade",
"activity_descr": "Tentar fechar anuidade com o Cliente com pagamentos mensais.",
"activity_term": "5 Minutos",
"activity_exe": "Pendente",
"activity_exe_resp": "",
"activity_exe_obs_pub": "",
"activity_exe_obs_int": ""
},
{
"activity_id": 11,
"activity_current": 0,
"activity_code": "E3",
"activity_title": "Definir melhor dia de vencimento",
"activity_descr": "Definir com o Cliente o dia de vencimento que melhor se encaixa no financeiro dele.",
"activity_term": "5 Minutos",
"activity_exe": "Pendente",
"activity_exe_resp": "",
"activity_exe_obs_pub": "",
"activity_exe_obs_int": ""
},
{
"activity_id": 12,
"activity_current": 0,
"activity_code": "E4",
"activity_title": "Fechamento do neg\u00f3cio",
"activity_descr": "Fechar o neg\u00f3cio com o Cliente orientando ele at\u00e9 a gera\u00e7\u00e3o da contrata\u00e7\u00e3o.",
"activity_term": "5 Minutos",
"activity_exe": "Pendente",
"activity_exe_resp": "",
"activity_exe_obs_pub": "",
"activity_exe_obs_int": ""
}
]
},
{
"stage_id": 6,
"stage_current": 0,
"stage_code": "C06",
"stage_title": "CONTRATADO",
"activity": [
{
"activity_id": 13,
"activity_current": 0,
"activity_code": "E1",
"activity_title": "Avisar no grupo a nova contratacao",
"activity_descr": "Jogar GIF animado no grupo e comemorar hehhe.",
"activity_term": "5 Minutos",
"activity_exe": "Pendente",
"activity_exe_resp": "",
"activity_exe_obs_pub": "",
"activity_exe_obs_int": ""
},
{
"activity_id": 14,
"activity_current": 0,
"activity_code": "E2",
"activity_title": "Avisar CS da nova contrata\u00e7\u00e3o",
"activity_descr": "Avisar o CS da nova contrata\u00e7\u00e3o.",
"activity_term": "5 Minutos",
"activity_exe": "Pendente",
"activity_exe_resp": "",
"activity_exe_obs_pub": "",
"activity_exe_obs_int": ""
},
{
"activity_id": 15,
"activity_current": 0,
"activity_code": "E3",
"activity_title": "Entrar em contato com o Cliente ap\u00f3s 30 dias",
"activity_descr": "CS deve entrar em contato com o Cliente ap\u00f3s o primeiro m\u00eas para levantamento da satisfa\u00e7\u00e3o e ader\u00eancia \u00e0 plataforma.",
"activity_term": "10 Minutos",
"activity_exe": "Pendente",
"activity_exe_resp": "",
"activity_exe_obs_pub": "",
"activity_exe_obs_int": ""
}
]
},
{
"stage_id": 7,
"stage_current": 0,
"stage_code": "C07",
"stage_title": "PERDIDO",
"activity": [
{
"activity_id": 16,
"activity_current": 0,
"activity_code": "E1",
"activity_title": "Segmentar o contato como perdido",
"activity_descr": "Segmentar o contato como perdido para tratamento futuro.",
"activity_term": "5 Minutos",
"activity_exe": "Pendente",
"activity_exe_resp": "",
"activity_exe_obs_pub": "",
"activity_exe_obs_int": ""
},
{
"activity_id": 17,
"activity_current": 0,
"activity_code": "E2",
"activity_title": "Entrar em contato para 2a tentativa",
"activity_descr": "Entrar em contato 1 semana depois para nova tentativa de negocia\u00e7\u00e3o.",
"activity_term": "10 Minutos",
"activity_exe": "Pendente",
"activity_exe_resp": "",
"activity_exe_obs_pub": "",
"activity_exe_obs_int": ""
}
]
}
]
}
Este exemplo funcional em PHP 7.3 executa um post para a API e apresenta o retorno na tela para validação. Modifique o código para se adequar às suas necessidades. Para outras linguagens, adapte o código de acordo.
<?php
header('Content-Type: text/html; charset=utf-8');
# Parametros
$_TOKEN = 'xxxxxx';
$_CMD = 'get_cfx_process';
$_FOR_PROCESS_ID = '128';
# URL
$_URL = 'https://app.maxbot.com.br/api/v1.php';
# START
$_TXT = "[POST]:<br/><br/>";
$_TXT .= " API_URL => ".$_URL."<br/>";
$_TXT .= " cmd => ".$_CMD."<br/>";
$_TXT .= " token => ".$_TOKEN."<br/>";
$_TXT .= " for_process_id => ".$_FOR_PROCESS_ID."<br/>";
$_TXT .= "<br/>";
$_TXT .= "[retorno]:<br/><br/>";
$_TXT .= "<textarea rows=10 cols=90>";
echo $_TXT;
# Request API
$_REQUEST = array(
"token" => "$_TOKEN",
"cmd" => "$_CMD",
"for_process_id" => "$_FOR_PROCESS_ID"
);
$json = json_encode($_REQUEST);
$ch = curl_init($_URL);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
curl_setopt($ch, CURLOPT_POSTFIELDS, $json);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Content-Type: application/json',
'Content-Length: ' . strlen($json))
);
$_result = curl_exec($ch);
curl_close($ch);
echo $_result;
echo "</textarea>";
exit;
?>
Utilize a requisição de dados do contato para importar a ficha de cadastro do contato. Todos os dados existentes na ficha cadastral serão retornados. Desta forma, um sistema externo (RP, CRM, etc) poderá importar os contatos novos que entraram no atendimento, bem como obter os dados mais atuais de contatos já existentes.
{
"token": "xxxx",
"cmd": "get_contact",
"focus_period": "0",
"date_start": "2020-08-01",
"date_stop": "2020-08-01",
"datetime_focus": "",
"datetime_start": "",
"datetime_stop": "",
"waba_session": "",
"messenger_session": "",
"instagram_session": "",
"validated_whatsapp": "",
"whatsapp": "5511999998888",
"channel_whatsapp": ""
"channel_telegram": ""
"channel_messenger": ""
"channel_instagram": ""
"mobile_phone": "5511999998888",
"email": "fulano@mail.com",
"external_id": "1234"
}
{
"status": 1,
"msg": "Success",
"data": [
{
"id": "1",
"created_at": "2020-06-08 08:07:16",
"updated_at": "2020-06-08 08:07:16",
"segmentation": [],
"tag": "THER",
"tag2": "THER2",
"name": "Rodrigo",
"surname": "Funda\u00e7\u00e3o Ther",
"gender": "M",
"gender_info": "",
"birth": "1974-10-22",
"age": "46",
"br_person_type": "J",
"br_cpf": "11122233344",
"br_cnpj": "11222333000144",
"company": "Ther Sistemas Ltda",
"email": "rodrigo@maxbot.com.br",
"channel_whatsapp": "5531911111444",
"whatsapp": "5531911112222",
"channel_telegram": "",
"telegram_id": "",
"channel_fbmessenger": "",
"fbmessenger_id": "",
"channel_instagram": "",
"instagram_id": "",
"mobile_phone": "5531922223333",
"phone": "3132324455",
"country": "BR",
"state": "MG",
"city": "Vi\u00e7osa",
"profession": "",
"external_id": "5678",
"ind_client": "0",
"client_code": "",
"avatar_url": "",
"obs": "",
"tag_info1": "",
"tag_info2": "",
"tag_info3": "",
"tag_info4": "",
"tag_info5": "",
"tag_info6": "",
"waba_session": "",
"messenger_session": "",
"instagram_session": "",
"in_attendance": "0",
"current_protocol": "",
"current_attendant": ""
},
{
"id": "2",
"created_at": "2020-06-08 08:07:16",
"updated_at": "2020-06-08 08:07:16",
"segmentation": [],
"tag": "",
"tag2": "",
"name": "Dilson",
"surname": "Lana",
"gender": "M",
"gender_info": "",
"birth": "",
"age": "",
"br_person_type": "F",
"br_cpf": "",
"br_cnpj": "",
"company": "",
"email": "",
"channel_whatsapp": "5531911111333",
"whatsapp": "5531911114324",
"channel_telegram": "",
"telegram_id": "",
"channel_fbmessenger": "",
"fbmessenger_id": "",
"channel_instagram": "",
"instagram_id": "",
"mobile_phone": "5531922223333",
"phone": "",
"country": "BR",
"state": "SP",
"city": "Campinas",
"profession": "",
"external_id": "",
"telegram_id": "",
"fbmessenger_id": "",
"instagram_id": "",
"ind_client": "0",
"client_code": "",
"avatar_url": "",
"obs": "Cliente VIP",
"tag_info1": "",
"tag_info2": "",
"tag_info3": "",
"tag_info4": "",
"tag_info5": "",
"tag_info6": "",
"waba_session": "",
"messenger_session": "",
"instagram_session": "",
"in_attendance": "1",
"current_protocol": "2345",
"current_attendant": "Keli Marchi"
},
{
"id": "3",
"created_at": "2020-06-08 08:07:16",
"updated_at": "2020-06-08 08:07:16",
"segmentation": ["Negocia\u00e7\u00e3o", "Proposta Enviada"],
"tag": "Atd Romulo",
"tag2": "Atd Romulo2",
"name": "Keli",
"surname": "Marchi",
"gender": "F",
"gender_info": "",
"birth": "1990-06-15",
"age": "30",
"br_person_type": "F",
"br_cpf": "11122233300",
"br_cnpj": "",
"company": "",
"email": "keli@email.com",
"channel_whatsapp": "5531911111222",
"whatsapp": "5531911116666",
"channel_telegram": "",
"telegram_id": "",
"channel_fbmessenger": "",
"fbmessenger_id": "",
"channel_instagram": "",
"instagram_id": "",
"mobile_phone": "5531911116666",
"phone": "",
"country": "BR",
"state": "RJ",
"city": "Rio de Janeiro",
"profession": "Ci\u00eancias Cont\u00e1beis",
"external_id": "keli-09",
"telegram_id": "",
"fbmessenger_id": "",
"instagram_id": "",
"ind_client": "0",
"client_code": "",
"avatar_url": "https:\/\/maxbot.com.br\/anexos_docs\/f434cd6b295984e3a0c05d8d67ae173d_small.jpg",
"obs": "ENVIAR PROPOSTA COMERCIAL NA SEGUNDA",
"tag_info1": "",
"tag_info2": "",
"tag_info3": "",
"tag_info4": "",
"tag_info5": "",
"tag_info6": "",
"waba_session": "",
"messenger_session": "",
"instagram_session": "",
"in_attendance": "0",
"current_protocol": "",
"current_attendant": ""
}
]
}
Este exemplo funcional em PHP 7.3 executa um post para a API e apresenta o retorno na tela para validação. Modifique o código para se adequar às suas necessidades. Para outras linguagens, adapte o código de acordo.
<?php
header('Content-Type: text/html; charset=utf-8');
# Parametros
$_TOKEN = 'xxxxxx';
$_CMD = 'get_contact';
$_FOCUS_PERIOD = '0';
$_DATA_INI = '2020-01-01';
$_DATA_FIM = '2020-08-25';
$_WABA_SESSION = '';
# URL
$_URL = 'https://app.maxbot.com.br/api/v1.php';
# START
$_TXT = "[POST]:<br/><br/>";
$_TXT .= " API_URL => ".$_URL."<br/>";
$_TXT .= " token => ".$_TOKEN."<br/>";
$_TXT .= " cmd => ".$_CMD."<br/>";
$_TXT .= "focus_period => ".$_FOCUS_PERIOD."<br/>";
$_TXT .= " date_start => ".$_DATA_INI."<br/>";
$_TXT .= " date_stop => ".$_DATA_FIM."<br/>";
$_TXT .= "waba_session => ".$_WABA_SESSION."<br/>";
$_TXT .= "<br/>";
$_TXT .= "[retorno]:<br/><br/>";
$_TXT .= "<textarea rows=10 cols=90>";
echo $_TXT;
# Request API
$_REQUEST = array(
"token" => "$_TOKEN",
"cmd" => "$_CMD",
"date_start" => "$_DATA_INI",
"date_stop" => "$_DATA_FIM",
"waba_session" => "$_WABA_SESSION"
);
$json = json_encode($_REQUEST);
$ch = curl_init($_URL);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
curl_setopt($ch, CURLOPT_POSTFIELDS, $json);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Content-Type: application/json',
'Content-Length: ' . strlen($json))
);
$_result = curl_exec($ch);
curl_close($ch);
echo $_result;
echo "</textarea>";
exit;
?>
Utilize a requisição de dados do protocolo para importar os protocolos concluídos em um determinado período. Todos os dados existentes na ficha do protocolo serão retornados. Desta forma, um sistema externo (RP, CRM, etc) poderá importar os dados do atendimento. A requisição retorna todos os dados do protocolo, bem como todo o diálogo trocado pelo atendente com o contato. Obs.: Retorna dados apenas de protocolos concluídos!
{
"token": "xxxxxx",
"cmd": "get_prot",
"date_focus": "1",
"date_start": "2022-06-22",
"date_stop": "2022-06-22",
"sector_id": "",
"attendant_id": "",
"contact_id": "",
"situation": "2",
"br_cpf": "",
"br_cnpj": "",
"company_name": "",
"segmentation_contact": "",
"segmentation_protocol": ""
}
{
"status": 1,
"msg": "Success",
"data": [
{
"id": "143",
"origin": "2",
"protocol_number": "143",
"segmentation": [
{
"id": "60",
"title": "SAC"
}
],
"service_sector": "Suporte T\u00e9cnico",
"attendant_name": "Rodrigo Gomide",
"contact_info": "553195551111",
"contact_name": "Roberto Fulano",
"contact_whatsapp": "553195551111",
"contact_email": "",
"contact_cpf": "",
"contact_cnpj": "",
"contact_company_name": "",
"situation": "3",
"created_date": "2020-08-31",
"started_date": "2020-08-31 14:33:39",
"concluded_date": "2020-08-31 14:37:52",
"duration": "00:00:04",
"obs": "Atendimento encerrado pelo atendente.",
"notes": [
{
"id": "11",
"date": "2020-08-31 14:36:47",
"attendant_name": "Rodrigo Gomide",
"note": "Cliente pede urg\u00eancia, pois precisa da internet para realizar uma live. Pedir urg\u00eancia \u00e0 equipe t\u00e9cnica."
},
{
"id": "10",
"date": "2020-08-31 14:34:25",
"attendant_name": "Rodrigo Gomide",
"note": "Cliente reclama que est\u00e1 sem acesso \u00e0 internet. Solicita suporte t\u00e9cnico para reestabelecimento do servi\u00e7o."
}
],
"dialog": [
{
"id": "769",
"date": "2020-08-31",
"internal_communication": "0",
"flux": "reply",
"type": "T",
"sent_by": "Roberto Fulano",
"received_by": "Rodrigo Gomide",
"msg_id": "3EB03C160CBC1BC9B9D9",
"msg_text": "[Abertura de Protocolo #0000000143]\n\n[Orienta\u00e7\u00e3o]:\n\n1. Solicitar ao contato:\n- Nome\n- Sobrenome\n- Email\n\n2. Segmentar a ficha do contato como prospect\n3. Atualizar a ficha do contato com o ID Externo\n\nN\u00e3o esque\u00e7a de sorrir hehehe\n",
"msg_sound": "",
"msg_image": "",
"msg_file": "",
"msg_video": "",
"msg_location_preview": "",
"msg_location_lat": "",
"msg_location_lng": "",
"msg_contact": [],
"quoted_msg_id": "",
"quoted_msg_text": "",
"quoted_msg_sound": "",
"quoted_msg_image": "",
"quoted_msg_file": "",
"quoted_msg_video": "",
"quoted_msg_location_preview": "",
"quoted_msg_location_lat": "",
"quoted_msg_location_lng": "",
"quoted_msg_contact": ""
},
{
"id": "770",
"date": "2020-08-31",
"internal_communication": "0",
"flux": "sent",
"type": "T",
"sent_by": "Rodrigo Gomide",
"received_by": "Roberto Fulano",
"msg_id": "",
"msg_text": "Ol\u00e1 Roberto, meu nome \u00e9 Rodrigo, como posso ajudar?",
"msg_sound": "",
"msg_image": "",
"msg_file": "",
"msg_video": "",
"msg_location_preview": "",
"msg_location_lat": "",
"msg_location_lng": "",
"msg_contact": [],
"quoted_msg_id": "",
"quoted_msg_text": "",
"quoted_msg_sound": "",
"quoted_msg_image": "",
"quoted_msg_file": "",
"quoted_msg_video": "",
"quoted_msg_location_preview": "",
"quoted_msg_location_lat": "",
"quoted_msg_location_lng": "",
"quoted_msg_contact": ""
},
{
"id": "771",
"date": "2020-08-31",
"internal_communication": "0",
"flux": "reply",
"type": "T",
"sent_by": "Roberto Fulano",
"received_by": "Rodrigo Gomide",
"msg_id": "3EB0F5D5A370A2A28F76",
"msg_text": "Ol\u00e1, estou sem acesso \u00e0 internet. Preciso de suporte t\u00e9cnico.",
"msg_sound": "",
"msg_image": "",
"msg_file": "",
"msg_video": "",
"msg_location_preview": "",
"msg_location_lat": "",
"msg_location_lng": "",
"msg_contact": [],
"quoted_msg_id": "",
"quoted_msg_text": "",
"quoted_msg_sound": "",
"quoted_msg_image": "",
"quoted_msg_file": "",
"quoted_msg_video": "",
"quoted_msg_location_preview": "",
"quoted_msg_location_lat": "",
"quoted_msg_location_lng": "",
"quoted_msg_contact": ""
},
{
"id": "772",
"date": "2020-08-31",
"internal_communication": "0",
"flux": "sent",
"type": "T",
"sent_by": "Rodrigo Gomide",
"received_by": "Roberto Fulano",
"msg_id": "",
"msg_text": "Ok. Registrei a sua reclama\u00e7\u00e3o. Vou solicitar \u00e0 equipe t\u00e9cnica que veja o que est\u00e1 ocorrendo. Tempo de resolu\u00e7\u00e3o do problema \u00e9 de cerca de 2 horas. Posso ajudar em algo mais?",
"msg_sound": "",
"msg_image": "",
"msg_file": "",
"msg_video": "",
"msg_location_preview": "",
"msg_location_lat": "",
"msg_location_lng": "",
"msg_contact": [],
"quoted_msg_id": "",
"quoted_msg_text": "",
"quoted_msg_sound": "",
"quoted_msg_image": "",
"quoted_msg_file": "",
"quoted_msg_video": "",
"quoted_msg_location_preview": "",
"quoted_msg_location_lat": "",
"quoted_msg_location_lng": "",
"quoted_msg_contact": ""
},
{
"id": "773",
"date": "2020-08-31",
"internal_communication": "0",
"flux": "reply",
"type": "T",
"sent_by": "Roberto Fulano",
"received_by": "Rodrigo Gomide",
"msg_id": "3EB09B22C2C2BADE917F",
"msg_text": "Teria como resolver mais r\u00e1pido? Preciso da internet para fazer uma live pelo YouTube.",
"msg_sound": "",
"msg_image": "",
"msg_file": "",
"msg_video": "",
"msg_location_preview": "",
"msg_location_lat": "",
"msg_location_lng": "",
"msg_contact": [],
"quoted_msg_id": "",
"quoted_msg_text": "",
"quoted_msg_sound": "",
"quoted_msg_image": "",
"quoted_msg_file": "",
"quoted_msg_video": "",
"quoted_msg_location_preview": "",
"quoted_msg_location_lat": "",
"quoted_msg_location_lng": "",
"quoted_msg_contact": ""
},
{
"id": "774",
"date": "2020-08-31",
"internal_communication": "0",
"flux": "sent",
"type": "T",
"sent_by": "Rodrigo Gomide",
"received_by": "Roberto Fulano",
"msg_id": "",
"msg_text": "Vou pedir urg\u00eancia para a resolu\u00e7\u00e3o do seu caso. Posso ajudar em algo mais?",
"msg_sound": "",
"msg_image": "",
"msg_file": "",
"msg_video": "",
"msg_location_preview": "",
"msg_location_lat": "",
"msg_location_lng": "",
"msg_contact": [],
"quoted_msg_id": "",
"quoted_msg_text": "",
"quoted_msg_sound": "",
"quoted_msg_image": "",
"quoted_msg_file": "",
"quoted_msg_video": "",
"quoted_msg_location_preview": "",
"quoted_msg_location_lat": "",
"quoted_msg_location_lng": "",
"quoted_msg_contact": ""
},
{
"id": "775",
"date": "2020-08-31",
"internal_communication": "0",
"flux": "reply",
"type": "T",
"sent_by": "Roberto Fulano",
"received_by": "Rodrigo Gomide",
"msg_id": "3EB0A1C5728C56BBA05E",
"msg_text": "N\u00e3o, seria somente isso mesmo. Agrade\u00e7o.",
"msg_sound": "",
"msg_image": "",
"msg_file": "",
"msg_video": "",
"msg_location_preview": "",
"msg_location_lat": "",
"msg_location_lng": "",
"msg_contact": [],
"quoted_msg_id": "",
"quoted_msg_text": "",
"quoted_msg_sound": "",
"quoted_msg_image": "",
"quoted_msg_file": "",
"quoted_msg_video": "",
"quoted_msg_location_preview": "",
"quoted_msg_location_lat": "",
"quoted_msg_location_lng": "",
"quoted_msg_contact": ""
},
{
"id": "776",
"date": "2020-08-31",
"internal_communication": "0",
"flux": "sent",
"type": "T",
"sent_by": "Rodrigo Gomide",
"received_by": "Roberto Fulano",
"msg_id": "",
"msg_text": "Perfeitamente. Chame sempre que precisar.",
"msg_sound": "",
"msg_image": "",
"msg_file": "",
"msg_video": "",
"msg_location_preview": "",
"msg_location_lat": "",
"msg_location_lng": "",
"msg_contact": [],
"quoted_msg_id": "",
"quoted_msg_text": "",
"quoted_msg_sound": "",
"quoted_msg_image": "",
"quoted_msg_file": "",
"quoted_msg_video": "",
"quoted_msg_location_preview": "",
"quoted_msg_location_lat": "",
"quoted_msg_location_lng": "",
"quoted_msg_contact": ""
}
]
}
]
}
Este exemplo funcional em PHP 7.3 executa um post para a API e apresenta o retorno na tela para validação. Modifique o código para se adequar às suas necessidades. Para outras linguagens, adapte o código de acordo.
<?php
header('Content-Type: text/html; charset=utf-8');
# Parametros
$_TOKEN = 'xxxxxx';
$_CMD = 'get_prot';
$_DATA_INI = '2020-08-31';
$_DATA_FIM = '2020-08-31';
# URL
$_URL = 'https://app.maxbot.com.br/api/v1.php';
# START
$_TXT = "[POST]:<br/><br/>";
$_TXT .= " API_URL => ".$_URL."<br/>";
$_TXT .= " token => ".$_TOKEN."<br/>";
$_TXT .= " cmd => ".$_CMD."<br/>";
$_TXT .= "date_start => ".$_DATA_INI."<br/>";
$_TXT .= " date_stop => ".$_DATA_FIM."<br/>";
$_TXT .= "<br/>";
$_TXT .= "[retorno]:<br/><br/>";
$_TXT .= "<textarea rows=10 cols=90>";
echo $_TXT;
# Request API
$_REQUEST = array(
"token" => "$_TOKEN",
"cmd" => "$_CMD",
"date_start" => "$_DATA_INI",
"date_stop" => "$_DATA_FIM"
);
$json = json_encode($_REQUEST);
$ch = curl_init($_URL);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
curl_setopt($ch, CURLOPT_POSTFIELDS, $json);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Content-Type: application/json',
'Content-Length: ' . strlen($json))
);
$_result = curl_exec($ch);
curl_close($ch);
echo $_result;
echo "</textarea>";
exit;
?>
Utilize a requisição de listagem de canais para importar a relação de canais cadastrados na conta Maxbot.
{
"token": "xxxxxx",
"cmd": "get_channel"
"channel": ""
}
{
"status": 1,
"msg": "Success",
"data": [
{
"token": "202304B53BF66DB8C0-364F9B-15CBAD",
"title": "WhatsApp Web",
"info": [
"whatsapp": "553182096315"
]
},
{
"token": "2023047C66A1138D57-D7096D-DC39B4",
"title": "Telegram",
"info": [
"user": "usuario01_maxbot"
]
},
{
"token": "202304FE471FF7A477-5FA8BA-E72F90",
"title": "Facebook",
"info": [
"pages": "page1, page2, page3"
]
}
]
}
Este exemplo funcional em PHP 7.3 executa um post para a API e apresenta o retorno na tela para validação. Modifique o código para se adequar às suas necessidades. Para outras linguagens, adapte o código de acordo.
<?php
header('Content-Type: text/html; charset=utf-8');
# Parametros
$_TOKEN = 'xxxxxx';
$_CMD = 'get_channel';
$_CHANNEL = '1';
# URL
$_URL = 'https://app.maxbot.com.br/api/v1.php';
# START
$_TXT = "[POST]:<br/><br/>";
$_TXT .= " API_URL => ".$_URL."<br/>";
$_TXT .= " token => ".$_TOKEN."<br/>";
$_TXT .= " cmd => ".$_CMD."<br/>";
$_TXT .= " channel => ".$_CHANNEL."<br/>";
$_TXT .= "<br/>";
$_TXT .= "[retorno]:<br/><br/>";
$_TXT .= "<textarea rows=10 cols=90>";
echo $_TXT;
# Request API
$_REQUEST = array(
"token" => "$_TOKEN",
"cmd" => "$_CMD",
"channel" => "$_CHANNEL",
);
$json = json_encode($_REQUEST);
$ch = curl_init($_URL);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
curl_setopt($ch, CURLOPT_POSTFIELDS, $json);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Content-Type: application/json',
'Content-Length: ' . strlen($json))
);
$_result = curl_exec($ch);
curl_close($ch);
echo $_result;
echo "</textarea>";
exit;
?>
Utilize a requisição de listagem de anotações do protocolo para importar a relação de anotações cadastradas em um determinado protocolo.
{
"token": "xxxxxx",
"cmd": "get_protocol_annotation"
"prot_id": "123"
}
{
"status": 1,
"msg": "Success",
"data": [
{
"id": "1",
"date": "2023-04-17 08:00:00",
"attendant_name": "Rodrigo Gomide",
"text": "Anotação 01",
},
{
"id": "2",
"date": "2023-04-17 09:00:00",
"attendant_name": "Dilson Lana",
"text": "Anotação 02",
},
{
"id": "3",
"date": "2023-04-17 10:00:00",
"attendant_name": "Romulo Balga",
"text": "Anotação 03",
}
]
}
Este exemplo funcional em PHP 7.3 executa um post para a API e apresenta o retorno na tela para validação. Modifique o código para se adequar às suas necessidades. Para outras linguagens, adapte o código de acordo.
<?php
header('Content-Type: text/html; charset=utf-8');
# Parametros
$_TOKEN = 'xxxxxx';
$_CMD = 'get_protocol_annotation';
$_PROT_ID = '1234';
# URL
$_URL = 'https://app.maxbot.com.br/api/v1.php';
# START
$_TXT = "[POST]:<br/><br/>";
$_TXT .= " API_URL => ".$_URL."<br/>";
$_TXT .= " token => ".$_TOKEN."<br/>";
$_TXT .= " cmd => ".$_CMD."<br/>";
$_TXT .= " prot_id => ".$_PROT_ID."<br/>";
$_TXT .= "<br/>";
$_TXT .= "[retorno]:<br/><br/>";
$_TXT .= "<textarea rows=10 cols=90>";
echo $_TXT;
# Request API
$_REQUEST = array(
"token" => "$_TOKEN",
"cmd" => "$_CMD",
"prot_id" => "$_PROT_ID",
);
$json = json_encode($_REQUEST);
$ch = curl_init($_URL);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
curl_setopt($ch, CURLOPT_POSTFIELDS, $json);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Content-Type: application/json',
'Content-Length: ' . strlen($json))
);
$_result = curl_exec($ch);
curl_close($ch);
echo $_result;
echo "</textarea>";
exit;
?>
Utilize a requisição de listagem de contas do Instagram para importar a relação de contas cadastradas na plataforma Maxbot.
{
"token": "xxxxxx",
"cmd": "get_account_instagram"
}
{
"status": 1,
"msg": "Success",
"data": [
{
"id": "12345678901234542",
"title": "account_title_1"
},
{
"id": "09876543211234567",
"title": "account_title_2"
},
{
"id": "45678901234567897",
"title": "account_title_3"
}
]
}
Este exemplo funcional em PHP 7.3 executa um post para a API e apresenta o retorno na tela para validação. Modifique o código para se adequar às suas necessidades. Para outras linguagens, adapte o código de acordo.
<?php
header('Content-Type: text/html; charset=utf-8');
# Parametros
$_TOKEN = 'xxxxxx';
$_CMD = 'get_account_instagram';
# URL
$_URL = 'https://app.maxbot.com.br/api/v1.php';
# START
$_TXT = "[POST]:<br/><br/>";
$_TXT .= " API_URL => ".$_URL."<br/>";
$_TXT .= " token => ".$_TOKEN."<br/>";
$_TXT .= " cmd => ".$_CMD."<br/>";
$_TXT .= "<br/>";
$_TXT .= "[retorno]:<br/><br/>";
$_TXT .= "<textarea rows=10 cols=90>";
echo $_TXT;
# Request API
$_REQUEST = array(
"token" => "$_TOKEN",
"cmd" => "$_CMD",
);
$json = json_encode($_REQUEST);
$ch = curl_init($_URL);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
curl_setopt($ch, CURLOPT_POSTFIELDS, $json);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Content-Type: application/json',
'Content-Length: ' . strlen($json))
);
$_result = curl_exec($ch);
curl_close($ch);
echo $_result;
echo "</textarea>";
exit;
?>
Utilize a requisição de listagem de páginas do Facebook para importar a relação de páginas cadastradas na conta Maxbot.
{
"token": "xxxxxx",
"cmd": "get_page_facebook"
}
{
"status": 1,
"msg": "Success",
"data": [
{
"id": "283905712023100",
"title": "page_title_1"
},
{
"id": "567829013457896",
"title": "page_title_2"
},
{
"id": "874651089034901",
"title": "page_title_3"
}
]
}
Este exemplo funcional em PHP 7.3 executa um post para a API e apresenta o retorno na tela para validação. Modifique o código para se adequar às suas necessidades. Para outras linguagens, adapte o código de acordo.
<?php
header('Content-Type: text/html; charset=utf-8');
# Parametros
$_TOKEN = 'xxxxxx';
$_CMD = 'get_page_facebook';
# URL
$_URL = 'https://app.maxbot.com.br/api/v1.php';
# START
$_TXT = "[POST]:<br/><br/>";
$_TXT .= " API_URL => ".$_URL."<br/>";
$_TXT .= " token => ".$_TOKEN."<br/>";
$_TXT .= " cmd => ".$_CMD."<br/>";
$_TXT .= "<br/>";
$_TXT .= "[retorno]:<br/><br/>";
$_TXT .= "<textarea rows=10 cols=90>";
echo $_TXT;
# Request API
$_REQUEST = array(
"token" => "$_TOKEN",
"cmd" => "$_CMD",
);
$json = json_encode($_REQUEST);
$ch = curl_init($_URL);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
curl_setopt($ch, CURLOPT_POSTFIELDS, $json);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Content-Type: application/json',
'Content-Length: ' . strlen($json))
);
$_result = curl_exec($ch);
curl_close($ch);
echo $_result;
echo "</textarea>";
exit;
?>
Utilize a requisição de saldo Gupshup para obter o saldo da sua conta Gupshup.
{
"token": "xxxxxx",
"cmd": "get_balance_gupshup"
}
{
"status": 1,
"msg": "Success",
"currency_balance": "99.00 USD",
"balance": "99.00",
"currency": "USD",
}
Este exemplo funcional em PHP 7.3 executa um post para a API e apresenta o retorno na tela para validação. Modifique o código para se adequar às suas necessidades. Para outras linguagens, adapte o código de acordo.
<?php
header('Content-Type: text/html; charset=utf-8');
# Parametros
$_TOKEN = 'xxxxxx';
$_CMD = 'get_balance_gupshup';
# URL
$_URL = 'https://app.maxbot.com.br/api/v1.php';
# START
$_TXT = "[POST]:<br/><br/>";
$_TXT .= " API_URL => ".$_URL."<br/>";
$_TXT .= " token => ".$_TOKEN."<br/>";
$_TXT .= " cmd => ".$_CMD."<br/>";
$_TXT .= "<br/>";
$_TXT .= "[retorno]:<br/><br/>";
$_TXT .= "<textarea rows=10 cols=90>";
echo $_TXT;
# Request API
$_REQUEST = array(
"token" => "$_TOKEN",
"cmd" => "$_CMD",
);
$json = json_encode($_REQUEST);
$ch = curl_init($_URL);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
curl_setopt($ch, CURLOPT_POSTFIELDS, $json);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Content-Type: application/json',
'Content-Length: ' . strlen($json))
);
$_result = curl_exec($ch);
curl_close($ch);
echo $_result;
echo "</textarea>";
exit;
?>
Utilize a requisição de registro ou atualização da ficha do processo do controle de fluxo na conta Maxbot para criar novo processo em um tipo de fluxo específico ou para atualizar os dados do processo.
{
"token": "xxxx",
"cmd": "put_cfx_process",
"contact_id": "792",
"collaborator_id": "126",
"cfx_type_id": "4",
"cfx_stage_id": "1",
"title": "MAXBOT SAC 2021",
"prot_num": "",
"external_id_1": "",
"external_id_2": "",
"ind_display_value": "0",
"value": "",
"description": "",
"opening_date": "2024-12-18",
"delivery_date": "2024-12-18",
"closing_date": "2024-12-18",
"obs": "SAC 2021 OBS",
"archived": "0",
"archived_date": "2024-12-18"
}
{
"status": 1,
"msg": "Success",
"process_id": 111,
"process_num": "84"
}
Este exemplo funcional em PHP 7.3 executa um post para a API e apresenta o retorno na tela para validação. Modifique o código para se adequar às suas necessidades. Para outras linguagens, adapte o código de acordo.
<?php
header('Content-Type: text/html; charset=utf-8');
# Parametros
$_TOKEN = 'xxxxxx';
$_CMD = 'put_cfx_process';
$_CONTACT_ID = '792';
$_COLLABORATOR_ID = '126';
$_CFX_TYPE_ID = '4';
$_CFX_STAGE_ID = '17';
$_TITLE = 'MAXBOT SAC 2021';
$_PROT_NUM = '1351';
$_EXTERNAL_ID_1 = '1';
$_EXTERNAL_ID_2 = '2';
$_IND_DISPLAY_VALUE = '1';
$_VALUE = '100.00';
$_DESCRIPTION = ' ';
$_OPENING_DATE = "2024-12-18";
$_DELIVERY_DATE = "2024-12-18";
$_CLOSING_DATE = "2024-12-18";
$_OBS = 'SAC 2021 OBS';
$_ARCHIVED = '1';
$_ARCHIVED_DATE = "2024-12-18";
# URL
$_URL = 'https://app.maxbot.com.br/api/v1.php';
# START
$_TXT = "[POST]:<br/><br/>";
$_TXT .= " API_URL => ".$_URL."<br/>";
$_TXT .= " token => ".$_TOKEN."<br/>";
$_TXT .= " cmd => ".$_CMD."<br/>";
$_TXT .= " contact_id => ".$_CONTACT_ID."<br/>";
$_TXT .= " collaborator_id => ".$_COLLABORATOR_ID."<br/>";
$_TXT .= " cfx_type_id => ".$_CFX_TYPE_ID."<br/>";
$_TXT .= " cfx_stage_id => ".$_CFX_STAGE_ID."<br/>";
$_TXT .= " title => ".$_TITLE."<br/>";
$_TXT .= " prot_num => ".$_PROT_NUM."<br/>";
$_TXT .= " external_id_1 => ".$_EXTERNAL_ID_1."<br/>";
$_TXT .= " external_id_2 => ".$_EXTERNAL_ID_2."<br/>";
$_TXT .= "ind_display_value => ".$_IND_DISPLAY_VALUE."<br/>";
$_TXT .= " value => ".$_VALUE."<br/>";
$_TXT .= " description => ".$_DESCRIPTION."<br/>";
$_TXT .= " opening_date => ".$_OPENING_DATE."<br/>";
$_TXT .= " delivery_date => ".$_DELIVERY_DATE."<br/>";
$_TXT .= " closing_date => ".$_CLOSING_DATE."<br/>";
$_TXT .= " obs => ".$_OBS."<br/>";
$_TXT .= " archived => ".$_ARCHIVED."<br/>";
$_TXT .= " archived_date => ".$_ARCHIVED_DATE."<br/>";
$_TXT .= "<br/>";
$_TXT .= "[retorno]:<br/><br/>";
$_TXT .= "<textarea rows=10 cols=90>";
echo $_TXT;
# Request API
$_REQUEST = array(
"token" => "$_TOKEN",
"cmd" => "$_CMD",
"contact_id" => "$_CONTACT_ID",
"collaborator_id" => "$_COLLABORATOR_ID",
"cfx_type_id" => "$_CFX_TYPE_ID",
"cfx_stage_id" => "$_CFX_STAGE_ID",
"title" => "$_TITLE",
"prot_num" => "$_PROT_NUM",
"external_id_1" => "$_EXTERNAL_ID_1",
"external_id_2" => "$_EXTERNAL_ID_2",
"ind_display_value" => "$_IND_DISPLAY_VALUE",
"value" => "$_VALUE",
"description" => "$_DESCRIPTION",
"opening_date" => "$_OPENING_DATE",
"delivery_date" => "$_DELIVERY_DATE",
"closing_date" => "$_CLOSING_DATE",
"obs" => "$_OBS",
"archived" => "$_ARCHIVED",
"archived_date" => "$_ARCHIVED_DATE"
);
$json = json_encode($_REQUEST);
$ch = curl_init($_URL);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
curl_setopt($ch, CURLOPT_POSTFIELDS, $json);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Content-Type: application/json',
'Content-Length: ' . strlen($json))
);
$_result = curl_exec($ch);
curl_close($ch);
echo $_result;
echo "</textarea>";
exit;
?>
Utilize a requisição atualização da ficha do processo do controle de fluxo na conta Maxbot para atualizar os dados do processo.
{
"token": "xxxx",
"cmd": "set_cfx_process",
"for_process_id": "111"
"contact_id": "792",
"collaborator_id": "126",
"cfx_type_id": "4",
"cfx_stage_id": "1",
"title": "MAXBOT SAC 2021",
"prot_num": "",
"external_id_1": "",
"external_id_2": "",
"ind_display_value": "0",
"value": "",
"description": "",
"opening_date": "2024-12-18",
"delivery_date": "2024-12-18",
"closing_date": "2024-12-18",
"obs": "SAC 2021 OBS",
"archived": "0",
"archived_date": "2024-12-18"
}
{
"status": 1,
"msg": "Success",
"process_id": 111,
"process_num": "84"
}
Este exemplo funcional em PHP 7.3 executa um post para a API e apresenta o retorno na tela para validação. Modifique o código para se adequar às suas necessidades. Para outras linguagens, adapte o código de acordo.
<?php
header('Content-Type: text/html; charset=utf-8');
# Parametros
$_TOKEN = 'xxxxxx';
$_CMD = 'set_cfx_process';
$_FOR_PROCESS_ID = '111';
$_CONTACT_ID = '792';
$_COLLABORATOR_ID = '126';
$_CFX_TYPE_ID = '4';
$_CFX_STAGE_ID = '17';
$_TITLE = 'MAXBOT SAC 2021';
$_PROT_NUM = '1351';
$_EXTERNAL_ID_1 = '1';
$_EXTERNAL_ID_2 = '2';
$_IND_DISPLAY_VALUE = '1';
$_VALUE = '100.00';
$_DESCRIPTION = ' ';
$_OPENING_DATE = "2024-12-18";
$_DELIVERY_DATE = "2024-12-18";
$_CLOSING_DATE = "2024-12-18";
$_OBS = 'SAC 2021 OBS';
$_ARCHIVED = '1';
$_ARCHIVED_DATE = "2024-12-18";
# URL
$_URL = 'https://app.maxbot.com.br/api/v1.php';
# START
$_TXT = "[POST]:<br/><br/>";
$_TXT .= " API_URL => ".$_URL."<br/>";
$_TXT .= " token => ".$_TOKEN."<br/>";
$_TXT .= " cmd => ".$_CMD."<br/>";
$_TXT .= " for_process_id => ".$_FOR_PROCESS_ID."<br/>";
$_TXT .= " contact_id => ".$_CONTACT_ID."<br/>";
$_TXT .= " collaborator_id => ".$_COLLABORATOR_ID."<br/>";
$_TXT .= " cfx_type_id => ".$_CFX_TYPE_ID."<br/>";
$_TXT .= " cfx_stage_id => ".$_CFX_STAGE_ID."<br/>";
$_TXT .= " title => ".$_TITLE."<br/>";
$_TXT .= " prot_num => ".$_PROT_NUM."<br/>";
$_TXT .= " external_id_1 => ".$_EXTERNAL_ID_1."<br/>";
$_TXT .= " external_id_2 => ".$_EXTERNAL_ID_2."<br/>";
$_TXT .= "ind_display_value => ".$_IND_DISPLAY_VALUE."<br/>";
$_TXT .= " value => ".$_VALUE."<br/>";
$_TXT .= " description => ".$_DESCRIPTION."<br/>";
$_TXT .= " opening_date => ".$_OPENING_DATE."<br/>";
$_TXT .= " delivery_date => ".$_DELIVERY_DATE."<br/>";
$_TXT .= " closing_date => ".$_CLOSING_DATE."<br/>";
$_TXT .= " obs => ".$_OBS."<br/>";
$_TXT .= " archived => ".$_ARCHIVED."<br/>";
$_TXT .= " archived_date => ".$_ARCHIVED_DATE."<br/>";
$_TXT .= "<br/>";
$_TXT .= "[retorno]:<br/><br/>";
$_TXT .= "<textarea rows=10 cols=90>";
echo $_TXT;
# Request API
$_REQUEST = array(
"token" => "$_TOKEN",
"cmd" => "$_CMD",
"for_process_id" => "$_FOR_PROCESS_ID",
"contact_id" => "$_CONTACT_ID",
"collaborator_id" => "$_COLLABORATOR_ID",
"cfx_type_id" => "$_CFX_TYPE_ID",
"cfx_stage_id" => "$_CFX_STAGE_ID",
"title" => "$_TITLE",
"prot_num" => "$_PROT_NUM",
"external_id_1" => "$_EXTERNAL_ID_1",
"external_id_2" => "$_EXTERNAL_ID_2",
"ind_display_value" => "$_IND_DISPLAY_VALUE",
"value" => "$_VALUE",
"description" => "$_DESCRIPTION",
"opening_date" => "$_OPENING_DATE",
"delivery_date" => "$_DELIVERY_DATE",
"closing_date" => "$_CLOSING_DATE",
"obs" => "$_OBS",
"archived" => "$_ARCHIVED",
"archived_date" => "$_ARCHIVED_DATE"
);
$json = json_encode($_REQUEST);
$ch = curl_init($_URL);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
curl_setopt($ch, CURLOPT_POSTFIELDS, $json);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Content-Type: application/json',
'Content-Length: ' . strlen($json))
);
$_result = curl_exec($ch);
curl_close($ch);
echo $_result;
echo "</textarea>";
exit;
?>
Utilize a requisição de criação de anotação de um protocolo para criar um nova anotação do protocolo no Maxbot.
{
"token": "xxxxxx",
"cmd": "put_protocol_annotation"
"prot_id": "123"
"anot_text": "example annotation"
}
{
"status": 1,
"msg": "Success",
"prot_id": "1",
"anot_id": "1"
}
Este exemplo funcional em PHP 7.3 executa um post para a API e apresenta o retorno na tela para validação. Modifique o código para se adequar às suas necessidades. Para outras linguagens, adapte o código de acordo.
<?php
header('Content-Type: text/html; charset=utf-8');
# Parametros
$_TOKEN = 'xxxxxx';
$_CMD = 'put_protocol_annotation';
$_PROT_ID = '1234';
$_ANOT_TEXT = 'example annotation';
# URL
$_URL = 'https://app.maxbot.com.br/api/v1.php';
# START
$_TXT = "[POST]:<br/><br/>";
$_TXT .= " API_URL => ".$_URL."<br/>";
$_TXT .= " token => ".$_TOKEN."<br/>";
$_TXT .= " cmd => ".$_CMD."<br/>";
$_TXT .= " prot_id => ".$_PROT_ID."<br/>";
$_TXT .= " anot_text => ".$_ANOT_TEXT."<br/>";
$_TXT .= "<br/>";
$_TXT .= "[retorno]:<br/><br/>";
$_TXT .= "<textarea rows=10 cols=90>";
echo $_TXT;
# Request API
$_REQUEST = array(
"token" => "$_TOKEN",
"cmd" => "$_CMD",
"prot_id" => "$_PROT_ID",
"anot_text" => "$_ANOT_TEXT",
);
$json = json_encode($_REQUEST);
$ch = curl_init($_URL);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
curl_setopt($ch, CURLOPT_POSTFIELDS, $json);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Content-Type: application/json',
'Content-Length: ' . strlen($json))
);
$_result = curl_exec($ch);
curl_close($ch);
echo $_result;
echo "</textarea>";
exit;
?>
Utilize a requisição de criação de ficha de contato para criar um novo contato no Maxbot.
{
"token": "xxxx",
"cmd": "put_contact",
"segmentation": "Negocia\u00e7\u00e3o, Proposta Enviada",
"tag": "VIP",
"tag2": "VIP2",
"name": "Jose",
"surname": "Silva",
"gender": "M",
"gender_info": "M",
"birth": "1974-06-15",
"br_person_type": "J",
"br_cpf": "11122233300",
"br_cnpj": "00111222000133",
"company": "Empresa Minha Ltda",
"email": "jose@email.com",
"whatsapp_channel": "AAAAAAAAAAAAAAAAA-BBBBBB-CCCCCC",
"whatsapp": "5531911111122",
"telegram_channel": "",
"telegram_id": "",
"fbmessenger_channel": "",
"fbmessenger_origem_page_id": "",
"fbmessenger_id": "",
"instagram_channel": "",
"instagram_origem_business_account_id": "",
"instagram_id": "",
"mobile_phone": "5531911111122",
"phone": "553155551122",
"country": "BR",
"state": "MG",
"city": "Belo Horizonte",
"profession": "ESPORTE",
"external_id": "667811",
"ind_client": "0",
"client_code": "",
"avatar_url": "https:\/\/www.meusite.com.br\/foto.jpg",
"obs": "Enviar proposta comercial na segunda",
"tag_info1": "",
"tag_info2": "",
"tag_info3": "",
"tag_info4": "",
"tag_info5": "",
"tag_info6": ""
}
{
"status": 1,
"msg": "Success",
"contact_id": 1234
}
Este exemplo funcional em PHP 7.3 executa um post para a API e apresenta o retorno na tela para validação. Modifique o código para se adequar às suas necessidades. Para outras linguagens, adapte o código de acordo.
<?php
header('Content-Type: text/html; charset=utf-8');
# Parametros
$_TOKEN = 'xxxxxx';
$_CMD = 'put_contact';
$_SEG_LIST = 'Negociação,Proposta Enviada';
$_TAG = 'VIP';
$_TAG2 = 'VIP2';
$_NOME = 'Jose';
$_SOBRENOME = 'Silva';
$_SEXO = 'M';
$_NASC = '1974-06-15';
$_PESSOA = 'J';
$_CPF = '87348769527';
$_CNPJ = '64420582000148';
$_EMPRESA = 'Empresa Minha Ltda';
$_EMAIL = 'jose@email.com';
$_WHATSAPP_CHANNEL = 'AAAAAAAAAAAAAAAAA-BBBBBB-CCCCCC';
$_WHATSAPP = '5531911111122';
$_TELEGRAM_CHANNEL = '';
$_TELEGRAM_ID = '';
$_FBMESSENGER_CHANNEL = '';
$_FBMESSENGER_ORIGEM_PAGE_ID = '';
$_FBMESSENGER_ID = '';
$_INSTAGRAM_CHANNEL = '';
$_INSTAGRAM_ORIGEM_BUSINESS_ACCOUNT_ID = '';
$_INSTAGRAM_ID = '';
$_CELULAR = '5531911111122';
$_FIXO = '553155551122';
$_PAIS = 'BR';
$_ESTADO = 'MG';
$_CIDADE = 'Belo Horizonte';
$_PROFISSAO = 'ESPORTE';
$_IDEXTERNO = '667811';
$_AVATAR_URL = 'https://www.meusite.com.br/foto.jpg';
$_OBS = 'Enviar proposta comercial na segunda';
# URL
$_URL = 'https://app.maxbot.com.br/api/v1.php';
# START
$_TXT = "[POST]:<br/><br/>";
$_TXT .= " API_URL => ".$_URL."<br/>";
$_TXT .= " token => ".$_TOKEN."<br/>";
$_TXT .= " cmd => ".$_CMD."<br/>";
$_TXT .= " segmentation => ".$_SEG_LIST."<br/>";
$_TXT .= " tag => ".$_TAG."<br/>";
$_TXT .= " tag2 => ".$_TAG2."<br/>";
$_TXT .= " name => ".$_NOME."<br/>";
$_TXT .= " surname => ".$_SOBRENOME."<br/>";
$_TXT .= " gender => ".$_SEXO."<br/>";
$_TXT .= " birth => ".$_NASC."<br/>";
$_TXT .= " br_person_type => ".$_PESSOA."<br/>";
$_TXT .= " br_cpf => ".$_CPF."<br/>";
$_TXT .= " br_cnpj => ".$_CNPJ."<br/>";
$_TXT .= " company => ".$_EMPRESA."<br/>";
$_TXT .= " email => ".$_EMAIL."<br/>";
$_TXT .= " whatsapp_channel => ".$_WHATSAPP_CHANNEL."<br/>";
$_TXT .= " whatsapp => ".$_WHATSAPP."<br/>";
$_TXT .= " telegram_channel => ".$_TELEGRAM_CHANNEL."<br/>";
$_TXT .= " telegram_id => ".$_TELEGRAM_ID."<br/>";
$_TXT .= " fbmessenger_channel => ".$_FBMESSENGER_CHANNEL."<br/>";
$_TXT .= " fbmessenger_origem_page_id => ".$_FBMESSENGER_ORIGEM_PAGE_ID."<br/>";
$_TXT .= " fbmessenger_id => ".$_FBMESSENGER_ID."<br/>";
$_TXT .= " instagram_channel => ".$_INSTAGRAM_CHANNEL."<br/>";
$_TXT .= "instagram_origem_business_account_id => ".$_INSTAGRAM_ORIGEM_BUSINESS_ACCOUNT_ID."<br/>";
$_TXT .= " instagram_id => ".$_INSTAGRAM_ID."<br/>";
$_TXT .= " mobile_phone => ".$_CELULAR."<br/>";
$_TXT .= " phone => ".$_FIXO."<br/>";
$_TXT .= " country => ".$_PAIS."<br/>";
$_TXT .= " state => ".$_ESTADO."<br/>";
$_TXT .= " city => ".$_CIDADE."<br/>";
$_TXT .= " profession => ".$_PROFISSAO."<br/>";
$_TXT .= " external_id => ".$_IDEXTERNO."<br/>";
$_TXT .= " avatar_url => ".$_AVATAR_URL."<br/>";
$_TXT .= " obs => ".$_OBS."<br/>";
$_TXT .= "<br/>";
$_TXT .= "[retorno]:<br/><br/>";
$_TXT .= "<textarea rows=10 cols=90>";
echo $_TXT;
# Request API
$_REQUEST = array(
"token" => "$_TOKEN",
"cmd" => "$_CMD",
"segmentation" => "$_SEG_LIST",
"tag" => "$_TAG",
"tag2" => "$_TAG2",
"name" => "$_NOME",
"surname" => "$_SOBRENOME",
"gender" => "$_SEXO",
"birth" => "$_NASC",
"br_person_type" => "$_PESSOA",
"br_cpf" => "$_CPF",
"br_cnpj" => "$_CNPJ",
"company" => "$_EMPRESA",
"email" => "$_EMAIL",
"whatsapp_channel" => "$_WHATSAPP_CHANNEL",
"whatsapp" => "$_WHATSAPP",
"telegram_channel" => "$_TELEGRAM_CHANNEL",
"telegram_id" => "$_TELEGRAM_ID",
fbmessenger_channel" => "$_FBMESSENGER_CHANNEL",
bmessenger_origem_page_id" => "$_FBMESSENGER_ORIGEM_PAGE_ID",
"fbmessenger_id" => "$_FBMESSENGER_ID",
"instagram_channel" => "$_INSTAGRAM_CHANNEL",
"instagram_origem_business_account_id" => "$_INSTAGRAM_ORIGEM_BUSINESS_ACCOUNT_ID",
"instagram_id" => "$_INSTAGRAM_ID",
"mobile_phone" => "$_CELULAR",
"phone" => "$_FIXO",
"country" => "$_PAIS",
"state" => "$_ESTADO",
"city" => "$_CIDADE",
"profession" => "$_PROFISSAO",
"external_id" => "$_IDEXTERNO",
"avatar_url" => "$_AVATAR_URL",
"obs" => "$_OBS"
);
$json = json_encode($_REQUEST);
$ch = curl_init($_URL);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
curl_setopt($ch, CURLOPT_POSTFIELDS, $json);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Content-Type: application/json',
'Content-Length: ' . strlen($json))
);
$_result = curl_exec($ch);
curl_close($ch);
echo $_result;
echo "</textarea>";
exit;
?>
Utilize a requisição de atualização de dados de contato atualizar dados de ficha de um contato existente.
{
"token": "xxxx",
"cmd": "set_contact",
"for_contact_id": "1234",
"segmentation": Negocia\u00e7\u00e3o, Proposta Enviada,
"tag": "VIP",
"tag2": "VIP2",
"name": "Jose",
"surname": "Silva",
"gender": "M",
"gender_info":"",
"birth": "1974-06-15",
"br_person_type": "J",
"br_cpf": "11122233300",
"br_cnpj": "00111222000133",
"company": "Empresa Minha Ltda",
"email": "jose@email.com",
"whatsapp_channel": "AAAAAAAAAAAAAAAAA-BBBBBB-CCCCCC",
"whatsapp": "5531911111122",
"telegram_channel": "",
"telegram_id": "",
"fbmessenger_channel": "",
"fbmessenger_origem_page_id": "",
"fbmessenger_id": "",
"instagram_channel": "",
"instagram_origem_business_account_id": "",
"mobile_phone": "5531911111122",
"phone": "553155551122",
"country": "BR",
"state": "MG",
"city": "Belo Horizonte",
"profession": "ESPORTE",
"external_id": "667811",
"ind_client":"1",
"client_code":"202104-e1b4e2",
"avatar_url": "https:\/\/www.meusite.com.br\/foto.jpg",
"obs": "Enviar proposta comercial na segunda",
"tag_info1": "",
"tag_info2": "",
"tag_info3": "",
"tag_info4": "",
"tag_info5": "",
"tag_info6": ""
}
{
"status": 1,
"msg": "Success"
}
Este exemplo funcional em PHP 7.3 executa um post para a API e apresenta o retorno na tela para validação. Modifique o código para se adequar às suas necessidades. Para outras linguagens, adapte o código de acordo.
<?php
header('Content-Type: text/html; charset=utf-8');
# Parametros
$_TOKEN = 'xxxxxx';
$_CMD = 'set_contact';
$_CONTATO_ID = '12345';
$_SEG_LIST = 'Negociação,Proposta Enviada';
$_TAG = 'VIP';
$_TAG2 = 'VIP2';
$_NOME = 'Jose';
$_SOBRENOME = 'Silva';
$_SEXO = 'M';
$_NASC = '1974-06-15';
$_PESSOA = 'J';
$_CPF = '87348769527';
$_CNPJ = '64420582000148';
$_EMPRESA = 'Empresa Minha Ltda';
$_EMAIL = 'jose@email.com';
$_WHATSAPP_CHANNEL = 'AAAAAAAAAAAAAAAAA-BBBBBB-CCCCCC';
$_WHATSAPP = '5531911111122';
$_TELEGRAM_CHANNEL = '';
$_TELEGRAM_ID = '';
$_FBMESSENGER_CHANNEL = '';
$_FBMESSENGER_ORIGEM_PAGE_ID = '';
$_FBMESSENGER_ID = '';
$_INSTAGRAM_CHANNEL = '';
$_INSTAGRAM_ORIGEM_BUSINESS_ACCOUNT_ID = '';
$_INSTAGRAM_ID = '';
$_CELULAR = '5531911111122';
$_FIXO = '553155551122';
$_PAIS = 'BR';
$_ESTADO = 'MG';
$_CIDADE = 'Belo Horizonte';
$_PROFISSAO = 'ESPORTE';
$_IDEXTERNO = '667811';
$_AVATAR_URL = 'https://www.meusite.com.br/foto.jpg';
$_OBS = 'Enviar proposta comercial na segunda';
$_TAG_INFO1 = '';
$_TAG_INFO2 = '';
$_TAG_INFO3 = '';
$_TAG_INFO3 = '';
# URL
$_URL = 'https://app.maxbot.com.br/api/v1.php';
# START
$_TXT = "[POST]:<br/><br/>";
$_TXT .= " API_URL => ".$_URL."<br/>";
$_TXT .= " token => ".$_TOKEN."<br/>";
$_TXT .= " cmd => ".$_CMD."<br/>";
$_TXT .= " for_contact_id => ".$_CONTATO_ID."<br/>";
$_TXT .= " segmentation => ".$_SEG_LIST."<br/>";
$_TXT .= " tag => ".$_TAG."<br/>";
$_TXT .= " tag2 => ".$_TAG2."<br/>";
$_TXT .= " name => ".$_NOME."<br/>";
$_TXT .= " surname => ".$_SOBRENOME."<br/>";
$_TXT .= " gender => ".$_SEXO."<br/>";
$_TXT .= " birth => ".$_NASC."<br/>";
$_TXT .= " br_person_type => ".$_PESSOA."<br/>";
$_TXT .= " br_cpf => ".$_CPF."<br/>";
$_TXT .= " br_cnpj => ".$_CNPJ."<br/>";
$_TXT .= " company => ".$_EMPRESA."<br/>";
$_TXT .= " email => ".$_EMAIL."<br/>";
$_TXT .= " whatsapp_channel => ".$_WHATSAPP_CHANNEL."<br/>";
$_TXT .= " whatsapp => ".$_WHATSAPP."<br/>";
$_TXT .= " telegram_channel => ".$_TELEGRAM_CHANNEL."<br/>";
$_TXT .= " telegram_id => ".$_TELEGRAM_ID."<br/>";
$_TXT .= " fbmessenger_channel => ".$_FBMESSENGER_CHANNEL."<br/>";
$_TXT .= " fbmessenger_origem_page_id => ".$_FBMESSENGER_ORIGEM_PAGE_ID."<br/>";
$_TXT .= " fbmessenger_id => ".$_FBMESSENGER_ID."<br/>";
$_TXT .= " instagram_channel => ".$_INSTAGRAM_CHANNEL."<br/>";
$_TXT .= "instagram_origem_business_account_id => ".$_INSTAGRAM_ORIGEM_BUSINESS_ACCOUNT_ID."<br/>";
$_TXT .= " instagram_id => ".$_INSTAGRAM_ID."<br/>";
$_TXT .= " mobile_phone => ".$_CELULAR."<br/>";
$_TXT .= " phone => ".$_FIXO."<br/>";
$_TXT .= " country => ".$_PAIS."<br/>";
$_TXT .= " state => ".$_ESTADO."<br/>";
$_TXT .= " city => ".$_CIDADE."<br/>";
$_TXT .= " profession => ".$_PROFISSAO."<br/>";
$_TXT .= " external_id => ".$_IDEXTERNO."<br/>";
$_TXT .= " avatar_url => ".$_AVATAR_URL."<br/>";
$_TXT .= " obs => ".$_OBS."<br/>";
$_TXT .= "<br/>";
$_TXT .= "[retorno]:<br/><br/>";
$_TXT .= "<textarea rows=10 cols=90>";
echo $_TXT;
# Request API
$_REQUEST = array(
"token" => "$_TOKEN",
"cmd" => "$_CMD",
"for_contact_id" => "$_CONTATO_ID",
"segmentation" => "$_SEG_LIST",
"tag" => "$_TAG",
"tag2" => "$_TAG2",
"name" => "$_NOME",
"surname" => "$_SOBRENOME",
"gender" => "$_SEXO",
"birth" => "$_NASC",
"br_person_type" => "$_PESSOA",
"br_cpf" => "$_CPF",
"br_cnpj" => "$_CNPJ",
"company" => "$_EMPRESA",
"email" => "$_EMAIL",
"whatsapp_channel" => "$_WHATSAPP_CHANNEL",
"whatsapp" => "$_WHATSAPP",
"telegram_channel" => "$_TELEGRAM_CHANNEL",
"telegram_id" => "$_TELEGRAM_ID",
fbmessenger_channel" => "$_FBMESSENGER_CHANNEL",
bmessenger_origem_page_id" => "$_FBMESSENGER_ORIGEM_PAGE_ID",
"fbmessenger_id" => "$_FBMESSENGER_ID",
"instagram_channel" => "$_INSTAGRAM_CHANNEL",
"instagram_origem_business_account_id" => "$_INSTAGRAM_ORIGEM_BUSINESS_ACCOUNT_ID",
"instagram_id" => "$_INSTAGRAM_ID",
"mobile_phone" => "$_CELULAR",
"phone" => "$_FIXO",
"country" => "$_PAIS",
"state" => "$_ESTADO",
"city" => "$_CIDADE",
"profession" => "$_PROFISSAO",
"external_id" => "$_IDEXTERNO",
"avatar_url" => "$_AVATAR_URL",
"obs" => "$_OBS"
);
$json = json_encode($_REQUEST);
$ch = curl_init($_URL);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
curl_setopt($ch, CURLOPT_POSTFIELDS, $json);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Content-Type: application/json',
'Content-Length: ' . strlen($json))
);
$_result = curl_exec($ch);
curl_close($ch);
echo $_result;
echo "</textarea>";
exit;
?>
Utilize a requisição de deletar contato para excluir uma lista de contatos no Maxbot.
{
"token": "xxxx",
"cmd": "delete_contact",
"contact_id": [123,134,532,874]
}
{
"status": 1,
"msg": "Success"
}
Este exemplo funcional em PHP 7.3 executa um post para a API e apresenta o retorno na tela para validação. Modifique o código para se adequar às suas necessidades. Para outras linguagens, adapte o código de acordo.
<?php
header('Content-Type: text/html; charset=utf-8');
# Parametros
$_TOKEN = "xxxxxx";
$_CMD = "delete_contact";
$_CONTACT_ID = array(123,134,532,874);
# URL
$_URL = 'https://app.maxbot.com.br/api/v1.php';
# START
$_TXT = "[POST]:<br/><br/>";
$_TXT .= " API_URL => ".$_URL."<br/>";
$_TXT .= " token => ".$_TOKEN."<br/>";
$_TXT .= " cmd => ".$_CMD."<br/>";
$_TXT .= " contact_id => ".print_r($_CONTACT_ID, true)."<br/>";
$_TXT .= "<br/>";
$_TXT .= "[retorno]:<br/><br/>";
$_TXT .= "<textarea rows=10 cols=90>";
echo $_TXT;
# Request API
$_REQUEST = array(
"token" => "$_TOKEN",
"cmd" => "$_CMD",
"contact_id" => (array) $_CONTACT_ID
);
$json = json_encode($_REQUEST);
$ch = curl_init($_URL);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
curl_setopt($ch, CURLOPT_POSTFIELDS, $json);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Content-Type: application/json',
'Content-Length: ' . strlen($json))
);
$_result = curl_exec($ch);
curl_close($ch);
echo $_result;
echo "</textarea>";
exit;
?>
Utilize a requisição de abertura de protocolo de follow up para enviar um template de follow up ou template de autenticação seguido da abertura automática de um protocolo de atendimento para um contato. Você pode disparar templates para qualquer contato previamente existente na sua base de contatos.
{
"token": "xxxx",
"cmd": "open_followup",
"channel_token": "202304FE471FF7A477-5FA8BA-E72F90",
"contact_id": 1234,
"template_id": 1234,
"sector_id": 1234,
"attendant_id": 0,
"scheduled": 1,
"scheduled": 1,
"date_time": "2020-12-01 13:00:00",
"user_otp_code": "12345678"
}
{
"status": 1,
"msg": "Success",
"prot_id": "1234",
"protocol": "1234"
}
Este exemplo funcional em PHP 7.3 executa um post para a API e apresenta o retorno na tela para validação. Modifique o código para se adequar às suas necessidades. Para outras linguagens, adapte o código de acordo.
<?php
header('Content-Type: text/html; charset=utf-8');
# Parametros
$_TOKEN = 'xxxxxx';
$_CMD = 'open_followup';
$_CT_ID = '1234';
$_TP_ID = '1234';
$_ST_ID = '1234';
$_AT_ID = '0';
$_SCHEDULED = '0';
$_DATE_TIME = '2020-12-01 08:30:00';
$_USER_OTP_CODE = '12345678';
# URL
$_URL = 'https://app.maxbot.com.br/api/v1.php';
# START
$_TXT = "[POST]:<br/><br/>";
$_TXT .= " API_URL => ".$_URL."<br/>";
$_TXT .= " token => ".$_TOKEN."<br/>";
$_TXT .= " cmd => ".$_CMD."<br/>";
$_TXT .= " contact_id => ".$_CT_ID."<br/>";
$_TXT .= " template_id => ".$_TP_ID."<br/>";
$_TXT .= " sector_id => ".$_ST_ID."<br/>";
$_TXT .= " attendant_id => ".$_AT_ID."<br/>";
$_TXT .= " scheduled => ".$_SCHEDULED."<br/>";
$_TXT .= " date_time => ".$_DATE_TIME."<br/>";
$_TXT .= " user_otp_code => ".$_USER_OTP_CODE."<br/>";
$_TXT .= "<br/>";
$_TXT .= "[retorno]:<br/><br/>";
$_TXT .= "<textarea rows=10 cols=90>";
echo $_TXT;
# Request API
$_REQUEST = array(
"token" => "$_TOKEN",
"cmd" => "$_CMD",
"contact_id" => "$_CT_ID",
"template_id" => "$_TP_ID",
"sector_id" => "$_ST_ID",
"attendant_id" => "$_AT_ID",
"scheduled" => "$_SCHEDULED",
"date_time" => "$_DATE_TIME",
"user_otp_code" => "$_USER_OTP_CODE",
);
$json = json_encode($_REQUEST);
$ch = curl_init($_URL);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
curl_setopt($ch, CURLOPT_POSTFIELDS, $json);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Content-Type: application/json',
'Content-Length: ' . strlen($json))
);
$_result = curl_exec($ch);
curl_close($ch);
echo $_result;
echo "</textarea>";
exit;
?>
Utilize a requisição de Encerrar protocolo para encerrar um protocolo.
{
"token": "xxx",
"cmd": "terminate_prot",
"ind_env_msg": "1",
"prot_id": "1234"
}
{
"status": 1,
"msg": "Success"
}
Este exemplo funcional em PHP 7.3 executa um post para a API e apresenta o retorno na tela para validação. Modifique o código para se adequar às suas necessidades. Para outras linguagens, adapte o código de acordo.
<?php
header('Content-Type: text/html; charset=utf-8');
# Parametros
$_TOKEN = 'xxxxxx';
$_CMD = 'terminate_prot';
$_IND_ENV_MSG = '1';
$_PROT_ID = '1234';
# URL
$_URL = 'https://app.maxbot.com.br/api/v1.php';
# START
$_TXT = "[POST]:<br/><br/>";
$_TXT .= " API_URL => ".$_URL."<br/>";
$_TXT .= " token => ".$_TOKEN."<br/>";
$_TXT .= " cmd => ".$_CMD."<br/>";
$_TXT .= " ind_env_msg => ".$_IND_ENV_MSG."<br/>";
$_TXT .= " prot_id => ".$_PROT_ID.""<br/>";
$_TXT .= "<br/>";
$_TXT .= "[retorno]:<br/><br/>";
$_TXT .= "<textarea rows=10 cols=90>";
echo $_TXT;
# Request API
$_REQUEST = array(
"token" => "$_TOKEN",
"cmd" => "$_CMD",
"ind_env_msg" => "$_IND_ENV_MSG",
"prot_id" => "$_PROT_ID"
);
$json = json_encode($_REQUEST);
$ch = curl_init($_URL);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
curl_setopt($ch, CURLOPT_POSTFIELDS, $json);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Content-Type: application/json',
'Content-Length: ' . strlen($json))
);
$_result = curl_exec($ch);
curl_close($ch);
echo $_result;
echo "</textarea>";
exit;
?>
Utilize a requisição de listagem de cobranças para importar todas as cobranças cadastrada no módulo cobrança inteligente.
{
"token": "xxxx",
"cmd": "get_charge_list",
"date_start": "2021-10-01",
"date_stop": "2021-10-16",
"focus_of_period": "1",
"send": "",
"payment": "",
"invoice": "",
"whatsapp": "",
"mobile_phone": "",
"email": "",
"origin": "",
}
{
"status": 1,
"msg": "Success",
"data": [
{
"client_country": "BR",
"client_client_name": "Jose Silva",
"client_name": "Jose",
"client_last_name": "Silva",
"client_br_person_type": "J",
"client_br_cpf": "11122233300",
"client_br_cnpj": "00111222000133",
"client_company": "Empresa Minha Ltda",
"client_whatsapp": "5531911116666",
"client_mobile_phone": "5531911116666",
"client_email": "jose@email.com",
"client_code1": "1231",
"client_code2": "12321",
"client_code3": "AV930",
"charge_id": "2342",
"charge_origin": "Manual",
"charge_invoice": "12342",
"charge_due_date": "2022-07-13",
"charge_amount": "120.00",
"charge_link_pdf": "https:\/\/www.meusite.com.br\/charge.pdf",
"charge_bar_code": "11791.21928 50010.794810 63000.046902 7 90520000030100",
"ind_pg": "1",
"pg_date": "2022-07-13",
"pg_amount": "120.00",
"cnc_date": "",
"cnc_reason": "",
"nf_link_pdf": "https:\/\/www.meusite.com.br\/nfe.pdf",
"nf_link_xml": "https:\/\/www.meusite.com.br\/nfe.xml",
"msg_charge_1": [
{
"status": "5",
"date": "2022-07-11",
"info": "Late Date"
}
],
"msg_charge_2": [
{
"status": "1",
"date": "2022-07-29",
"info": ""
}
],
"msg_alert_1": [
{
"status": "1",
"date": "2022-08-29",
"info": ""
}
],
"msg_alert_2": [
{
"status": "1",
"date": "2022-09-29",
"info": ""
}
],
"msg_pg": [
{
"status": "2",
"date": "",
"info": "Waiting"
}
],
"msg_cnc": [
{
"status": "2",
"date": "",
"info": "Waiting"
}
],
"msg_nf": [
{
"status": "3",
"date": "2022-07-29",
"info": ""
}
]
}
]
}
Este exemplo funcional em PHP 7.3 executa um post para a API e apresenta o retorno na tela para validação. Modifique o código para se adequar às suas necessidades. Para outras linguagens, adapte o código de acordo.
<?php
header('Content-Type: text/html; charset=utf-8');
# Parametros
$_TOKEN = 'xxxxxx';
$_CMD = 'get_charge_list';
$_DATE_START = '2021-10-01';
$_DATE_STOP = '2021-10-16';
$_FOCUS_OF_PERIOD = '1';
$_SEND = '';
$_PAYMENT = '';
$_INVOICE = '';
$_WHATSAPP = '';
$_MOBILE_PHONE = '';
$_EMAIL = '';
$_ORIGIN = '';
# URL
$_URL = 'https://app.maxbot.com.br/api/v1.php';
# START
$_TXT = "[POST]:<br/><br/>";
$_TXT .= " API_URL => ".$_URL."<br/>";
$_TXT .= " cmd => ".$_CMD."<br/>";
$_TXT .= " token => ".$_TOKEN."<br/>";
$_TXT .= " date_start => ".$_DATE_START."<br/>";
$_TXT .= " date_stop => ".$_DATE_STOP."<br/>";
$_TXT .= " focus_of_period => ".$_FOCUS_OF_PERIOD."<br/>";
$_TXT .= " send => ".$_SEND."<br/>";
$_TXT .= " payment => ".$_PAYMENT."<br/>";
$_TXT .= " invoice => ".$_INVOICE."<br/>";
$_TXT .= " whatsapp => ".$_WHATSAPP."<br/>";
$_TXT .= " mobile_phone => ".$_MOBILE_PHONE."<br/>";
$_TXT .= " email => ".$_EMAIL."<br/>";
$_TXT .= " origin => ".$_ORIGIN."<br/>";
$_TXT .= "<br/>";
$_TXT .= "[retorno]:<br/><br/>";
$_TXT .= "<textarea rows=10 cols=90>";
echo $_TXT;
# Request API
$_REQUEST = array(
"token" => "$_TOKEN",
"cmd" => "$_CMD",
"date_start" => "$_DATE_START",
"date_stop" => "$_DATE_STOP",
"focus_of_period" => "$_FOCUS_OF_PERIOD",
"send" => "$_SEND",
"payment" => "$_PAYMENT",
"invoice" => "$_INVOICE",
"whatsapp" => "$_WHATSAPP",
"mobile_phone" => "$_MOBILE_PHONE",
"email" => "$_EMAIL",
"origin" => "$_ORIGIN",
);
$json = json_encode($_REQUEST);
$ch = curl_init($_URL);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
curl_setopt($ch, CURLOPT_POSTFIELDS, $json);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Content-Type: application/json',
'Content-Length: ' . strlen($json))
);
$_result = curl_exec($ch);
curl_close($ch);
echo $_result;
echo "</textarea>";
exit;
?>
Utilize a requisição para importar os dados de uma cobrança indicado do cobrança inteligente da conta Maxbot.
{
"token": "xxxx",
"cmd": "get_charge",
"charge_id": "000"
}
{
"status": 1,
"msg": "Success",
"data": [
{
"client_country": "BR",
"client_client_name": "Jose Silva",
"client_name": "Jose",
"client_last_name": "Silva",
"client_br_person_type": "J",
"client_br_cpf": "11122233300",
"client_br_cnpj": "00111222000133",
"client_company": "Empresa Minha Ltda",
"client_whatsapp": "5531911116666",
"client_mobile_phone": "5531911116666",
"client_email": "jose@email.com",
"client_code1": "1231",
"client_code2": "12321",
"client_code3": "AV930",
"charge_id": "2342",
"charge_origin": "M",
"charge_invoice": "12342",
"charge_due_date": "2022-07-13",
"charge_amount": "120.00",
"charge_link_pdf": "https:\/\/www.meusite.com.br\/charge.pdf",
"charge_bar_code": "11791.21928 50010.794810 63000.046902 7 90520000030100",
"ind_pg": "1",
"pg_date": "2022-07-13",
"pg_amount": "120.00",
"cnc_date": "",
"cnc_reason": "",
"nf_link_pdf": "https:\/\/www.meusite.com.br\/nfe.pdf",
"nf_link_xml": "https:\/\/www.meusite.com.br\/nfe.xml",
"msg_charge_1": [
{
"status": "5",
"date": "2022-07-11",
"info": "Late Date"
}
],
"msg_charge_2": [
{
"status": "1",
"date": "2022-07-29",
"info": ""
}
],
"msg_alert_1": [
{
"status": "1",
"date": "2022-08-29",
"info": ""
}
],
"msg_alert_2": [
{
"status": "1",
"date": "2022-09-29",
"info": ""
}
],
"msg_pg": [
{
"status": "2",
"date": "",
"info": "Waiting"
}
],
"msg_cnc": [
{
"status": "3",
"date": "2022-07-29",
"info": ""
}
],
"msg_nf": [
{
"status": "3",
"date": "2022-07-29",
"info": ""
}
]
}
]
}
Este exemplo funcional em PHP 7.3 executa um post para a API e apresenta o retorno na tela para validação. Modifique o código para se adequar às suas necessidades. Para outras linguagens, adapte o código de acordo.
<?php
header('Content-Type: text/html; charset=utf-8');
# Parametros
$_TOKEN = 'xxxxxx';
$_CMD = 'get_charge';
$_CHARGE_ID = '000';
# URL
$_URL = 'https://app.maxbot.com.br/api/v1.php';
# START
$_TXT = "[POST]:<br/><br/>";
$_TXT .= " API_URL => ".$_URL."<br/>";
$_TXT .= " cmd => ".$_CMD."<br/>";
$_TXT .= " token => ".$_TOKEN."<br/>";
$_TXT .= " charge_id => ".$_CHARGE_ID."<br/>";
$_TXT .= "<br/>";
$_TXT .= "[retorno]:<br/><br/>";
$_TXT .= "<textarea rows=10 cols=90>";
echo $_TXT;
# Request API
$_REQUEST = array(
"token" => "$_TOKEN",
"cmd" => "$_CMD",
"charge_id" => "$_CHARGE_ID",
);
$json = json_encode($_REQUEST);
$ch = curl_init($_URL);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
curl_setopt($ch, CURLOPT_POSTFIELDS, $json);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Content-Type: application/json',
'Content-Length: ' . strlen($json))
);
$_result = curl_exec($ch);
curl_close($ch);
echo $_result;
echo "</textarea>";
exit;
?>
Utilize a requisição de criação de cobrança para criar um nova cobrança no Maxbot.
{
"token": "xxxx",
"cmd": "insert_charge",
"client_country": "BR",
"client_client_name": "Jose Silva",
"client_name": "Jose",
"client_last_name": "Silva",
"client_br_person_type": "J",
"client_br_cpf": "11122233300",
"client_br_cnpj": "00111222000133",
"client_company": "Empresa Minha Ltda",
"client_whatsapp": "5531911116666",
"client_mobile_phone": "5531911116666",
"client_email": "jose@email.com",
"client_code1": "1231",
"client_code2": "12321",
"client_code3": "AV930",
"charge_invoice": "12342",
"charge_due_date": "2022-07-13",
"charge_amount": "120.00",
"charge_link_pdf": "https:\/\/www.meusite.com.br\/charge.pdf",
"charge_bar_code": "11791.21928 50010.794810 63000.046902 7 90520000030100",
"ind_pg": "1",
"pg_date": "2022-07-13",
"pg_amount": "120.00",
"nf_link_pdf": "https:\/\/www.meusite.com.br\/nfe.pdf",
"nf_link_xml": "https:\/\/www.meusite.com.br\/nfe.xml",
}
{
"status": 1,
"msg": "Success",
"charge_id": "123",
"created_at": "2022-07-13 08:20:10"
}
Este exemplo funcional em PHP 7.3 executa um post para a API e apresenta o retorno na tela para validação. Modifique o código para se adequar às suas necessidades. Para outras linguagens, adapte o código de acordo.
<?php
header('Content-Type: text/html; charset=utf-8');
# Parametros
$_TOKEN = 'xxxxxx';
$_CMD = 'insert_charge';
$_CLIENT_COUNTRY = 'BR';
$_CLIENT_NOME = 'Jose';
$_CLIENT_LAST_NAME = 'Silva';
$_CLIENT_CPF = '13022720637';
$_CLIENT_PESSOA = 'F';
$_CLIENT_WHATSAPP = '5531911116666';
$_CHARGE_INVOICE = '23542';
$_CHARGE_DUE_DATE = '2022-07-12';
$_CHARGE_AMOUNT = '120.00';
$_CHARGE_LINK_PDF = 'https://www.meusite.com.br/charge.pdf';
$_IND_PG = '0';
# URL
$_URL = 'https://app.maxbot.com.br/api/v1.php';
# START
$_TXT = "[POST]:<br/><br/>";
$_TXT .= " API_URL => ".$_URL."<br/>";
$_TXT .= " token => ".$_TOKEN."<br/>";
$_TXT .= " cmd => ".$_CMD."<br/>";
$_TXT .= " client_country => ".$_CLIENT_COUNTRY."<br/>";
$_TXT .= " client_name => ".$_CLIENT_NOME."<br/>";
$_TXT .= " client_last_name => ".$_CLIENT_LAST_NAME."<br/>";
$_TXT .= " client_br_person_type => ".$_CLIENT_PESSOA."<br/>";
$_TXT .= " client_br_cpf => ".$_CLIENT_CPF."<br/>";
$_TXT .= " client_whatsapp => ".$_CLIENT_WHATSAPP."<br/>";
$_TXT .= " charge_invoice => ".$_CHARGE_INVOICE."<br/>";
$_TXT .= " charge_due_date => ".$_CHARGE_DUE_DATE."<br/>";
$_TXT .= " charge_amount => ".$_CHARGE_AMOUNT."<br/>";
$_TXT .= " charge_link_pdf => ".$_CHARGE_LINK_PDF."<br/>";
$_TXT .= " ind_pg => ".$_IND_PG."<br/>";
$_TXT .= "<br/>";
$_TXT .= "[retorno]:<br/><br/>";
$_TXT .= "<textarea rows=10 cols=90>";
echo $_TXT;
# Request API
$_REQUEST = array(
"token" => "$_TOKEN",
"cmd" => "$_CMD",
"charge_invoice" => "$_CHARGE_INVOICE",
"client_country" => "$_CLIENT_COUNTRY",
"client_name" => "$_CLIENT_NOME",
"client_last_name" => "$_CLIENT_LAST_NAME",
"client_br_person_type" => "$_CLIENT_PESSOA",
"client_br_cpf" => "$_CLIENT_CPF",
"client_whatsapp" => "$_CLIENT_WHATSAPP",
"charge_due_date" => "$_CHARGE_DUE_DATE",
"charge_amount" => "$_CHARGE_AMOUNT",
"charge_link_pdf" => "$_CHARGE_LINK_PDF",
"ind_pg" => "$_IND_PG",
);
$json = json_encode($_REQUEST);
$ch = curl_init($_URL);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
curl_setopt($ch, CURLOPT_POSTFIELDS, $json);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Content-Type: application/json',
'Content-Length: ' . strlen($json))
);
$_result = curl_exec($ch);
curl_close($ch);
echo $_result;
echo "</textarea>";
exit;
?>
Utilize a requisição de atualização de cobrança para atualizar uma cobrança no Maxbot.
{
"token": "xxxx",
"cmd": "update_charge",
"charge_id": "123",
"client_country": "BR",
"client_client_name": "Jose Silva",
"client_name": "Jose",
"client_last_name": "Silva",
"client_br_person_type": "J",
"client_br_cpf": "11122233300",
"client_br_cnpj": "00111222000133",
"client_company": "Empresa Minha Ltda",
"client_whatsapp": "5531911116666",
"client_mobile_phone": "5531911116666",
"client_email": "jose@email.com",
"client_code1": "1231",
"client_code2": "12321",
"client_code3": "AV930",
"charge_invoice": "12342",
"charge_due_date": "2022-07-13",
"charge_amount": "120.00",
"charge_link_pdf": "https:\/\/www.meusite.com.br\/charge.pdf",
"charge_bar_code": "11791.21928 50010.794810 63000.046902 7 90520000030100",
"ind_pg": "1",
"pg_date": "2022-07-13",
"pg_amount": "120.00",
"nf_link_pdf": "https:\/\/www.meusite.com.br\/nfe.pdf",
"nf_link_xml": "https:\/\/www.meusite.com.br\/nfe.xml",
}
{
"token": "xxxx",
"cmd": "update_charge",
"charge_id": "123",
"ind_pg": "1",
"pg_date": "2022-07-13",
"pg_amount": "120.00",
}
{
"token": "xxxx",
"cmd": "update_charge",
"charge_id": "123",
"ind_pg": "2",
"cnc_date": "2022-07-13",
"cnc_reason": "Cobran\u00e7a com dados incorretos.",
}
{
"token": "xxxx",
"cmd": "update_charge",
"charge_id": "123",
"nf_link_pdf": "https:\/\/www.meusite.com.br\/nfe.pdf",
"nf_link_xml": "https:\/\/www.meusite.com.br\/nfe.xml",
}
{
"status": 1,
"msg": "Success",
"updated_at": "2022-07-13 08:20:10"
}
Este exemplo funcional em PHP 7.3 executa um post para a API e apresenta o retorno na tela para validação. Modifique o código para se adequar às suas necessidades. Para outras linguagens, adapte o código de acordo.
<?php
header('Content-Type: text/html; charset=utf-8');
# Parametros
$_TOKEN = 'xxxxxx';
$_CMD = 'update_charge';
$_CLIENT_COUNTRY = 'BR';
$_CLIENT_NOME = 'Jose';
$_CLIENT_LAST_NAME = 'Silva';
$_CLIENT_CPF = '13022720637';
$_CLIENT_PESSOA = 'F';
$_CLIENT_WHATSAPP = '5531911116666';
$_CHARGE_ID = '123';
$_CHARGE_INVOICE = '23542';
$_CHARGE_DUE_DATE = '2022-07-12';
$_CHARGE_AMOUNT = '120.00';
$_CHARGE_LINK_PDF = 'https://www.meusite.com.br/charge.pdf';
$_IND_PG = '0';
# URL
$_URL = 'https://app.maxbot.com.br/api/v1.php';
# START
$_TXT = "[POST]:<br/><br/>";
$_TXT .= " API_URL => ".$_URL."<br/>";
$_TXT .= " token => ".$_TOKEN."<br/>";
$_TXT .= " cmd => ".$_CMD."<br/>";
$_TXT .= " client_country => ".$_CLIENT_COUNTRY."<br/>";
$_TXT .= " client_name => ".$_CLIENT_NOME."<br/>";
$_TXT .= " client_last_name => ".$_CLIENT_LAST_NAME."<br/>";
$_TXT .= " client_br_person_type => ".$_CLIENT_PESSOA."<br/>";
$_TXT .= " client_br_cpf => ".$_CLIENT_CPF."<br/>";
$_TXT .= " client_whatsapp => ".$_CLIENT_WHATSAPP."<br/>";
$_TXT .= " charge_id => ".$_CHARGE_ID."<br/>";
$_TXT .= " charge_invoice => ".$_CHARGE_INVOICE."<br/>";
$_TXT .= " charge_due_date => ".$_CHARGE_DUE_DATE."<br/>";
$_TXT .= " charge_amount => ".$_CHARGE_AMOUNT."<br/>";
$_TXT .= " charge_link_pdf => ".$_CHARGE_LINK_PDF."<br/>";
$_TXT .= " ind_pg => ".$_IND_PG."<br/>";
$_TXT .= "<br/>";
$_TXT .= "[retorno]:<br/><br/>";
$_TXT .= "<textarea rows=10 cols=90>";
echo $_TXT;
# Request API
$_REQUEST = array(
"token" => "$_TOKEN",
"cmd" => "$_CMD",
"client_country" => "$_CLIENT_COUNTRY",
"client_name" => "$_CLIENT_NOME",
"client_last_name" => "$_CLIENT_LAST_NAME",
"client_br_person_type" => "$_CLIENT_PESSOA",
"client_br_cpf" => "$_CLIENT_CPF",
"client_whatsapp" => "$_CLIENT_WHATSAPP",
"charge_id" => "$_CHARGE_ID",
"charge_invoice" => "$_CHARGE_INVOICE",
"charge_due_date" => "$_CHARGE_DUE_DATE",
"charge_amount" => "$_CHARGE_AMOUNT",
"charge_link_pdf" => "$_CHARGE_LINK_PDF",
"ind_pg" => "$_IND_PG",
);
$json = json_encode($_REQUEST);
$ch = curl_init($_URL);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
curl_setopt($ch, CURLOPT_POSTFIELDS, $json);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Content-Type: application/json',
'Content-Length: ' . strlen($json))
);
$_result = curl_exec($ch);
curl_close($ch);
echo $_result;
echo "</textarea>";
exit;
?>
Utilize a requisição de deletar cobrança para excluir uma cobrança no Maxbot.
{
"token": "xxxx",
"cmd": "delete_charge",
"charge_id": [123,134,532,874]
}
{
"status": 1,
"msg": "Success"
}
Este exemplo funcional em PHP 7.3 executa um post para a API e apresenta o retorno na tela para validação. Modifique o código para se adequar às suas necessidades. Para outras linguagens, adapte o código de acordo.
<?php
header('Content-Type: text/html; charset=utf-8');
# Parametros
$_TOKEN = "xxxxxx";
$_CMD = "delete_charge";
$_CHARGE_ID = array(123,134,532,874);
# URL
$_URL = 'https://app.maxbot.com.br/api/v1.php';
# START
$_TXT = "[POST]:<br/><br/>";
$_TXT .= " API_URL => ".$_URL."<br/>";
$_TXT .= " token => ".$_TOKEN."<br/>";
$_TXT .= " cmd => ".$_CMD."<br/>";
$_TXT .= " charge_id => ".print_r($_CHARGE_ID, true)."<br/>";
$_TXT .= "<br/>";
$_TXT .= "[retorno]:<br/><br/>";
$_TXT .= "<textarea rows=10 cols=90>";
echo $_TXT;
# Request API
$_REQUEST = array(
"token" => "$_TOKEN",
"cmd" => "$_CMD",
"charge_id" => (array) $_CHARGE_ID
);
$json = json_encode($_REQUEST);
$ch = curl_init($_URL);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
curl_setopt($ch, CURLOPT_POSTFIELDS, $json);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Content-Type: application/json',
'Content-Length: ' . strlen($json))
);
$_result = curl_exec($ch);
curl_close($ch);
echo $_result;
echo "</textarea>";
exit;
?>
Utilize a requisição de envio de template de aviso ou template de autenticação. Envio de aviso só é permitido para contatos que trocaram mensagem no Maxbot.
{
"token": "xxxx",
"cmd": "send_notice",
"channel_token": "202304FE471FF7A477-5FA8BA-E72F90",
"contact_id": 1234,
"template_id": 1234,
"scheduled": 1,
"date_time": "2020-12-01 13:00:00",
"user_otp_code": "12345678"
}
{
"status": 1,
"msg": "Success"
}
Este exemplo funcional em PHP 7.3 executa um post para a API e apresenta o retorno na tela para validação. Modifique o código para se adequar às suas necessidades. Para outras linguagens, adapte o código de acordo.
<?php
header('Content-Type: text/html; charset=utf-8');
# Parametros
$_TOKEN = 'xxxxxx';
$_CMD = 'send_notice';
$_CHANNEL_TOKEN = '202304FE471FF7A477-5FA8BA-E72F90';
$_CT_ID = '1234';
$_TP_ID = '1234';
$_SCHEDULED = '0';
$_DATE_TIME = '2020-12-01 08:30:00';
$_USER_OTP_CODE = '12345678';
# URL
$_URL = 'https://app.maxbot.com.br/api/v1.php';
# START
$_TXT = "[POST]:<br/><br/>";
$_TXT .= " API_URL => ".$_URL."<br/>";
$_TXT .= " token => ".$_TOKEN."<br/>";
$_TXT .= " cmd => ".$_CMD."<br/>";
$_TXT .= " channel_token => ".$_CHANNEL_TOKEN."<br/>";
$_TXT .= " contact_id => ".$_CT_ID."<br/>";
$_TXT .= " template_id => ".$_TP_ID."<br/>";
$_TXT .= " scheduled => ".$_SCHEDULED."<br/>";
$_TXT .= " date_time => ".$_DATE_TIME."<br/>";
$_TXT .= " user_otp_code => ".$_USER_OTP_CODE."<br/>";
$_TXT .= "<br/>";
$_TXT .= "[retorno]:<br/><br/>";
$_TXT .= "<textarea rows=10 cols=90>";
echo $_TXT;
# Request API
$_REQUEST = array(
"token" => "$_TOKEN",
"cmd" => "$_CMD",
"channel_token" => "$_CHANNEL_TOKEN",
"contact_id" => "$_CT_ID",
"template_id" => "$_TP_ID",
"scheduled" => "$_SCHEDULED",
"date_time" => "$_DATE_TIME",
"user_otp_code" => "$_USER_OTP_CODE",
);
$json = json_encode($_REQUEST);
$ch = curl_init($_URL);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
curl_setopt($ch, CURLOPT_POSTFIELDS, $json);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Content-Type: application/json',
'Content-Length: ' . strlen($json))
);
$_result = curl_exec($ch);
curl_close($ch);
echo $_result;
echo "</textarea>";
exit;
?>
Utilize a requisição de disparo de mensagem no chat em atendimento.
{
"token": "xxx",
"cmd": "send_chat_msg",
"prot_id": "1234",
"msg": "Teste envio de emojis [EMOJI1]",
"msg_date_sql": "2024-12-18 23:39:43"
}
{
"status": 1,
"msg": "Success",
"chat_id": "1234",
"msg_id": "3EB0737BBEAA8506A326"
}
Este exemplo funcional em PHP 7.3 executa um post para a API e apresenta o retorno na tela para validação. Modifique o código para se adequar às suas necessidades. Para outras linguagens, adapte o código de acordo.
<?php
header('Content-Type: text/html; charset=utf-8');
# Parametros
$_TOKEN = 'xxxxxx';
$_CMD = 'send_chat_msg';
$_PROT_ID = '1234';
$_MSG = 'Teste envio de emojis [EMOJI1]';
$_MSG_DATE_SQL = '2024-12-18 23:39:43';
# URL
$_URL = 'https://app.maxbot.com.br/api/v1.php';
# START
$_TXT = "[POST]:<br/><br/>";
$_TXT .= " API_URL => ".$_URL."<br/>";
$_TXT .= " token => ".$_TOKEN.""<br/>";
$_TXT .= " cmd => ".$_CMD."<br/>";
$_TXT .= " prot_id => ".$_PROT_ID.""<br/>";
$_TXT .= " msg => ".$_MSG.""<br/>";
$_TXT .= " msg_date_sql => ".$_MSG_DATE_SQL.""<br/>";
$_TXT .= "<br/>";
$_TXT .= "[retorno]:<br/><br/>";
$_TXT .= "<textarea rows=10 cols=90>";
echo $_TXT;
# Request API
$_REQUEST = array(
"token" => "$_TOKEN",
"cmd" => "$_CMD",
"prot_id" => "$_PROT_ID",
"msg" => "$_MSG",
"msg_date_sql" => "$_MSG_DATE_SQL"
);
$json = json_encode($_REQUEST);
$ch = curl_init($_URL);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
curl_setopt($ch, CURLOPT_POSTFIELDS, $json);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Content-Type: application/json',
'Content-Length: ' . strlen($json))
);
$_result = curl_exec($ch);
curl_close($ch);
echo $_result;
echo "</textarea>";
exit;
?>
Utilize a requisição de disparo de áudio no chat em atendimento.
{
"token": "xxx",
"cmd": "send_chat_audio",
"prot_id": "1234",
"audio_base64": "data:audio/ogg;base64,T2dnUwACAAAAAAAAAACjLWkxAAAAAGmzCm4BE09wdXNI...",
"audio_ext": "ogg",
"msg_date_sql": "2024-12-18 23:39:43"
}
{
"status": 1,
"msg": "Success",
"chat_id": "1234",
"msg_id": "3EB0737BBEAA8506A326",
"audio_name": "audio",
"audio_size": "24.91K",
"audio_url": "https:\/\/app.maxbot.com.br\/anexos_docs\/bfe9fae7c3b356332d97920c6a8a5895.ogg"
}
Este exemplo funcional em PHP 7.3 executa um post para a API e apresenta o retorno na tela para validação. Modifique o código para se adequar às suas necessidades. Para outras linguagens, adapte o código de acordo.
<?php
header('Content-Type: text/html; charset=utf-8');
# Parametros
$_TOKEN = 'xxxxxx';
$_CMD = 'send_chat_audio';
$_PROT_ID = '1234';
$_AUDIO_BASE64 = 'data:audio/ogg;base64,T2dnUwACAAAAAAAAAACjLWkxAAAAAGmzCm4BE09wdXNI...';
$_AUDIO_EXT = 'ogg';
$_MSG_DATE_SQL = '2024-12-18 23:39:43';
# URL
$_URL = 'https://app.maxbot.com.br/api/v1.php';
# START
$_TXT = "[POST]:<br/><br/>";
$_TXT .= " API_URL => ".$_URL."<br/>";
$_TXT .= " token => ".$_TOKEN.""<br/>";
$_TXT .= " cmd => ".$_CMD."<br/>";
$_TXT .= " prot_id => ".$_PROT_ID.""<br/>";
$_TXT .= " audio_base64 => ".$_AUDIO_BASE64.""<br/>";
$_TXT .= " audio_ext => ".$_AUDIO_EXT.""<br/>";
$_TXT .= " msg_date_sql => ".$_MSG_DATE_SQL.""<br/>";
$_TXT .= "<br/>";
$_TXT .= "[retorno]:<br/><br/>";
$_TXT .= "<textarea rows=10 cols=90>";
echo $_TXT;
# Request API
$_REQUEST = array(
"token" => "$_TOKEN",
"cmd" => "$_CMD",
"prot_id" => "$_PROT_ID",
"audio_base64" => "$_AUDIO_BASE64",
"audio_ext" => "$_AUDIO_EXT",
"msg_date_sql" => "$_MSG_DATE_SQL"
);
$json = json_encode($_REQUEST);
$ch = curl_init($_URL);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
curl_setopt($ch, CURLOPT_POSTFIELDS, $json);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Content-Type: application/json',
'Content-Length: ' . strlen($json))
);
$_result = curl_exec($ch);
curl_close($ch);
echo $_result;
echo "</textarea>";
exit;
?>
Utilize a requisição de disparo de anexo no chat atendimento.
{
"token": "xxx",
"cmd": "send_chat_annex",
"prot_id": "1234",
"annex_name": "nome-do-anexo.xls",
"annex_base64": "data:@file/msexcel;base64,0M8R4KGxGuEAAAAAAAAAAAAAAAAAAAAAOwADAP7/...",
"annex_ext": "xls",
"annex_type": "F",
"msg_date_sql": "2024-12-18 23:39:43"
}
{
"status": 1,
"msg": "Success",
"chat_id": "1234",
"msg_id": "3EB0737BBEAA8506A326",
"annex_name": "nome-do-anexo.xls",
"annex_url": "https:\/\/app.maxbot.com.br\/anexos_docs\/86c3af39f3c7bb067f256fad52fe8812.xls"
}
Este exemplo funcional em PHP 7.3 executa um post para a API e apresenta o retorno na tela para validação. Modifique o código para se adequar às suas necessidades. Para outras linguagens, adapte o código de acordo.
<?php
header('Content-Type: text/html; charset=utf-8');
# Parametros
$_TOKEN = 'xxxxxx';
$_CMD = 'send_chat_annex';
$_PROT_ID = '1234';
$_ANNEX_NAME = 'nome-do-anexo.xls';
$_ANNEX_BASE64 = 'data:@file/msexcel;base64,0M8R4KGxGuEAAAAAAAAAAAAAAAAAAAAAOwADAP7/...';
$_ANNEX_EXT = 'xls';
$_ANNEX_TYPE = 'F';
$_MSG_DATE_SQL = '2024-12-18 23:39:43';
# URL
$_URL = 'https://app.maxbot.com.br/api/v1.php';
# START
$_TXT = "[POST]:<br/><br/>";
$_TXT .= " API_URL => ".$_URL."<br/>";
$_TXT .= " token => ".$_TOKEN.""<br/>";
$_TXT .= " cmd => ".$_CMD."<br/>";
$_TXT .= " prot_id => ".$_PROT_ID.""<br/>";
$_TXT .= " annex_name => ".$_ANNEX_NAME.""<br/>";
$_TXT .= " annex_base64 => ".$_ANNEX_BASE64.""<br/>";
$_TXT .= " annex_ext => ".$_ANNEX_EXT.""<br/>";
$_TXT .= " annex_type => ".$_ANNEX_TYPE.""<br/>";
$_TXT .= " msg_date_sql => ".$_MSG_DATE_SQL.""<br/>";
$_TXT .= "<br/>";
$_TXT .= "[retorno]:<br/><br/>";
$_TXT .= "<textarea rows=10 cols=90>";
echo $_TXT;
# Request API
$_REQUEST = array(
"token" => "$_TOKEN",
"cmd" => "$_CMD",
"prot_id" => "$_PROT_ID",
"annex_name" => "$_ANNEX_NAME",
"annex_base64" => "$_ANNEX_BASE64",
"annex_ext" => "$_ANNEX_EXT",
"annex_type" => "$_ANNEX_TYPE",
"msg_date_sql" => "$_MSG_DATE_SQL"
);
$json = json_encode($_REQUEST);
$ch = curl_init($_URL);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
curl_setopt($ch, CURLOPT_POSTFIELDS, $json);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Content-Type: application/json',
'Content-Length: ' . strlen($json))
);
$_result = curl_exec($ch);
curl_close($ch);
echo $_result;
echo "</textarea>";
exit;
?>
Utilize a requisição de disparo de mensagem de texto para enviar uma mensagem de texto para um contato existente no Maxbot. Você pode disparar mensagens para qualquer contato previamente existente na sua base de contatos. O disparo é feito conforme as seguintes condições:
{
"token" : "xxxx",
"cmd" : "send_text",
"channel_token" : "202304FE471FF7A477-5FA8BA-E72F90"
"ct_whatsapp" : "554111113333",
"ct_telegram_id" : "",
"ct_messenger" : "",
"messenger_page_id" : "",
"ct_instagram" : "",
"instagram_account_id" : "",
"ct_external_id" : "",
"ct_br_cpf" : "11122233344",
"msg" : "Mensagem de Texto"
}
{
"status": 1,
"msg": "Success"
}
Este exemplo funcional em PHP 7.3 executa um post para a API e apresenta o retorno na tela para validação. Modifique o código para se adequar às suas necessidades. Para outras linguagens, adapte o código de acordo.
<?php
header('Content-Type: text/html; charset=utf-8');
# Parametros
$_TOKEN = 'xxxxxx';
$_CMD = 'send_text';
$_CHANNEL_TOKEN = '202304FE471FF7A477-5FA8BA-E72F90';
$_CT_WHATSAPP = '553196668586';
$_CT_TELEGRAM = '';
$_CT_MESSENGER = '';
$_MESSENGER_PAGE_ID = '';
$_CT_INSTAGRAM = '';
$_INSTAGRAM_ACCOUNT_ID = '';
$_CT_CPF = '03104925640';
$_CT_IDEXTERNO = '1234';
$_MSG = "teste de disparo 001!";//\nEmojis: [EMOJI1] [EMOJI2] [EMOJI3] [EMOJI4] [EMOJI5] [EMOJI6] [EMOJI7] [EMOJI8] [EMOJI9] [EMOJI10] ";
# URL
$_URL = 'https://app.maxbot.com.br/api/v1.php';
# START
$_TXT = "[POST]:<br/><br/>";
$_TXT .= " API_URL => ".$_URL."<br/>";
$_TXT .= " token => ".$_TOKEN."<br/>";
$_TXT .= " cmd => ".$_CMD."<br/>";
$_TXT .= " channel_token => ".$_CHANNEL_TOKEN."<br/>";
$_TXT .= " ct_whatsapp => ".$_CT_WHATSAPP."<br/>";
$_TXT .= " ct_telegram_id => ".$_CT_TELEGRAM."<br/>";
$_TXT .= " ct_messenger => ".$_CT_MESSENGER."<br/>";
$_TXT .= " messenger_page_id => ".$_MESSENGER_PAGE_ID."<br/>";
$_TXT .= " ct_instagram => ".$_CT_INSTAGRAM."<br/>";
$_TXT .= "instagram_account_id => ".$_INSTAGRAM_ACCOUNT_ID."<br/>";
$_TXT .= " ct_br_cpf => ".$_CT_CPF."<br/>";
$_TXT .= " ct_external_id => ".$_CT_IDEXTERNO."<br/>";
$_TXT .= " msg => ".$_MSG."<br/>";
$_TXT .= "<br/>";
$_TXT .= "[retorno]:<br/><br/>";
$_TXT .= "<textarea rows=10 cols=90>";
echo $_TXT;
# Request API
$_REQUEST = array(
"token" => "$_TOKEN",
"cmd" => "$_CMD",
"channel_token" => "$_CHANNEL_TOKEN",
"ct_whatsapp" => "$_CT_WHATSAPP",
"ct_telegram_id" => "$_CT_TELEGRAM",
"ct_messenger" => "$_CT_MESSENGER",
"messenger_page_id" => "$_MESSENGER_PAGE_ID",
"ct_instagram" => "$_CT_INSTAGRAM",
"instagram_account_id" => "$_INSTAGRAM_ACCOUNT_ID",
"ct_br_cpf" => "$_CT_CPF",
"ct_external_id" => "$_CT_IDEXTERNO",
"msg" => "$_MSG"
);
$json = json_encode($_REQUEST);
$ch = curl_init($_URL);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
curl_setopt($ch, CURLOPT_POSTFIELDS, $json);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Content-Type: application/json',
'Content-Length: ' . strlen($json))
);
$_result = curl_exec($ch);
curl_close($ch);
echo $_result;
echo "</textarea>";
exit;
?>
Utilize a requisição de disparo de sms para enviar uma mensagem de texto via sms para um contato existente no Maxbot. Você pode disparar mensagens para qualquer contato previamente existente na sua base de contatos. O disparo é feito conforme as seguintes condições:
{
"token" : "xxxx",
"cmd" : "send_sms",
"cell_phone" : "5531991234567"
"ct_external_id" : "",
"ct_br_cpf" : "11122233344",
"msg" : "Mensagem do sms"
}
{
"status": 1,
"msg": "Success"
"msg_id": "SMS-123"
}
Este exemplo funcional em PHP 7.3 executa um post para a API e apresenta o retorno na tela para validação. Modifique o código para se adequar às suas necessidades. Para outras linguagens, adapte o código de acordo.
<?php
header('Content-Type: text/html; charset=utf-8');
# Parametros
$_TOKEN = 'xxxxxx';
$_CMD = 'send_sms';
$_CELL_PHONE = '5531123456789';
$_CT_CPF = '03104925640';
$_CT_IDEXTERNO = '1234';
$_MSG = "teste de disparo 001!";//\nEmojis: [EMOJI1] [EMOJI2] [EMOJI3] [EMOJI4] [EMOJI5] [EMOJI6] [EMOJI7] [EMOJI8] [EMOJI9] [EMOJI10] ";
# URL
$_URL = 'https://app.maxbot.com.br/api/v1.php';
# START
$_TXT = "[POST]:<br/><br/>";
$_TXT .= " API_URL => ".$_URL."<br/>";
$_TXT .= " token => ".$_TOKEN."<br/>";
$_TXT .= " cmd => ".$_CMD."<br/>";
$_TXT .= " cell_phone => ".$_CELL_PHONE."<br/>";
$_TXT .= " ct_br_cpf => ".$_CT_CPF."<br/>";
$_TXT .= " ct_external_id => ".$_CT_IDEXTERNO."<br/>";
$_TXT .= " msg => ".$_MSG."<br/>";
$_TXT .= "<br/>";
$_TXT .= "[retorno]:<br/><br/>";
$_TXT .= "<textarea rows=10 cols=90>";
echo $_TXT;
# Request API
$_REQUEST = array(
"token" => "$_TOKEN",
"cmd" => "$_CMD",
"cell_phone" => "$_CELL_PHONE",
"ct_br_cpf" => "$_CT_CPF",
"ct_external_id" => "$_CT_IDEXTERNO",
"msg" => "$_MSG"
);
$json = json_encode($_REQUEST);
$ch = curl_init($_URL);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
curl_setopt($ch, CURLOPT_POSTFIELDS, $json);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Content-Type: application/json',
'Content-Length: ' . strlen($json))
);
$_result = curl_exec($ch);
curl_close($ch);
echo $_result;
echo "</textarea>";
exit;
?>
Utilize a requisição de disparo de E-mail para enviar uma mensagem via E-mail para um contato existente no Maxbot. Você pode disparar mensagens para qualquer contato previamente existente na sua base de contatos. O disparo é feito conforme as seguintes condições:
{
"token" : "xxxx",
"cmd" : "send_email",
"from_email" : "romulo@email.com",
"from_name" : "romulo",
"subject" : "email de teste",
"body" : "texto da mesangem do email",
"footer" : "",
"to_name" : "jose",
"to_email" : "jose@email.com",
"img_url_1" : "https://www.meusite.com.br/foto.png",
"img_extension_1" : "png",
"img_url_2" : "",
"img_extension_2" : "",
"img_url_3" : "",
"img_extension_3" : "",
"img_url_4" : "",
"img_extension_4" : "",
"img_url_5" : "",
"img_extension_5" : "",
"img_url_6" : "",
"img_extension_6" : "",
"file_url_1" : "https://www.meusite.com.br/arquivo.pdf",
"file_extension_1" : "pdf",
"file_url_2" : "",
"file_extension_2" : "",
"file_url_3" : "",
"file_extension_3" : ""
}
{
"status": 1,
"msg": "Success"
"msg_id": "EMAIL-123"
}
Este exemplo funcional em PHP 7.3 executa um post para a API e apresenta o retorno na tela para validação. Modifique o código para se adequar às suas necessidades. Para outras linguagens, adapte o código de acordo.
<?php
header('Content-Type: text/html; charset=utf-8');
# Parametros
$_TOKEN = 'xxxxxx';
$_CMD = 'send_email';
$_FROM_EMAIL = 'romulo@email.com';
$_FROM_NAME = 'romulo';
$_SUBJECT = 'e-mail de teste';
$_BODY = 'mensagem do e-mail';
$_FOOTER = '';
$_TO_NAME = 'jose';
$_TO_EMAIL = 'jose@email.com';
$_IMG_URL_1 = 'https://www.meusite.com.br/foto.png';
$_IMG_EXTENSION_1 = 'png';
$_IMG_URL_2 = '';
$_IMG_EXTENSION_2 = '';
$_IMG_URL_3 = '';
$_IMG_EXTENSION_3 = '';
$_IMG_URL_4 = '';
$_IMG_EXTENSION_4 = '';
$_IMG_URL_5 = '';
$_IMG_EXTENSION_5 = '';
$_IMG_URL_6 = '';
$_IMG_EXTENSION_6 = '';
$_FILE_URL_1 = 'https://www.meusite.com.br/arquivo.pdf';
$_FILE_EXTENSION_1 = 'pdf';
$_FILE_URL_2 = '';
$_FILE_EXTENSION_2 = '';
$_FILE_URL_3 = '';
$_FILE_EXTENSION_3 = '';
# URL
$_URL = 'https://app.maxbot.com.br/api/v1.php';
# START
$_TXT = "[POST]:<br/><br/>";
$_TXT .= " API_URL => ".$_URL."<br/>";
$_TXT .= " token => ".$_TOKEN."<br/>";
$_TXT .= " cmd => ".$_CMD."<br/>";
$_TXT .= " from_email => ".$_FROM_EMAIL."<br/>";
$_TXT .= " from_name => ".$_FROM_NAME."<br/>";
$_TXT .= " subject => ".$_SUBJECT."<br/>";
$_TXT .= " body => ".$_BODY."<br/>";
$_TXT .= " footer => ".$_FOOTER."<br/>";
$_TXT .= " to_name => ".$_TO_NAME."<br/>";
$_TXT .= " to_email => ".$_TO_EMAIL."<br/>";
$_TXT .= " img_url_1 => ".$_IMG_URL_1."<br/>";
$_TXT .= " img_extension_1 => ".$_IMG_EXTENSION_1."<br/>";
$_TXT .= " img_url_2 => ".$_IMG_URL_2."<br/>";
$_TXT .= " img_extension_2 => ".$_IMG_EXTENSION_2."<br/>";
$_TXT .= " img_url_3 => ".$_IMG_URL_3."<br/>";
$_TXT .= " img_extension_3 => ".$_IMG_EXTENSION_3."<br/>";
$_TXT .= " img_url_4 => ".$_IMG_URL_4."<br/>";
$_TXT .= " img_extension_4 => ".$_IMG_EXTENSION_4."<br/>";
$_TXT .= " img_url_5 => ".$_IMG_URL_5."<br/>";
$_TXT .= " img_extension_5 => ".$_IMG_EXTENSION_5."<br/>";
$_TXT .= " img_url_6 => ".$_IMG_URL_6."<br/>";
$_TXT .= " img_extension_6 => ".$_IMG_EXTENSION_6."<br/>";
$_TXT .= " file_url_1 => ".$_FILE_URL_1."<br/>";
$_TXT .= " file_extension_1 => ".$_FILE_EXTENSION_1."<br/>";
$_TXT .= " file_url_2 => ".$_FILE_URL_2."<br/>";
$_TXT .= " file_extension_2 => ".$_FILE_EXTENSION_2."<br/>";
$_TXT .= " file_url_3 => ".$_FILE_URL_3."<br/>";
$_TXT .= " file_extension_3 => ".$_FILE_EXTENSION_3."<br/>";
$_TXT .= "<br/>";
$_TXT .= "[retorno]:<br/><br/>";
$_TXT .= "<textarea rows=10 cols=90>";
echo $_TXT;
# Request API
$_REQUEST = array(
"token" => "$_TOKEN",
"cmd" => "$_CMD",
from_email => "$_FROM_EMAIL",
from_name => "$_FROM_NAME",
subject => "$_SUBJECT",
body => "$_BODY",
footer => "$_FOOTER",
to_name => "$_TO_NAME",
to_email => "$_TO_EMAIL",
img_url_1 => "$_IMG_URL_1",
img_extension_1 => "$_IMG_EXTENSION_1",
img_url_2 => "$_IMG_URL_2",
img_extension_2 => "$_IMG_EXTENSION_2",
img_url_3 => "$_IMG_URL_3",
img_extension_3 => "$_IMG_EXTENSION_3",
img_url_4 => "$_IMG_URL_4",
img_extension_4 => "$_IMG_EXTENSION_4",
img_url_5 => "$_IMG_URL_5",
img_extension_5 => "$_IMG_EXTENSION_5",
img_url_6 => "$_IMG_URL_6",
img_extension_6 => "$_IMG_EXTENSION_6",
file_url_1 => "$_FILE_URL_1",
file_extension_1 => "$_FILE_EXTENSION_1",
file_url_2 => "$_FILE_URL_2",
file_extension_2 => "$_FILE_EXTENSION_2",
file_url_3 => "$_FILE_URL_3",
file_extension_3 => "$_FILE_EXTENSION_3"
);
$json = json_encode($_REQUEST);
$ch = curl_init($_URL);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
curl_setopt($ch, CURLOPT_POSTFIELDS, $json);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Content-Type: application/json',
'Content-Length: ' . strlen($json))
);
$_result = curl_exec($ch);
curl_close($ch);
echo $_result;
echo "</textarea>";
exit;
?>
Utilize a requisição de disparo de imagem para enviar uma imagem (jpg, jpeg ou png) para um contato existente no Maxbot. Você pode disparar imagens para qualquer contato previamente existente na sua base de contatos. O disparo é feito conforme as seguintes condições:
{
"token": "xxxx",
"cmd": "send_image",
"channel_token" : "202304FE471FF7A477-5FA8BA-E72F90"
"ct_whatsapp": "553191112222",
"ct_telegram_id" : "",
"ct_messenger" : "",
"messenger_page_id" : "",
"ct_instagram" : "",
"instagram_account_id" : "",
"ct_external_id": "1234",
"ct_br_cpf": "11122233344",
"image_url": "https://www.meusite.com.br/foto.png",
"image_extension": "png"
}
{
"status": 1,
"msg": "Success"
}
Este exemplo funcional em PHP 7.3 executa um post para a API e apresenta o retorno na tela para validação. Modifique o código para se adequar às suas necessidades. Para outras linguagens, adapte o código de acordo.
<?php
header('Content-Type: text/html; charset=utf-8');
# Parametros
$_TOKEN = 'xxxxxx';
$_CMD = 'send_image';
$_CHANNEL_TOKEN = '202304FE471FF7A477-5FA8BA-E72F90';
$_CT_WHATSAPP = '553196668586';
$_CT_TELEGRAM = '';
$_CT_MESSENGER = '';
$_MESSENGER_PAGE_ID = '';
$_CT_INSTAGRAM = '';
$_INSTAGRAM_ACCOUNT_ID = '';
$_CT_CPF = '03104925640';
$_CT_IDEXTERNO = '1234';
$_IMG_URL = 'https://www.meusite.com.br/foto.png';
$_IMG_EXT = 'png';
# URL
$_URL = 'https://app.maxbot.com.br/api/v1.php';
# START
$_TXT = "[POST]:<br/><br/>";
$_TXT .= " API_URL => ".$_URL."<br/>";
$_TXT .= " token => ".$_TOKEN."<br/>";
$_TXT .= " cmd => ".$_CMD."<br/>";
$_TXT .= " channel_token => ".$_CHANNEL_TOKEN."<br/>";
$_TXT .= " ct_whatsapp => ".$_CT_WHATSAPP."<br/>";
$_TXT .= " ct_telegram_id => ".$_CT_TELEGRAM."<br/>";
$_TXT .= " ct_messenger => ".$_CT_MESSENGER."<br/>";
$_TXT .= " messenger_page_id => ".$_MESSENGER_PAGE_ID."<br/>";
$_TXT .= " ct_instagram => ".$_CT_INSTAGRAM."<br/>";
$_TXT .= "instagram_account_id => ".$_INSTAGRAM_ACCOUNT_ID."<br/>";
$_TXT .= " ct_br_cpf => ".$_CT_CPF."<br/>";
$_TXT .= " ct_external_id => ".$_CT_IDEXTERNO."<br/>";
$_TXT .= " image_url => ".$_IMG_URL."<br/>";
$_TXT .= " image_extension => ".$_IMG_EXT."<br/>";
$_TXT .= "<br/>";
$_TXT .= "[retorno]:<br/><br/>";
$_TXT .= "<textarea rows=10 cols=90>";
echo $_TXT;
# Request API
$_REQUEST = array(
"token" => "$_TOKEN",
"cmd" => "$_CMD",
"channel_token" => "$_CHANNEL_TOKEN",
"ct_whatsapp" => "$_CT_WHATSAPP",
"ct_telegram_id" => "$_CT_TELEGRAM",
"ct_messenger" => "$_CT_MESSENGER",
"messenger_page_id" => "$_MESSENGER_PAGE_ID",
"ct_instagram" => "$_CT_INSTAGRAM",
"instagram_account_id" => "$_INSTAGRAM_ACCOUNT_ID",
"ct_br_cpf" => "$_CT_CPF",
"ct_external_id" => "$_CT_IDEXTERNO",
"image_url" => "$_IMG_URL",
"image_extension" => "$_IMG_EXT"
);
$json = json_encode($_REQUEST);
$ch = curl_init($_URL);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
curl_setopt($ch, CURLOPT_POSTFIELDS, $json);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Content-Type: application/json',
'Content-Length: ' . strlen($json))
);
$_result = curl_exec($ch);
curl_close($ch);
echo $_result;
echo "</textarea>";
exit;
?>
Utilize a requisição de disparo de documento para enviar um documento (pdf, doc, docx, xls, xlsx, ppt, pptx ou pps) para um contato existente no Maxbot. Você pode disparar documentos para qualquer contato previamente existente na sua base de contatos. O disparo é feito conforme as seguintes condições:
{
"token": "xxxx",
"cmd": "send_file",
"channel_token" : "202304FE471FF7A477-5FA8BA-E72F90"
"ct_whatsapp": "553191112222",
"ct_telegram_id" : "",
"ct_messenger" : "",
"messenger_page_id" : "",
"ct_instagram" : "",
"instagram_account_id" : "",
"ct_external_id": "1234",
"ct_br_cpf": "11122233344",
"file_url": "https://www.meusite.com.br/teste.pdf",
"file_extension": "pdf"
"file_name": "teste.pdf"
}
{
"status": 1,
"msg": "Success"
}
Este exemplo funcional em PHP 7.3 executa um post para a API e apresenta o retorno na tela para validação. Modifique o código para se adequar às suas necessidades. Para outras linguagens, adapte o código de acordo.
<?php
header('Content-Type: text/html; charset=utf-8');
# Parametros
$_TOKEN = 'xxxxxx';
$_CMD = 'send_file';
$_CHANNEL_TOKEN = '202304FE471FF7A477-5FA8BA-E72F90';
$_CT_WHATSAPP = '553196668586';
$_CT_TELEGRAM = '';
$_CT_MESSENGER = '';
$_MESSENGER_PAGE_ID = '';
$_CT_INSTAGRAM = '';
$_INSTAGRAM_ACCOUNT_ID = '';
$_CT_CPF = '03104925640';
$_CT_IDEXTERNO = '1234';
$_FILE_URL = 'https://www.meusite.com.br/teste.pdf';
$_FILE_EXT = 'pdf';
$_FILE_NAME = 'teste.pdf';
# URL
$_URL = 'https://app.maxbot.com.br/api/v1.php';
# START
$_TXT = "[POST]:<br/><br/>";
$_TXT .= " API_URL => ".$_URL."<br/>";
$_TXT .= " token => ".$_TOKEN."<br/>";
$_TXT .= " cmd => ".$_CMD."<br/>";
$_TXT .= " channel_token => ".$_CHANNEL_TOKEN."<br/>";
$_TXT .= " ct_whatsapp => ".$_CT_WHATSAPP."<br/>";
$_TXT .= " ct_telegram_id => ".$_CT_TELEGRAM."<br/>";
$_TXT .= " ct_messenger => ".$_CT_MESSENGER."<br/>";
$_TXT .= " messenger_page_id => ".$_MESSENGER_PAGE_ID."<br/>";
$_TXT .= " ct_instagram => ".$_CT_INSTAGRAM."<br/>";
$_TXT .= "instagram_account_id => ".$_INSTAGRAM_ACCOUNT_ID."<br/>";
$_TXT .= " ct_br_cpf => ".$_CT_CPF."<br/>";
$_TXT .= " ct_external_id => ".$_CT_IDEXTERNO."<br/>";
$_TXT .= " file_url => ".$_FILE_URL."<br/>";
$_TXT .= " file_extension => ".$_FILE_EXT."<br/>";
$_TXT .= " file_name => ".$_FILE_NAME."<br/>";
$_TXT .= "<br/>";
$_TXT .= "[retorno]:<br/><br/>";
$_TXT .= "<textarea rows=10 cols=90>";
echo $_TXT;
# Request API
$_REQUEST = array(
"token" => "$_TOKEN",
"cmd" => "$_CMD",
"channel_token" => "$_CHANNEL_TOKEN",
"ct_whatsapp" => "$_CT_WHATSAPP",
"ct_telegram_id" => "$_CT_TELEGRAM",
"ct_messenger" => "$_CT_MESSENGER",
"messenger_page_id" => "$_MESSENGER_PAGE_ID",
"ct_instagram" => "$_CT_INSTAGRAM",
"instagram_account_id" => "$_INSTAGRAM_ACCOUNT_ID",
"ct_br_cpf" => "$_CT_CPF",
"ct_external_id" => "$_CT_IDEXTERNO",
"file_url" => "$_FILE_URL",
"file_extension" => "$_FILE_EXT"
"file_name" => "$_FILE_NAME"
);
$json = json_encode($_REQUEST);
$ch = curl_init($_URL);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
curl_setopt($ch, CURLOPT_POSTFIELDS, $json);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Content-Type: application/json',
'Content-Length: ' . strlen($json))
);
$_result = curl_exec($ch);
curl_close($ch);
echo $_result;
echo "</textarea>";
exit;
?>
Utilize a requisição de disparo de áudio para enviar um arquivo de áudio MP3 para um contato existente no Maxbot. Você pode disparar áudios para qualquer contato previamente existente na sua base de contatos. O disparo é feito conforme as seguintes condições:
{
"token": "xxxx",
"cmd": "send_sound",
"channel_token" : "202304FE471FF7A477-5FA8BA-E72F90"
"ct_whatsapp": "553191112222",
"ct_telegram_id" : "",
"ct_messenger" : "",
"messenger_page_id" : "",
"ct_instagram" : "",
"instagram_account_id" : "",
"ct_external_id": "1234",
"ct_br_cpf": "11122233344",
"sound_url": "https://www.meusite.com.br/audio.mp3",
"sound_extension": "mp3"
}
{
"status": 1,
"msg": "Success"
}
Este exemplo funcional em PHP 7.3 executa um post para a API e apresenta o retorno na tela para validação. Modifique o código para se adequar às suas necessidades. Para outras linguagens, adapte o código de acordo.
<?php
header('Content-Type: text/html; charset=utf-8');
# Parametros
$_TOKEN = 'xxxxxx';
$_CMD = 'send_sound';
$_CHANNEL_TOKEN = '202304FE471FF7A477-5FA8BA-E72F90';
$_CT_WHATSAPP = '553196668586';
$_CT_TELEGRAM = '';
$_CT_MESSENGER = '';
$_MESSENGER_PAGE_ID = '';
$_CT_INSTAGRAM = '';
$_INSTAGRAM_ACCOUNT_ID = '';
$_CT_CPF = '03104925640';
$_CT_IDEXTERNO = '1234';
$_SOUND_URL = 'https://www.meusite.com.br/audio.mp3';
$_SOUND_EXT = 'mp3';
# URL
$_URL = 'https://app.maxbot.com.br/api/v1.php';
# START
$_TXT = "[POST]:<br/><br/>";
$_TXT .= " API_URL => ".$_URL."<br/>";
$_TXT .= " token => ".$_TOKEN."<br/>";
$_TXT .= " cmd => ".$_CMD."<br/>";
$_TXT .= " channel_token => ".$_CHANNEL_TOKEN."<br/>";
$_TXT .= " ct_whatsapp => ".$_CT_WHATSAPP."<br/>";
$_TXT .= " ct_telegram_id => ".$_CT_TELEGRAM."<br/>";
$_TXT .= " ct_messenger => ".$_CT_MESSENGER."<br/>";
$_TXT .= " messenger_page_id => ".$_MESSENGER_PAGE_ID."<br/>";
$_TXT .= " ct_instagram => ".$_CT_INSTAGRAM."<br/>";
$_TXT .= "instagram_account_id => ".$_INSTAGRAM_ACCOUNT_ID."<br/>";
$_TXT .= " ct_br_cpf => ".$_CT_CPF."<br/>";
$_TXT .= " ct_external_id => ".$_CT_IDEXTERNO."<br/>";
$_TXT .= " sound_url => ".$_SOUND_URL."<br/>";
$_TXT .= " sound_extension => ".$_SOUND_EXT."<br/>";
$_TXT .= "<br/>";
$_TXT .= "[retorno]:<br/><br/>";
$_TXT .= "<textarea rows=10 cols=90>";
echo $_TXT;
# Request API
$_REQUEST = array(
"token" => "$_TOKEN",
"cmd" => "$_CMD",
"channel_token" => "$_CHANNEL_TOKEN",
"ct_whatsapp" => "$_CT_WHATSAPP",
"ct_telegram_id" => "$_CT_TELEGRAM",
"ct_messenger" => "$_CT_MESSENGER",
"messenger_page_id" => "$_MESSENGER_PAGE_ID",
"ct_instagram" => "$_CT_INSTAGRAM",
"instagram_account_id" => "$_INSTAGRAM_ACCOUNT_ID",
"ct_br_cpf" => "$_CT_CPF",
"ct_external_id" => "$_CT_IDEXTERNO",
"sound_url" => "$_SOUND_URL",
"sound_extension" => "$_SOUND_EXT"
);
$json = json_encode($_REQUEST);
$ch = curl_init($_URL);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
curl_setopt($ch, CURLOPT_POSTFIELDS, $json);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Content-Type: application/json',
'Content-Length: ' . strlen($json))
);
$_result = curl_exec($ch);
curl_close($ch);
echo $_result;
echo "</textarea>";
exit;
?>
Para ativar um webhook faça o login em sua conta Maxbot e vá para Configuração/API Maxbot e Webhooks. Após inserir a URL clique no ícone de salvar .
Webhook Mensagem Recebida retorna o recebimento de mensagens recebidas no formato JSON para o webhook configurado no Maxbot.
{
"origin": "2",
"contact": {
"id": "1",
"created_at": "2022-01-25 13:52:15",
"updated_at": "",
"segmentation": "",
"tag": "",
"name": "Fulano",
"surname": "Mariano",
"gender": "",
"birth": "",
"age": "",
"br_person_type": "F",
"br_cpf": "",
"br_cnpj": "",
"company": "",
"email": "",
"whatsapp": "5531911112222",
"mobile_phone": "",
"phone": "",
"country": "BR",
"state": "MG",
"city": "",
"profession": "",
"external_id": "",
"avatar_url": "https:\/\/app.maxbot.com.br\/strg\/01\/HMG-202104-E1B4E2\/2022\/04\/13\/8ca7a22e5fe3c6bb72d8d1d14e8784fe_small.jpg",
"obs": "",
"in_attendance": "",
"current_protocol": "",
"current_attendant": ""
},
"msg_id": "3EB04714F09C9DE532E2",
"msg_timestamp": "1643129533",
"msg_date": "2022-01-25 13:52:15",
"msg": "Teste webhook 2",
"type": "T",
"img_info": "",
"img_size": "",
"img_filename": "",
"img_local_filename": "",
"img_extension": "",
"audio_info": "",
"audio_size": "",
"audio_filename": "",
"audio_local_filename": "",
"audio_extension": "",
"arq_info": "",
"arq_size": "",
"arq_filename": "",
"arq_local_filename": "",
"arq_extension": "",
"vid_info": "",
"vid_size": "",
"vid_filename": "",
"vid_local_filename": "",
"vid_extension": "",
"vcard": "",
"map_lat": "",
"map_lng": "",
"map_img": "",
"map_location_url": "",
"referral": "",
"quoted_id ": "",
"quoted_type": "",
"quoted_msg": "",
"quoted_img_info": "",
"quoted_img_size": "",
"quoted_img_filename": "",
"quoted_img_local_filename": "",
"quoted_img_extension": "",
"quoted_audio_info": "",
"quoted_audio_size": "",
"quoted_audio_filename": "",
"quoted_audio_local_filename": "",
"quoted_audio_extension": "",
"quoted_arq_info": "",
"quoted_arq_size": "",
"quoted_arq_filename": "",
"quoted_arq_local_filename": "",
"quoted_arq_extension": "",
"quoted_vid_info": "",
"quoted_vid_size": "",
"quoted_vid_filename": "",
"quoted_vid_local_filename": "",
"quoted_vid_extension": "",
"quoted_vcard": "",
"quoted_map_lat": "",
"quoted_map_lng": "",
"quoted_map_location_url": "",
"quoted_map_img": ""
}
Quando um contato comentar em cima de uma mensagem, os dados referentes à mensagem comentada serão recebidas nos campos quoted correspondente:
Webhook Mensagem Recebida em Atendimento retorna o recebimento de mensagens de protocolos em atendimento no formato JSON para o webhook configurado no Maxbot.
{
"origin": "2",
"whatsapp": "553111112222",
"prot_id": "2398",
"contact_id": "845",
"avatar_url": "https://site.com/imagem.jpg",
"chat_id": "19273",
"msg_id": "3EB04714F09C9DE532E2",
"msg_timestamp": "1643129533",
"msg_date": "2022-01-25 13:52:15",
"msg": "Teste webhook 2",
"type": "T",
"img_info": "",
"img_size": "",
"img_filename": "",
"img_local_filename": "",
"img_extension": "",
"audio_info": "",
"audio_size": "",
"audio_filename": "",
"audio_local_filename": "",
"audio_extension": "",
"arq_info": "",
"arq_size": "",
"arq_filename": "",
"arq_local_filename": "",
"arq_extension": "",
"vid_info": "",
"vid_size": "",
"vid_filename": "",
"vid_local_filename": "",
"vid_extension": "",
"vcard": "",
"map_lat": "",
"map_lng": "",
"map_img": "",
"map_location_url": "",
"referral": "",
"quoted_id ": "",
"quoted_type": "",
"quoted_msg": "",
"quoted_img_info": "",
"quoted_img_size": "",
"quoted_img_filename": "",
"quoted_img_local_filename": "",
"quoted_img_extension": "",
"quoted_audio_info": "",
"quoted_audio_size": "",
"quoted_audio_filename": "",
"quoted_audio_local_filename": "",
"quoted_audio_extension": "",
"quoted_arq_info": "",
"quoted_arq_size": "",
"quoted_arq_filename": "",
"quoted_arq_local_filename": "",
"quoted_arq_extension": "",
"quoted_vid_info": "",
"quoted_vid_size": "",
"quoted_vid_filename": "",
"quoted_vid_local_filename": "",
"quoted_vid_extension": "",
"quoted_vcard": "",
"quoted_map_lat": "",
"quoted_map_lng": "",
"quoted_map_location_url": "",
"quoted_map_img": ""
}
Quando um contato comentar em cima de uma mensagem, os dados referentes à mensagem comentada serão recebidas nos campos quoted correspondente:
Novo Contato retorna o recebimento de novo contato no formato JSON para o webhook configurado no Maxbot.
{
"id": "1",
"type_event": "insert",
"created_at": "2022-04-13 12:49:14",
"updated_at": "",
"segmentation": ["Equipe Maxbot"],
"tag": "",
"tag2": "",
"name": "Fulano",
"surname": "Mariano",
"gender": "",
"birth": "",
"age": "",
"br_person_type": "F",
"br_cpf": "",
"br_cnpj": "",
"company": "",
"email": "",
"maxbot_username": "",
"whatsapp": "5531911112222",
"mobile_phone": "",
"telegram_id": "",
"telegram_username": "",
"fbmessenger_id": "",
"fbmessenger_username": "",
"instagram_id": "",
"instagram_username": "",
"phone": "",
"country": "BR",
"state": "MG",
"city": "",
"profession": "",
"ind_client": "0",
"client_code": "",
"external_id": "",
"avatar_url": "https:\/\/app.maxbot.com.br\/strg\/01\/HMG-202104-E1B4E2\/2022\/04\/13\/ 8ca7a22e5fe3c6bb72d8d1d14e8784fe_small.jpg",
"obs": "",
"tag_info1": "",
"tag_info2": "",
"tag_info3": "",
"tag_info4": "",
"tag_info5": "",
"tag_info6": "",
"in_attendance": "",
"current_protocol": "",
"current_attendant": ""
}
Contato Atualizado retorna o recebimento de contato atualizado no formato JSON para o webhook configurado no Maxbot.
{
"id": "1",
"type_event": "update",
"created_at": "2022-04-13 12:49:14",
"updated_at": "",
"segmentation": ["Equipe Maxbot"],
"tag": "",
"tag2": "",
"name": "Fulano",
"surname": "Mariano",
"gender": "",
"birth": "",
"age": "",
"br_person_type": "F",
"br_cpf": "",
"br_cnpj": "",
"company": "",
"email": "",
"maxbot_username": "",
"whatsapp": "5531911112222",
"mobile_phone": "",
"telegram_id": "",
"telegram_username": "",
"fbmessenger_id": "",
"fbmessenger_username": "",
"instagram_id": "",
"instagram_username": "",
"phone": "",
"country": "BR",
"state": "MG",
"city": "",
"profession": "",
"ind_client": "0",
"client_code": "",
"external_id": "",
"avatar_url": "https:\/\/app.maxbot.com.br\/strg\/01\/HMG-202104-E1B4E2\/2022\/04\/13\/ 8ca7a22e5fe3c6bb72d8d1d14e8784fe_small.jpg",
"obs": "",
"tag_info1": "",
"tag_info2": "",
"tag_info3": "",
"tag_info4": "",
"tag_info5": "",
"tag_info6": "",
"in_attendance": "",
"current_protocol": "",
"current_attendant": ""
}
Retorna a situação de cada envio da cobrança no formato JSON para o url do webhook configurado no modulo de cobrança inteligente.
{
"client_country": "BR",
"client_customer": "Carlos Lana",
"client_br_person_type": "F",
"client_br_cpf": "31113710614",
"client_br_cnpj": "7574849393",
"client_whatsapp": "5551982492631",
"client_mobile_phone": "",
"client_email": "meuemail@mail.com",
"client_code1": "1231",
"client_code2": "12321",
"client_code3": "AV930",
"charge_origin": "API",
"charge_id": "2342",
"charge_invoice": "23423",
"charge_due_date": "2022-06-23",
"charge_amount": "120.00",
"msg_charge_1": [
{
"status": "5",
"date": "2022-07-11",
"info": "Late Date"
}
],
"msg_charge_2": [
{
"status": "1",
"date": "2022-07-29",
"info": ""
}
],
"msg_alert_1": [
{
"status": "1",
"date": "2022-08-29",
"info": ""
}
],
"msg_alert_2": [
{
"status": "1",
"date": "2022-09-29",
"info": ""
}
],
"msg_pg": [
{
"status": "2",
"date": "",
"info": "Waiting"
}
],
"msg_cnc": [
{
"status": "3",
"date": "2022-07-29",
"info": ""
}
],
"msg_nf": [
{
"status": "3",
"date": "2022-07-29",
"info": ""
}
]
}