获取测试模式 handoff 令牌
curl --request POST \
--url https://api.qbank.cl/platform/v1/auth/environment-handoff \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.qbank.cl/platform/v1/auth/environment-handoff"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.qbank.cl/platform/v1/auth/environment-handoff', 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.qbank.cl/platform/v1/auth/environment-handoff",
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>"
],
]);
$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.qbank.cl/platform/v1/auth/environment-handoff"
req, _ := http.NewRequest("POST", 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.post("https://api.qbank.cl/platform/v1/auth/environment-handoff")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.qbank.cl/platform/v1/auth/environment-handoff")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"handoff_token": "eyJqdGkiOiI2ZjFjMDJhYS0uLi4ifQ.9zXk1v…",
"expires_at": "2026-07-13T12:01:00Z",
"exchange_url": "https://cryptobank.qbank.cl/platform/v1/auth/handoff"
}{
"error": "session_required",
"message": "environment handoff requires a member session"
}获取测试模式 handoff 令牌
签发一个一次性令牌(有效期 60 秒),将当前 member 会话转移到测试 环境 —— 这就是控制台一键 test/live 切换的底层机制,无需再次登录, 也无需新的 OTP 验证。只有 live 环境签发 handoff,且只有 member 会话(JWT)可以请求:API 密钥永远不会跨环境(每个环境管理自己的 密钥)。
POST
/
v1
/
auth
/
environment-handoff
获取测试模式 handoff 令牌
curl --request POST \
--url https://api.qbank.cl/platform/v1/auth/environment-handoff \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.qbank.cl/platform/v1/auth/environment-handoff"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.qbank.cl/platform/v1/auth/environment-handoff', 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.qbank.cl/platform/v1/auth/environment-handoff",
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>"
],
]);
$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.qbank.cl/platform/v1/auth/environment-handoff"
req, _ := http.NewRequest("POST", 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.post("https://api.qbank.cl/platform/v1/auth/environment-handoff")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.qbank.cl/platform/v1/auth/environment-handoff")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"handoff_token": "eyJqdGkiOiI2ZjFjMDJhYS0uLi4ifQ.9zXk1v…",
"expires_at": "2026-07-13T12:01:00Z",
"exchange_url": "https://cryptobank.qbank.cl/platform/v1/auth/handoff"
}{
"error": "session_required",
"message": "environment handoff requires a member session"
}最后修改于 2026年7月18日
⌘I