Get swap
curl --request GET \
--url https://api.example.com/exchange/swap/{id}import requests
url = "https://api.example.com/exchange/swap/{id}"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.example.com/exchange/swap/{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://api.example.com/exchange/swap/{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://api.example.com/exchange/swap/{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://api.example.com/exchange/swap/{id}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/exchange/swap/{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{
"data": {
"correlation_id": "7da742ea-a1bc-11ee-b907-560f156a658b",
"created_at": "2021-01-01T00:00:00Z",
"customer": {
"email": "customer@email.com",
"id": "1",
"name": "User 1",
"type": "user"
},
"id": "7da8e726-a1bc-11ee-80cf-560f156a658b",
"provider": {
"email": "provider@email.com",
"id": "1",
"name": "Provider 1",
"type": "provider"
},
"source_amount": {
"amount": 1,
"currency": "USD"
},
"status": "success",
"symbol": "USD-NGN",
"target_amount": {
"amount": 1000,
"currency": "NGN"
},
"updated_at": "2021-01-01T00:00:00Z"
}
}"<string>"exchange
Get swap
GET
/
exchange
/
swap
/
{id}
Get swap
curl --request GET \
--url https://api.example.com/exchange/swap/{id}import requests
url = "https://api.example.com/exchange/swap/{id}"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.example.com/exchange/swap/{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://api.example.com/exchange/swap/{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://api.example.com/exchange/swap/{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://api.example.com/exchange/swap/{id}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/exchange/swap/{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{
"data": {
"correlation_id": "7da742ea-a1bc-11ee-b907-560f156a658b",
"created_at": "2021-01-01T00:00:00Z",
"customer": {
"email": "customer@email.com",
"id": "1",
"name": "User 1",
"type": "user"
},
"id": "7da8e726-a1bc-11ee-80cf-560f156a658b",
"provider": {
"email": "provider@email.com",
"id": "1",
"name": "Provider 1",
"type": "provider"
},
"source_amount": {
"amount": 1,
"currency": "USD"
},
"status": "success",
"symbol": "USD-NGN",
"target_amount": {
"amount": 1000,
"currency": "NGN"
},
"updated_at": "2021-01-01T00:00:00Z"
}
}"<string>"Path Parameters
Swap ID
Response
Swap
Response schema for swap
Swap details
Show child attributes
Show child attributes
Example:
{ "correlation_id": "7da742ea-a1bc-11ee-b907-560f156a658b", "created_at": "2021-01-01T00:00:00Z", "customer": { "email": "customer@email.com", "id": "1", "name": "User 1", "type": "user" }, "id": "7da8e726-a1bc-11ee-80cf-560f156a658b", "provider": { "email": "provider@email.com", "id": "1", "name": "Provider 1", "type": "provider" }, "source_amount": { "amount": 1, "currency": "USD" }, "status": "success", "symbol": "USD-NGN", "target_amount": { "amount": 1000, "currency": "NGN" }, "updated_at": "2021-01-01T00:00:00Z" }
⌘I