Consultar webhooks do parceiro
curl --request GET \
--url https://api.staging.credicarro.com.br/integration/v1/webhook \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.staging.credicarro.com.br/integration/v1/webhook"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.staging.credicarro.com.br/integration/v1/webhook', 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.staging.credicarro.com.br/integration/v1/webhook",
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.staging.credicarro.com.br/integration/v1/webhook"
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.staging.credicarro.com.br/integration/v1/webhook")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.staging.credicarro.com.br/integration/v1/webhook")
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{
"itens": [
{
"id_webhook": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"tipo": "Proposal",
"url": "https://parceiro.com.br/webhooks/credicarro",
"tipo_autenticacao": "Basic",
"status": "Active"
}
],
"pagina": {
"tem_proximo": true,
"tem_anterior": false,
"numero": 2,
"tamanho": 15,
"total": 45
}
}{
"tipo": "Validation.Cpf.Invalid",
"titulo": "Requisição inválida",
"status": 400,
"detalhe": "O CPF informado em 'cpf' é inválido.",
"campo": "cpf",
"erros": [
{
"codigo": "Validation.InvalidFormat",
"mensagem": "O valor informado para 'valorVeiculo' não é um número válido.",
"campo": "cpf"
}
]
}{
"tipo": "Validation.Cpf.Invalid",
"titulo": "Requisição inválida",
"status": 400,
"detalhe": "O CPF informado em 'cpf' é inválido.",
"campo": "cpf",
"erros": [
{
"codigo": "Validation.InvalidFormat",
"mensagem": "O valor informado para 'valorVeiculo' não é um número válido.",
"campo": "cpf"
}
]
}Webhooks
Listar webhooks
Traz, de forma paginada, os webhooks cadastrados para o parceiro autenticado. A credencial e o segredo de assinatura não são retornados.
GET
/
v1
/
webhook
Consultar webhooks do parceiro
curl --request GET \
--url https://api.staging.credicarro.com.br/integration/v1/webhook \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.staging.credicarro.com.br/integration/v1/webhook"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.staging.credicarro.com.br/integration/v1/webhook', 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.staging.credicarro.com.br/integration/v1/webhook",
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.staging.credicarro.com.br/integration/v1/webhook"
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.staging.credicarro.com.br/integration/v1/webhook")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.staging.credicarro.com.br/integration/v1/webhook")
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{
"itens": [
{
"id_webhook": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"tipo": "Proposal",
"url": "https://parceiro.com.br/webhooks/credicarro",
"tipo_autenticacao": "Basic",
"status": "Active"
}
],
"pagina": {
"tem_proximo": true,
"tem_anterior": false,
"numero": 2,
"tamanho": 15,
"total": 45
}
}{
"tipo": "Validation.Cpf.Invalid",
"titulo": "Requisição inválida",
"status": 400,
"detalhe": "O CPF informado em 'cpf' é inválido.",
"campo": "cpf",
"erros": [
{
"codigo": "Validation.InvalidFormat",
"mensagem": "O valor informado para 'valorVeiculo' não é um número válido.",
"campo": "cpf"
}
]
}{
"tipo": "Validation.Cpf.Invalid",
"titulo": "Requisição inválida",
"status": 400,
"detalhe": "O CPF informado em 'cpf' é inválido.",
"campo": "cpf",
"erros": [
{
"codigo": "Validation.InvalidFormat",
"mensagem": "O valor informado para 'valorVeiculo' não é um número válido.",
"campo": "cpf"
}
]
}Lista os webhooks do parceiro, de forma paginada. A credencial e o segredo de assinatura não são retornados.
Authorizations
Cabeçalho de autenticação Bearer no formato Bearer <token> onde <token> é seu TOKEN de autenticação
Query Parameters
Página inicial (mínimo 1)
Example:
1
Quantidade de itens por página (1 a 100)
Example:
10