Investment
curl --request GET \
--url https://cashboard-f5x2.onrender.com/investment/{id}import requests
url = "https://cashboard-f5x2.onrender.com/investment/{id}"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://cashboard-f5x2.onrender.com/investment/{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://cashboard-f5x2.onrender.com/investment/{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://cashboard-f5x2.onrender.com/investment/{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://cashboard-f5x2.onrender.com/investment/{id}")
.asString();require 'uri'
require 'net/http'
url = URI("https://cashboard-f5x2.onrender.com/investment/{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{
"desc": "Bitcoin",
"currentAmount": 95000,
"category": "Cryptocurrency",
"_id": "662ff8a5712cd9fd793e1fb7",
"createdAt": "2024-04-29T19:44:37.441Z",
"updatedAt": "2024-04-29T19:44:37.441Z"
}{
"status": "error",
"message": "Could not find an investment"
}Investments
Investment
This endpoint returns the specified investment.
Endpoint: https://cashboard-f5x2.onrender.com/investment/:id
Query Parameters: User UUID
Path Parameters: Investment ID
The response body is a JSON object that contains the specified investment with the following details:
-
desc (string) - A description of the investment account
-
category (string) - Category for the investment
-
currentAmount (number) - the investment’s balance
-
_id (string) - the unique identifier for the investment
-
createdAt (timestamp) - whenthe investment was created
-
updatedAt (timestamp) - when the investment was last updated
GET
/
investment
/
{id}
Investment
curl --request GET \
--url https://cashboard-f5x2.onrender.com/investment/{id}import requests
url = "https://cashboard-f5x2.onrender.com/investment/{id}"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://cashboard-f5x2.onrender.com/investment/{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://cashboard-f5x2.onrender.com/investment/{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://cashboard-f5x2.onrender.com/investment/{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://cashboard-f5x2.onrender.com/investment/{id}")
.asString();require 'uri'
require 'net/http'
url = URI("https://cashboard-f5x2.onrender.com/investment/{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{
"desc": "Bitcoin",
"currentAmount": 95000,
"category": "Cryptocurrency",
"_id": "662ff8a5712cd9fd793e1fb7",
"createdAt": "2024-04-29T19:44:37.441Z",
"updatedAt": "2024-04-29T19:44:37.441Z"
}{
"status": "error",
"message": "Could not find an investment"
}
