Operations
Retrieve an Operation
The single operation endpoint provides information about a specific operation.
GET
/
operations
/
{id}
Retrieve an Operation
curl --request GET \
--url 'https://mainnet.stellar.validationcloud.io/v1/<YOUR_API_KEY_HERE>/operations/{id}'import requests
url = "https://mainnet.stellar.validationcloud.io/v1/<YOUR_API_KEY_HERE>/operations/{id}"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://mainnet.stellar.validationcloud.io/v1/<YOUR_API_KEY_HERE>/operations/{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://mainnet.stellar.validationcloud.io/v1/<YOUR_API_KEY_HERE>/operations/{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://mainnet.stellar.validationcloud.io/v1/<YOUR_API_KEY_HERE>/operations/{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://mainnet.stellar.validationcloud.io/v1/<YOUR_API_KEY_HERE>/operations/{id}")
.asString();require 'uri'
require 'net/http'
url = URI("https://mainnet.stellar.validationcloud.io/v1/<YOUR_API_KEY_HERE>/operations/{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{
"_links": {
"self": {
"href": "https://horizon-testnet.stellar.org/operations/121692259040116737"
},
"transaction": {
"href": "https://horizon-testnet.stellar.org/transactions/f92a9648c1084d1de0fd786faac5d5e1637d4127c60841d2366c70d2e7f77b85"
},
"effects": {
"href": "https://horizon-testnet.stellar.org/operations/121692259040116737/effects"
},
"succeeds": {
"href": "https://horizon-testnet.stellar.org/effects?order=desc&cursor=121692259040116737"
},
"precedes": {
"href": "https://horizon-testnet.stellar.org/effects?order=asc&cursor=121692259040116737"
}
},
"id": "121692259040116737",
"paging_token": "121692259040116737",
"transaction_successful": true,
"source_account": "GBDVKE33GVVMBXX73OHIBRP6RAHKHHW2P4PQVV6UNOKQCOXU7GNUM4QI",
"type": "manage_offer",
"type_i": 3,
"created_at": "2020-02-21T20:10:21Z",
"transaction_hash": "f92a9648c1084d1de0fd786faac5d5e1637d4127c60841d2366c70d2e7f77b85",
"amount": "10000.0000000",
"price": "0.0704336",
"price_r": {
"n": 44021,
"d": 625000
},
"buying_asset_type": "credit_alphanum4",
"buying_asset_code": "USD",
"buying_asset_issuer": "GDUKMGUGDZQK6YHYA5Z6AY2G4XDSZPSZ3SW5UN3ARVMO6QSRDWP5YLEX",
"selling_asset_type": "native",
"offer_id": 161536436
}The single operation endpoint provides information about a specific operation.
This method will use
20 Compute Units.
Reference: Here
Path Parameters
The ID number for this operation.
Example:
121692259040116740
Query Parameters
Set to transactions to include the transactions which created each of the operations in the response.
Retrieve an Operation
curl --request GET \
--url 'https://mainnet.stellar.validationcloud.io/v1/<YOUR_API_KEY_HERE>/operations/{id}'import requests
url = "https://mainnet.stellar.validationcloud.io/v1/<YOUR_API_KEY_HERE>/operations/{id}"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://mainnet.stellar.validationcloud.io/v1/<YOUR_API_KEY_HERE>/operations/{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://mainnet.stellar.validationcloud.io/v1/<YOUR_API_KEY_HERE>/operations/{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://mainnet.stellar.validationcloud.io/v1/<YOUR_API_KEY_HERE>/operations/{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://mainnet.stellar.validationcloud.io/v1/<YOUR_API_KEY_HERE>/operations/{id}")
.asString();require 'uri'
require 'net/http'
url = URI("https://mainnet.stellar.validationcloud.io/v1/<YOUR_API_KEY_HERE>/operations/{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{
"_links": {
"self": {
"href": "https://horizon-testnet.stellar.org/operations/121692259040116737"
},
"transaction": {
"href": "https://horizon-testnet.stellar.org/transactions/f92a9648c1084d1de0fd786faac5d5e1637d4127c60841d2366c70d2e7f77b85"
},
"effects": {
"href": "https://horizon-testnet.stellar.org/operations/121692259040116737/effects"
},
"succeeds": {
"href": "https://horizon-testnet.stellar.org/effects?order=desc&cursor=121692259040116737"
},
"precedes": {
"href": "https://horizon-testnet.stellar.org/effects?order=asc&cursor=121692259040116737"
}
},
"id": "121692259040116737",
"paging_token": "121692259040116737",
"transaction_successful": true,
"source_account": "GBDVKE33GVVMBXX73OHIBRP6RAHKHHW2P4PQVV6UNOKQCOXU7GNUM4QI",
"type": "manage_offer",
"type_i": 3,
"created_at": "2020-02-21T20:10:21Z",
"transaction_hash": "f92a9648c1084d1de0fd786faac5d5e1637d4127c60841d2366c70d2e7f77b85",
"amount": "10000.0000000",
"price": "0.0704336",
"price_r": {
"n": 44021,
"d": 625000
},
"buying_asset_type": "credit_alphanum4",
"buying_asset_code": "USD",
"buying_asset_issuer": "GDUKMGUGDZQK6YHYA5Z6AY2G4XDSZPSZ3SW5UN3ARVMO6QSRDWP5YLEX",
"selling_asset_type": "native",
"offer_id": 161536436
}