API Atualizar Oportunidade
🧩 Atualizar uma oportunidade em um ticket.
API: Todas
Verifique aqui os Pré-Requisitos para utilizar APIs
Endpoint
https://{BACKEND_URL}/api/oportunidade
Método
PUT
Autenticação
Bearer {seutokenaqui}
Payload
{
"id": 148,
"name": "Proposta ao Interessado",
"message": "Enviamos a Proposta em PDF",
"etapadofunil": "Proposta Enviada",
"produto": "Plano Pro",
"valor": "3000.00",
"free1": "Adcional 1",
"free2": "Adcional 2",
"free3": "Adcional 3",
"free4": "Adcional 4",
"tagIds": [1, 3, 5]
}
➡️ “id”: ID da oportunidade a ser atualizada. ➡️ “name”: Nome da Oportunidade. ➡️ “message”: Informações adicionais sobre a oportunidade. ➡️ “etapadofunil”: Nome da Etapa do Funil. ➡️ “produto”: Nome do Produto. ➡️ “valor”: Valor no formato decimal (onde os centavos são representados após o “ponto”). ➡️ “free1”: Informações do Campo Livre 1.➡️ “free2”: Informações do Campo Livre 2.➡️ “free3”: Informações do Campo Livre 3.➡️ “free4”: Informações do Campo Livre 4. ➡️ “tagsIds”: Array de ID de tags de CRM. 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/oportunidade',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'PUT',
CURLOPT_POSTFIELDS =>'{
"id": 148,
"name": "Proposta ao Interessado",
"message": "Enviamos a Proposta em PDF",
"etapadofunil": "Proposta Enviada",
"produto": "Plano Pro",
"valor": "3000.00",
"free1": "Adcional 1",
"free2": "Adcional 2",
"free3": "Adcional 3",
"free4": "Adcional 4",
"tagIds": [1, 3, 5]
}',
CURLOPT_HTTPHEADER => array(
'Content-Type: application/json',
'Authorization: Bearer {seutokenaqui}' //Token cadastrado na conexão
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;