cURL
curl --request POST \
--url https://api.example.com/rpc/Trails/GetSupportedIntentProtocols \
--header 'Content-Type: application/json' \
--data '{}'import requests
url = "https://api.example.com/rpc/Trails/GetSupportedIntentProtocols"
payload = {}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({})
};
fetch('https://api.example.com/rpc/Trails/GetSupportedIntentProtocols', 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/rpc/Trails/GetSupportedIntentProtocols",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$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.example.com/rpc/Trails/GetSupportedIntentProtocols"
payload := strings.NewReader("{}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
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.example.com/rpc/Trails/GetSupportedIntentProtocols")
.header("Content-Type", "application/json")
.body("{}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/rpc/Trails/GetSupportedIntentProtocols")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{}"
response = http.request(request)
puts response.read_body{
"versions": [
"v1"
]
}{
"error": "WebrpcEndpoint",
"code": 0,
"msg": "endpoint error",
"status": 400,
"cause": "<string>"
}{
"error": "WebrpcBadResponse",
"code": -5,
"msg": "bad response",
"status": 500,
"cause": "<string>"
}Protocol
GetSupportedIntentProtocols
POST
/
rpc
/
Trails
/
GetSupportedIntentProtocols
cURL
curl --request POST \
--url https://api.example.com/rpc/Trails/GetSupportedIntentProtocols \
--header 'Content-Type: application/json' \
--data '{}'import requests
url = "https://api.example.com/rpc/Trails/GetSupportedIntentProtocols"
payload = {}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({})
};
fetch('https://api.example.com/rpc/Trails/GetSupportedIntentProtocols', 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/rpc/Trails/GetSupportedIntentProtocols",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$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.example.com/rpc/Trails/GetSupportedIntentProtocols"
payload := strings.NewReader("{}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
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.example.com/rpc/Trails/GetSupportedIntentProtocols")
.header("Content-Type", "application/json")
.body("{}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/rpc/Trails/GetSupportedIntentProtocols")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{}"
response = http.request(request)
puts response.read_body{
"versions": [
"v1"
]
}{
"error": "WebrpcEndpoint",
"code": 0,
"msg": "endpoint error",
"status": 400,
"cause": "<string>"
}{
"error": "WebrpcBadResponse",
"code": -5,
"msg": "bad response",
"status": 500,
"cause": "<string>"
}Overview
GetSupportedIntentProtocols returns the intent-protocol versions the Trails API currently serves. Each version identifies a different orchestration + contracts stack; a quote produced for v1_5 cannot be committed against v1 and vice versa.
Use this alongside GetDefaultIntentProtocol and GetProtocolContracts to negotiate the correct version at runtime instead of hardcoding it.
Request
GetSupportedIntentProtocols takes no parameters.
Response
- versions (
IntentProtocolVersion[]) — supported versions in no particular order. Members:v1,v1_5.
Example
const response = await fetch(
'https://trails-api.sequence.app/rpc/Trails/GetSupportedIntentProtocols',
{
method: 'POST',
headers: {
'Content-Type': 'application/json',
'X-Access-Key': 'YOUR_ACCESS_KEY',
},
body: JSON.stringify({}),
},
)
const { versions } = await response.json()
console.log('Supported intent protocols:', versions)
Next Steps
GetDefaultIntentProtocol
Get the API’s current default protocol version
GetProtocolContracts
Resolve on-chain contract addresses for a protocol version
Body
application/json
The body is of type object.
Response
OK
[]IntentProtocolVersion
Represented as string on the server side
Available options:
v1, v1_5 Was this page helpful?