CRM
Consultar oportunidade
Alcance: com product:contacts, a empresa inteira; só com product:inbox, apenas contatos das conversas dos números liberados para a chave (alterações exigem também messages:send).
Permissão: product:contacts ou product:inbox.
AuthorizationBearer <token>
Chave de API criada no painel (API e integrações). Prefixos: zz_live_, zz_test_ (e os antigos wl_live_/wl_test_).
In: header
requestGetCrmOpportunityRequest
billing?object
Não usado nesta operação.
deadlineMs?integer
Prazo máximo da operação em milissegundos.
Default
30000Range
1 <= value <= 30000Response Body
curl -X POST "https://api.zynzap.com.br/v1/rpc/GetCrmOpportunity" \ -H "Authorization: Bearer $ZYNZAP_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "request": {}}'{
"opportunity": {
"id": "string",
"contact_id": "string",
"contact_name": "string",
"contact_phone": "string",
"contact_temperature": "string",
"contact_qualification": "string",
"conversation_id": "string",
"pipeline_id": "string",
"stage_id": "string",
"title": "string",
"value_cents": "string",
"currency": "string",
"owner_user_id": "string",
"status": "string",
"loss_reason_id": "string",
"loss_note": "string",
"expected_close_at": "string",
"closed_at_unix_ms": "string",
"stage_entered_at_unix_ms": "string",
"source": "string",
"created_by": "string",
"created_at_unix_ms": "string",
"updated_at_unix_ms": "string"
},
"history": [
{
"id": "string",
"from_stage_name": "string",
"to_stage_name": "string",
"from_status": "string",
"to_status": "string",
"loss_reason_id": "string",
"loss_note": "string",
"actor_user_id": "string",
"source": "string",
"source_ref": "string",
"created_at_unix_ms": "string"
}
],
"tasks": [
{
"id": "string",
"title": "string",
"notes": "string",
"contact_id": "string",
"contact_name": "string",
"opportunity_id": "string",
"opportunity_title": "string",
"conversation_id": "string",
"assignee_user_id": "string",
"due_at_unix_ms": "string",
"done_at_unix_ms": "string",
"done_by": "string",
"source": "string",
"created_by": "string",
"created_at_unix_ms": "string"
}
]
}{
"error": {
"code": "VALIDATION_FAILED",
"message": "Requisição inválida para esta operação.",
"requestId": "7f3c1a9e-2b4d-4c6e-8f10-a1b2c3d4e5f6",
"reason": "RPC_REQUEST_INVALID"
}
}{
"error": {
"code": "UNAUTHENTICATED",
"message": "Credencial de API ausente, inválida ou revogada.",
"requestId": "7f3c1a9e-2b4d-4c6e-8f10-a1b2c3d4e5f6",
"reason": "API_AUTH_REQUIRED"
}
}{
"error": {
"code": "FORBIDDEN",
"message": "Este endereço IP não está autorizado a usar esta chave de API.",
"requestId": "7f3c1a9e-2b4d-4c6e-8f10-a1b2c3d4e5f6",
"reason": "API_KEY_IP_FORBIDDEN"
}
}{
"error": {
"code": "NOT_FOUND",
"message": "Não encontramos o recurso solicitado.",
"requestId": "7f3c1a9e-2b4d-4c6e-8f10-a1b2c3d4e5f6"
}
}{
"error": {
"code": "CONFLICT",
"message": "A cotação expirou. Revise os custos novamente.",
"requestId": "7f3c1a9e-2b4d-4c6e-8f10-a1b2c3d4e5f6",
"reason": "BILLING_QUOTE_EXPIRED"
}
}{
"error": {
"code": "VALIDATION_FAILED",
"message": "Requisição inválida para esta operação.",
"requestId": "7f3c1a9e-2b4d-4c6e-8f10-a1b2c3d4e5f6",
"reason": "RPC_REQUEST_INVALID"
}
}{
"error": {
"code": "RATE_LIMITED",
"message": "Limite de requisições desta chave atingido. Aguarde um instante.",
"requestId": "7f3c1a9e-2b4d-4c6e-8f10-a1b2c3d4e5f6",
"reason": "API_KEY_RATE_LIMITED"
}
}{
"error": {
"code": "UNAVAILABLE",
"message": "Resultado incerto. Confira o estado antes de repetir a operação.",
"requestId": "7f3c1a9e-2b4d-4c6e-8f10-a1b2c3d4e5f6",
"reason": "OUTCOME_UNCERTAIN"
}
}