curl --request POST \
--url http://localhost:8090/internal/v1/installations/{installation_id}/claim \
--header 'Authorization: Bearer <token>' \
--header 'X-Installation-Proof: <x-installation-proof>'import requests
url = "http://localhost:8090/internal/v1/installations/{installation_id}/claim"
headers = {
"X-Installation-Proof": "<x-installation-proof>",
"Authorization": "Bearer <token>"
}
response = requests.post(url, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'X-Installation-Proof': '<x-installation-proof>',
Authorization: 'Bearer <token>'
}
};
fetch('http://localhost:8090/internal/v1/installations/{installation_id}/claim', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_PORT => "8090",
CURLOPT_URL => "http://localhost:8090/internal/v1/installations/{installation_id}/claim",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"X-Installation-Proof: <x-installation-proof>"
],
]);
$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 := "http://localhost:8090/internal/v1/installations/{installation_id}/claim"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("X-Installation-Proof", "<x-installation-proof>")
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.post("http://localhost:8090/internal/v1/installations/{installation_id}/claim")
.header("X-Installation-Proof", "<x-installation-proof>")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("http://localhost:8090/internal/v1/installations/{installation_id}/claim")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Post.new(url)
request["X-Installation-Proof"] = '<x-installation-proof>'
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"installation_id": "<string>",
"handoff": "<string>"
}Canjear el proof del navegador por el handoff
Verifica el proof, registra el claim y devuelve el handoff de un solo uso que emite el backend comercial. Un proof equivocado y una instalación inexistente contestan el mismo 404: el endpoint no confirma ids.
curl --request POST \
--url http://localhost:8090/internal/v1/installations/{installation_id}/claim \
--header 'Authorization: Bearer <token>' \
--header 'X-Installation-Proof: <x-installation-proof>'import requests
url = "http://localhost:8090/internal/v1/installations/{installation_id}/claim"
headers = {
"X-Installation-Proof": "<x-installation-proof>",
"Authorization": "Bearer <token>"
}
response = requests.post(url, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'X-Installation-Proof': '<x-installation-proof>',
Authorization: 'Bearer <token>'
}
};
fetch('http://localhost:8090/internal/v1/installations/{installation_id}/claim', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_PORT => "8090",
CURLOPT_URL => "http://localhost:8090/internal/v1/installations/{installation_id}/claim",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"X-Installation-Proof: <x-installation-proof>"
],
]);
$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 := "http://localhost:8090/internal/v1/installations/{installation_id}/claim"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("X-Installation-Proof", "<x-installation-proof>")
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.post("http://localhost:8090/internal/v1/installations/{installation_id}/claim")
.header("X-Installation-Proof", "<x-installation-proof>")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("http://localhost:8090/internal/v1/installations/{installation_id}/claim")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Post.new(url)
request["X-Installation-Proof"] = '<x-installation-proof>'
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"installation_id": "<string>",
"handoff": "<string>"
}Autorizaciones
El conector de plataforma y el operador. Registra conexiones, entrega webhooks, corre la saga de instalación y da de alta conexiones custom. Es el único principal obligatorio del proceso: los otros tres se apagan dejando su token vacío, y una puerta que no se monta no la abre ningún token.
Encabezados
El proof del navegador, en claro y sólo acá. Del lado del servidor se guarda su SHA-256. Nunca viaja en la URL: una URL queda en el historial, en el Referer y en los logs del proxy.
1 - 256Parámetros de ruta
La instalación durable. El servidor exige el prefijo ins_ antes de consultar nada: un id que no tiene la forma contesta 404 igual que uno desconocido.
128^ins_.+