Inspecionar token
curl --request POST \
--url https://api.deliveryvip.com.br/authentication/v1/oauth/introspect \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data token=2YotnFZFEjr1zCsicMWpAA \
--data client_id=seu-client-id \
--data client_secret=seu-client-secretimport requests
url = "https://api.deliveryvip.com.br/authentication/v1/oauth/introspect"
payload = {
"token": "2YotnFZFEjr1zCsicMWpAA",
"client_id": "seu-client-id",
"client_secret": "seu-client-secret"
}
headers = {
"Authorization": "Basic <encoded-value>",
"Content-Type": "application/x-www-form-urlencoded"
}
response = requests.post(url, data=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
Authorization: 'Basic <encoded-value>',
'Content-Type': 'application/x-www-form-urlencoded'
},
body: new URLSearchParams({
token: '2YotnFZFEjr1zCsicMWpAA',
client_id: 'seu-client-id',
client_secret: 'seu-client-secret'
})
};
fetch('https://api.deliveryvip.com.br/authentication/v1/oauth/introspect', 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.deliveryvip.com.br/authentication/v1/oauth/introspect",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "token=2YotnFZFEjr1zCsicMWpAA&client_id=seu-client-id&client_secret=seu-client-secret",
CURLOPT_HTTPHEADER => [
"Authorization: Basic <encoded-value>",
"Content-Type: application/x-www-form-urlencoded"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.deliveryvip.com.br/authentication/v1/oauth/introspect"
payload := strings.NewReader("token=2YotnFZFEjr1zCsicMWpAA&client_id=seu-client-id&client_secret=seu-client-secret")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Basic <encoded-value>")
req.Header.Add("Content-Type", "application/x-www-form-urlencoded")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.deliveryvip.com.br/authentication/v1/oauth/introspect")
.header("Authorization", "Basic <encoded-value>")
.header("Content-Type", "application/x-www-form-urlencoded")
.body("token=2YotnFZFEjr1zCsicMWpAA&client_id=seu-client-id&client_secret=seu-client-secret")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.deliveryvip.com.br/authentication/v1/oauth/introspect")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Basic <encoded-value>'
request["Content-Type"] = 'application/x-www-form-urlencoded'
request.body = "token=2YotnFZFEjr1zCsicMWpAA&client_id=seu-client-id&client_secret=seu-client-secret"
response = http.request(request)
puts response.read_body{
"active": true,
"scope": "od.all",
"client_id": "RlvxmDiOqtML0MTq9Nvupuf5f0wprMa7pvNriMQyZ4A",
"token_type": "Bearer",
"exp": 1639658298,
"iat": 1639571898
}{
"error": "invalid_client",
"error_description": "A autenticação do cliente falhou."
}{
"error": "invalid_client",
"error_description": "A autenticação do cliente falhou."
}Autenticação
Inspecionar token
Retorna os metadados de um token, incluindo se ele está ativo (RFC 7662). A requisição deve ser autenticada com as credenciais do cliente (HTTP Basic ou client_id/client_secret no corpo) ou com um access token válido no header Authorization: Bearer. Para tokens inativos, a resposta é apenas {"active": false}.
POST
/
authentication
/
v1
/
oauth
/
introspect
Inspecionar token
curl --request POST \
--url https://api.deliveryvip.com.br/authentication/v1/oauth/introspect \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data token=2YotnFZFEjr1zCsicMWpAA \
--data client_id=seu-client-id \
--data client_secret=seu-client-secretimport requests
url = "https://api.deliveryvip.com.br/authentication/v1/oauth/introspect"
payload = {
"token": "2YotnFZFEjr1zCsicMWpAA",
"client_id": "seu-client-id",
"client_secret": "seu-client-secret"
}
headers = {
"Authorization": "Basic <encoded-value>",
"Content-Type": "application/x-www-form-urlencoded"
}
response = requests.post(url, data=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
Authorization: 'Basic <encoded-value>',
'Content-Type': 'application/x-www-form-urlencoded'
},
body: new URLSearchParams({
token: '2YotnFZFEjr1zCsicMWpAA',
client_id: 'seu-client-id',
client_secret: 'seu-client-secret'
})
};
fetch('https://api.deliveryvip.com.br/authentication/v1/oauth/introspect', 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.deliveryvip.com.br/authentication/v1/oauth/introspect",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "token=2YotnFZFEjr1zCsicMWpAA&client_id=seu-client-id&client_secret=seu-client-secret",
CURLOPT_HTTPHEADER => [
"Authorization: Basic <encoded-value>",
"Content-Type: application/x-www-form-urlencoded"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.deliveryvip.com.br/authentication/v1/oauth/introspect"
payload := strings.NewReader("token=2YotnFZFEjr1zCsicMWpAA&client_id=seu-client-id&client_secret=seu-client-secret")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Basic <encoded-value>")
req.Header.Add("Content-Type", "application/x-www-form-urlencoded")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.deliveryvip.com.br/authentication/v1/oauth/introspect")
.header("Authorization", "Basic <encoded-value>")
.header("Content-Type", "application/x-www-form-urlencoded")
.body("token=2YotnFZFEjr1zCsicMWpAA&client_id=seu-client-id&client_secret=seu-client-secret")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.deliveryvip.com.br/authentication/v1/oauth/introspect")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Basic <encoded-value>'
request["Content-Type"] = 'application/x-www-form-urlencoded'
request.body = "token=2YotnFZFEjr1zCsicMWpAA&client_id=seu-client-id&client_secret=seu-client-secret"
response = http.request(request)
puts response.read_body{
"active": true,
"scope": "od.all",
"client_id": "RlvxmDiOqtML0MTq9Nvupuf5f0wprMa7pvNriMQyZ4A",
"token_type": "Bearer",
"exp": 1639658298,
"iat": 1639571898
}{
"error": "invalid_client",
"error_description": "A autenticação do cliente falhou."
}{
"error": "invalid_client",
"error_description": "A autenticação do cliente falhou."
}Autorizações
basicAuthbearerAuth
client_id como usuário e client_secret como senha.
Corpo
application/x-www-form-urlencoded
Resposta
Resultado da inspeção.
Indica se o token está ativo.
Exemplo:
true
Escopos do token, separados por espaço.
Exemplo:
"od.all"
Identificador do aplicativo dono do token.
Exemplo:
"RlvxmDiOqtML0MTq9Nvupuf5f0wprMa7pvNriMQyZ4A"
Tipo do token, sempre Bearer.
Exemplo:
"Bearer"
Momento de expiração (Unix timestamp, em segundos).
Exemplo:
1639658298
Momento de emissão (Unix timestamp, em segundos).
Exemplo:
1639571898