Get a listing
curl --request GET \
--url https://testnet.rail402.dev/discovery/resources/{id}import requests
url = "https://testnet.rail402.dev/discovery/resources/{id}"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://testnet.rail402.dev/discovery/resources/{id}', 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://testnet.rail402.dev/discovery/resources/{id}",
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://testnet.rail402.dev/discovery/resources/{id}"
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://testnet.rail402.dev/discovery/resources/{id}")
.asString();require 'uri'
require 'net/http'
url = URI("https://testnet.rail402.dev/discovery/resources/{id}")
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{
"resource": "<string>",
"type": "http",
"x402Version": 2,
"accepts": [
{
"scheme": "exact",
"network": "stellar:testnet",
"asset": "<string>",
"payTo": "<string>",
"amount": "<string>",
"maxTimeoutSeconds": 123,
"extra": {
"areFeesSponsored": true
}
}
],
"lastUpdated": "2023-11-07T05:31:56Z",
"extensions": {
"bazaar": {}
},
"rail402": {
"trust": "settled",
"settlements": 123,
"listings": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"network": "<string>",
"version": 123,
"trust": "settled",
"owner": "<string>",
"settlements": 123,
"firstCataloged": "2023-11-07T05:31:56Z",
"lastSettled": "2023-11-07T05:31:56Z",
"stellar": {
"checkedAt": "2023-11-07T05:31:56Z",
"domain": {
"host": "<string>",
"claimsOwner": true
}
}
}
],
"options": [
{
"listing": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"symbol": "<string>",
"name": "<string>",
"decimals": 123,
"receivable": true
}
],
"method": "<string>",
"toolName": "<string>"
},
"state": "pending",
"description": "<string>",
"mimeType": "<string>",
"serviceName": "<string>",
"tags": [
"<string>"
],
"iconUrl": "<string>"
}{
"error": {
"code": "discovery_listing_not_found",
"reason": "No listing has this identifier.",
"retryable": false
}
}{
"error": {
"code": "<string>",
"reason": "<string>",
"retryable": true,
"details": {}
}
}Discovery
Get a listing
One listing, on its one network, by id, published or quarantined, with its state.
GET
/
discovery
/
resources
/
{id}
Get a listing
curl --request GET \
--url https://testnet.rail402.dev/discovery/resources/{id}import requests
url = "https://testnet.rail402.dev/discovery/resources/{id}"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://testnet.rail402.dev/discovery/resources/{id}', 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://testnet.rail402.dev/discovery/resources/{id}",
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://testnet.rail402.dev/discovery/resources/{id}"
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://testnet.rail402.dev/discovery/resources/{id}")
.asString();require 'uri'
require 'net/http'
url = URI("https://testnet.rail402.dev/discovery/resources/{id}")
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{
"resource": "<string>",
"type": "http",
"x402Version": 2,
"accepts": [
{
"scheme": "exact",
"network": "stellar:testnet",
"asset": "<string>",
"payTo": "<string>",
"amount": "<string>",
"maxTimeoutSeconds": 123,
"extra": {
"areFeesSponsored": true
}
}
],
"lastUpdated": "2023-11-07T05:31:56Z",
"extensions": {
"bazaar": {}
},
"rail402": {
"trust": "settled",
"settlements": 123,
"listings": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"network": "<string>",
"version": 123,
"trust": "settled",
"owner": "<string>",
"settlements": 123,
"firstCataloged": "2023-11-07T05:31:56Z",
"lastSettled": "2023-11-07T05:31:56Z",
"stellar": {
"checkedAt": "2023-11-07T05:31:56Z",
"domain": {
"host": "<string>",
"claimsOwner": true
}
}
}
],
"options": [
{
"listing": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"symbol": "<string>",
"name": "<string>",
"decimals": 123,
"receivable": true
}
],
"method": "<string>",
"toolName": "<string>"
},
"state": "pending",
"description": "<string>",
"mimeType": "<string>",
"serviceName": "<string>",
"tags": [
"<string>"
],
"iconUrl": "<string>"
}{
"error": {
"code": "discovery_listing_not_found",
"reason": "No listing has this identifier.",
"retryable": false
}
}{
"error": {
"code": "<string>",
"reason": "<string>",
"retryable": true,
"details": {}
}
}Path Parameters
A listing's id (rail402.listings[].id).
Response
The listing.
Available options:
http, mcp Show child attributes
Show child attributes
bazaar, and an empty object for every other extension the resource declares in its 402 response.
Show child attributes
Show child attributes
The catalog listings behind the resource. A resource sold on several networks is one item with one listing per network.
Show child attributes
Show child attributes
Available options:
pending, published, quarantined