API Criar Tarefa
🧩 Criar uma tarefa dentro da empresa.
API: Todas
Verifique aqui os Pré-Requisitos para utilizar APIs
Endpoint
https://{BACKEND_URL}/api/tasks/create
Método
POST
Autenticação
Bearer {seutokenaqui}
Payload
{
"createdBy": 1,
"title": "Nova tarefa via API",
"description": "Descrição da tarefa",
"priority": "high",
"assignedTo": 4,
"dueDate": "2028-12-30T23:59:59.000Z"
}
➡️ “createdBy“: ID do atendente criador dessa tarefa. (*)➡️ “title”: Título da Tarefa. (*) ➡️ “description”: Descrição da Tarefa.➡️ “priority”: high, medium, low (padrão: medium).➡️ “assignedTo”: ID do atendente a quem foi designada essa tarefa.➡️ “dueDate”: Data de vencimento(formato ISO 8601: YYYY-MM-DDTHH:mm:ss.sssZ). (*) = obrigatório API Utilize o código em requisições HTTPS com ferramentas como cURL ou bibliotecas de integração.
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://{BACKEND_URL}/api/tasks/create',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_POSTFIELDS =>'{
"createdBy": 1,
"title": "Nova tarefa via API",
"description": "Descrição da tarefa",
"priority": "high",
"assignedTo": 4,
"dueDate": "2028-12-30T23:59:59.000Z"
}',
CURLOPT_HTTPHEADER => array(
'Content-Type: application/json',
'Authorization: Bearer {seutokenaqui}' //Token cadastrado na conexão
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;