cURL
curl --request GET \
--url https://api.example.com/integrations/callbackimport requests
url = "https://api.example.com/integrations/callback"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.example.com/integrations/callback', 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.example.com/integrations/callback",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$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.example.com/integrations/callback"
req, _ := http.NewRequest("GET", url, nil)
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.example.com/integrations/callback")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/integrations/callback")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"message": "Connection successful",
"channelId": "488fa4bd-9e19-4eb5-b461-abeb38a0f9de"
}
Integrations
Callback de Autorização
Endpoint de retorno (callback) chamado pela plataforma do marketplace após o consentimento do usuário (fluxo OAuth).
GET
/
integrations
/
callback
cURL
curl --request GET \
--url https://api.example.com/integrations/callbackimport requests
url = "https://api.example.com/integrations/callback"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.example.com/integrations/callback', 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.example.com/integrations/callback",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$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.example.com/integrations/callback"
req, _ := http.NewRequest("GET", url, nil)
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.example.com/integrations/callback")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/integrations/callback")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"message": "Connection successful",
"channelId": "488fa4bd-9e19-4eb5-b461-abeb38a0f9de"
}
Normalmente, não é você quem chama esta rota. O marketplace injetará os parâmetros de
code, state e o ID de identificação na requisição para que o OmniDom armazene os tokens e crie uma nova MarketplaceConnection.
Query Parameters
string
required
Authorization code cedido temporariamente pela plataforma para obter o Token.
string
required
Token de estado que o OmniDom enviou para evitar ataques CSRF e rastrear a sessão do tenant.
string
Informação adicional que certas integrações como Shopee requerem.
Response
{
"message": "Connection successful",
"channelId": "488fa4bd-9e19-4eb5-b461-abeb38a0f9de"
}