Endpoint: POST
https://croncrm.com/api/v2/funnels/create
| Atributo | Descrição | Obrigatório | Tipo |
|---|---|---|---|
|
Informe sua API Key gerada na interface do CRONCRM. |
Sim |
String |
| Atributo | Descrição | Obrigatório | Tipo |
|---|---|---|---|
|
Nome do funil. |
Sim |
String |
|
Descrição do funil. |
Não |
String |
|
|||
Em caso de sucesso, retorna HTTP 200 com success true.
Se name não for informado, retorna 400.
Se já existir um funil com esse nome, retorna 400.
Se não for possível salvar o funil, retorna HTTP 200 com success false.
Método incorreto retorna 405; falhas inesperadas retornam 500.
| Atributo | Descrição | Tipo |
|---|---|---|
|
Informa se a operação teve sucesso ou não. |
Boolean |
|
Mensagem de retorno. |
String |
|
Dados do funil criado.
|
Object |
|
||
<?php
$apiKey = 'SEU_API_KEY';
$url = 'https://croncrm.com/api/v2/funnels/create';
$payload = [
'name' => 'Vendas',
'description' => 'Funil padrão',
];
$ch = curl_init($url);
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_HTTPHEADER => [
'apiKey: ' . $apiKey,
'Content-Type: application/json',
],
CURLOPT_POSTFIELDS => json_encode($payload, JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE),
]);
$response = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
$error = curl_error($ch);
curl_close($ch);
if ($error) {
throw new RuntimeException($error);
}
echo "HTTP {$httpCode}\n";
echo $response;
?>
curl -X POST \
'https://croncrm.com/api/v2/funnels/create' \
-H 'apiKey: SEU_API_KEY' \
-H 'Content-Type: application/json' \
-d '{"name":"Vendas","description":"Funil padrão"}'