curl --request GET \
--url https://api.wegly.com.br/integrations/external/deals/{id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.wegly.com.br/integrations/external/deals/{id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.wegly.com.br/integrations/external/deals/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.wegly.com.br/integrations/external/deals/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.wegly.com.br/integrations/external/deals/{id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.wegly.com.br/integrations/external/deals/{id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.wegly.com.br/integrations/external/deals/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"id": "<string>",
"code": 123,
"title": "<string>",
"created_by": {
"id": "<string>",
"name": "<string>",
"avatar": "<string>"
},
"stage": {
"id": "<string>",
"name": "<string>",
"pipeline": {
"id": "<string>",
"name": "<string>"
}
},
"pipeline_stages": [
{
"id": "<string>",
"name": "<string>",
"position": 123
}
],
"responsible": {
"id": "<string>",
"name": "<string>",
"avatar": "<string>"
},
"deal_source": {
"id": "<string>",
"name": "<string>",
"logo": "<string>"
},
"marketing_lead_source": {
"id": "<string>",
"utm_search_term": "<string>",
"lead_source": {
"id": "<string>",
"name": "<string>",
"logo": "<string>"
},
"url_conversion": "<string>",
"campaing_name": "<string>",
"ad_set_name": "<string>",
"content_name": "<string>",
"displayed_on_name": "<string>",
"conversion_tool_name": "<string>",
"creative": {
"id": "<string>",
"value": "<string>",
"creative_uri": "<string>"
}
},
"quality_rating": 123,
"quality_reason": "<string>",
"won_date": "2023-11-07T05:31:56Z",
"lost_date": "2023-11-07T05:31:56Z",
"crm_loss_reason": {
"id": "<string>",
"name": "<string>"
},
"lost_reason_description": "<string>",
"negotiation_mode": 123,
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"archived_at": "2023-11-07T05:31:56Z",
"last_activity_at": "2023-11-07T05:31:56Z",
"expected_close_date": "2023-11-07T05:31:56Z",
"participants": [
{
"id": "<string>",
"role": {
"id": "<string>",
"name": "<string>"
},
"notes": "<string>",
"person": {
"id": "<string>",
"name": "<string>",
"contacts": [
{
"id": "<string>",
"value": "<string>",
"primary": true
}
]
}
}
],
"organization": {
"id": "<string>",
"name": "<string>",
"logo": "<string>"
},
"lead": {
"id": "<string>",
"title": "<string>"
},
"custom_fields": [
{
"field_id": "<string>",
"field_name": "<string>",
"field_type": 123,
"answers": [
{
"id": "<string>",
"option_id": "<string>",
"option_value": "<string>",
"value": "<string>"
}
]
}
],
"tags": [
{
"id": "<string>",
"name": "<string>",
"color": "<string>"
}
],
"stage_durations": [
{
"stage_id": "<string>",
"stage_name": "<string>",
"total_seconds": 123,
"human_readable": "<string>"
}
],
"value": 123,
"views_count": 123,
"associations_count": {
"items": 123,
"tasks": 123,
"qualifications": 123,
"notes": 123,
"files": 123,
"activities": 123,
"proposals": 123
},
"proposals": [
{
"id": "<string>",
"code": 123,
"version": 123,
"title": "<string>",
"status": 123,
"is_primary": true,
"discount_type": 123,
"discount_value": 123,
"subtotal": 123,
"total": 123,
"valid_until": "2023-11-07T05:31:56Z",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"approved_at": "2023-11-07T05:31:56Z",
"archived_at": "2023-11-07T05:31:56Z",
"rejected_at": "2023-11-07T05:31:56Z",
"created_by": {
"id": "<string>",
"name": "<string>",
"avatar": "<string>"
},
"approved_by": {
"id": "<string>",
"name": "<string>"
}
}
],
"products": [
{
"id": "<string>",
"product_id": "<string>",
"product": {
"id": "<string>",
"name": "<string>",
"code": "<string>",
"unit": 123,
"sale_price": 123
},
"unit": 123,
"quantity": 123,
"unit_price": 123,
"discount_type": 123,
"discount_value": 123,
"subtotal": 123,
"total": 123,
"notes": "<string>",
"is_recurring_default": true,
"billing_interval_default": 123,
"contract_term_months": 123,
"start_date": "2023-11-07T05:31:56Z",
"end_date": "2023-11-07T05:31:56Z",
"billing_cycles": 123,
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}
],
"followers": [
{
"role": {
"id": "<string>",
"name": "<string>"
},
"user": {
"id": "<string>",
"name": "<string>",
"avatar": "<string>"
},
"notes": "<string>"
}
]
}Consulta de oportunidade
Retorna detalhes completos da oportunidade informada, incluindo propostas e produtos diretos associados. O id pode ser UUID ou o código numérico interno.
curl --request GET \
--url https://api.wegly.com.br/integrations/external/deals/{id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.wegly.com.br/integrations/external/deals/{id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.wegly.com.br/integrations/external/deals/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.wegly.com.br/integrations/external/deals/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.wegly.com.br/integrations/external/deals/{id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.wegly.com.br/integrations/external/deals/{id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.wegly.com.br/integrations/external/deals/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"id": "<string>",
"code": 123,
"title": "<string>",
"created_by": {
"id": "<string>",
"name": "<string>",
"avatar": "<string>"
},
"stage": {
"id": "<string>",
"name": "<string>",
"pipeline": {
"id": "<string>",
"name": "<string>"
}
},
"pipeline_stages": [
{
"id": "<string>",
"name": "<string>",
"position": 123
}
],
"responsible": {
"id": "<string>",
"name": "<string>",
"avatar": "<string>"
},
"deal_source": {
"id": "<string>",
"name": "<string>",
"logo": "<string>"
},
"marketing_lead_source": {
"id": "<string>",
"utm_search_term": "<string>",
"lead_source": {
"id": "<string>",
"name": "<string>",
"logo": "<string>"
},
"url_conversion": "<string>",
"campaing_name": "<string>",
"ad_set_name": "<string>",
"content_name": "<string>",
"displayed_on_name": "<string>",
"conversion_tool_name": "<string>",
"creative": {
"id": "<string>",
"value": "<string>",
"creative_uri": "<string>"
}
},
"quality_rating": 123,
"quality_reason": "<string>",
"won_date": "2023-11-07T05:31:56Z",
"lost_date": "2023-11-07T05:31:56Z",
"crm_loss_reason": {
"id": "<string>",
"name": "<string>"
},
"lost_reason_description": "<string>",
"negotiation_mode": 123,
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"archived_at": "2023-11-07T05:31:56Z",
"last_activity_at": "2023-11-07T05:31:56Z",
"expected_close_date": "2023-11-07T05:31:56Z",
"participants": [
{
"id": "<string>",
"role": {
"id": "<string>",
"name": "<string>"
},
"notes": "<string>",
"person": {
"id": "<string>",
"name": "<string>",
"contacts": [
{
"id": "<string>",
"value": "<string>",
"primary": true
}
]
}
}
],
"organization": {
"id": "<string>",
"name": "<string>",
"logo": "<string>"
},
"lead": {
"id": "<string>",
"title": "<string>"
},
"custom_fields": [
{
"field_id": "<string>",
"field_name": "<string>",
"field_type": 123,
"answers": [
{
"id": "<string>",
"option_id": "<string>",
"option_value": "<string>",
"value": "<string>"
}
]
}
],
"tags": [
{
"id": "<string>",
"name": "<string>",
"color": "<string>"
}
],
"stage_durations": [
{
"stage_id": "<string>",
"stage_name": "<string>",
"total_seconds": 123,
"human_readable": "<string>"
}
],
"value": 123,
"views_count": 123,
"associations_count": {
"items": 123,
"tasks": 123,
"qualifications": 123,
"notes": 123,
"files": 123,
"activities": 123,
"proposals": 123
},
"proposals": [
{
"id": "<string>",
"code": 123,
"version": 123,
"title": "<string>",
"status": 123,
"is_primary": true,
"discount_type": 123,
"discount_value": 123,
"subtotal": 123,
"total": 123,
"valid_until": "2023-11-07T05:31:56Z",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"approved_at": "2023-11-07T05:31:56Z",
"archived_at": "2023-11-07T05:31:56Z",
"rejected_at": "2023-11-07T05:31:56Z",
"created_by": {
"id": "<string>",
"name": "<string>",
"avatar": "<string>"
},
"approved_by": {
"id": "<string>",
"name": "<string>"
}
}
],
"products": [
{
"id": "<string>",
"product_id": "<string>",
"product": {
"id": "<string>",
"name": "<string>",
"code": "<string>",
"unit": 123,
"sale_price": 123
},
"unit": 123,
"quantity": 123,
"unit_price": 123,
"discount_type": 123,
"discount_value": 123,
"subtotal": 123,
"total": 123,
"notes": "<string>",
"is_recurring_default": true,
"billing_interval_default": 123,
"contract_term_months": 123,
"start_date": "2023-11-07T05:31:56Z",
"end_date": "2023-11-07T05:31:56Z",
"billing_cycles": 123,
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}
],
"followers": [
{
"role": {
"id": "<string>",
"name": "<string>"
},
"user": {
"id": "<string>",
"name": "<string>",
"avatar": "<string>"
},
"notes": "<string>"
}
]
}Authorizations
Utilize o token de integração no header Authorization: Bearer {token}. O domínio de origem (Origin/Referer) deve respeitar allowed_domain, quando configurado na chave.
Path Parameters
UUID ou código numérico da oportunidade.
Response
Detalhes da oportunidade.
Detalhamento completo retornado no GET /integrations/external/deals/{id}.
1 = aberta, 2 = ganha, 3 = perdida.
1, 2, 3 Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Origem direta da oportunidade (crm_lead_source).
Show child attributes
Show child attributes
Último registro de rastreio (crm_marketing_lead_source).
Show child attributes
Show child attributes
Show child attributes
Show child attributes
0 = privado (responsável e supervisores), 1 = equipe/responsável, 2 = público.
0, 1, 2 Modo de negociacao da oportunidade. 0 indica produtos/pedido e 1 indica proposta.
1 = frio, 2 = morno, 3 = quente.
1, 2, 3 Participantes da oportunidade com informações de contato.
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Respostas de campos customizados agrupadas por campo.
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Tempo acumulado por etapa (segundos e texto legível).
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Produtos diretamente associados a oportunidade em crm_deal_product.
Show child attributes
Show child attributes
Show child attributes
Show child attributes
