All Investments
curl --request GET \
--url https://cashboard-f5x2.onrender.com/investmentimport requests
url = "https://cashboard-f5x2.onrender.com/investment"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://cashboard-f5x2.onrender.com/investment', 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",
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"
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")
.asString();require 'uri'
require 'net/http'
url = URI("https://cashboard-f5x2.onrender.com/investment")
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{
"investments": [
{
"desc": "Bitcoin",
"currentAmount": 95000,
"category": "Cryptocurrency",
"_id": "662ff8a5712cd9fd793e1fb7",
"createdAt": "2024-04-29T19:44:37.441Z",
"updatedAt": "2024-04-29T19:44:37.441Z"
},
{
"desc": "Bitcoin",
"currentAmount": 5000,
"category": "Cryptocurrency",
"_id": "662ff9e36e0d87944a3c4cf7",
"createdAt": "2024-04-29T19:49:55.065Z",
"updatedAt": "2024-04-29T19:49:55.065Z"
},
{
"desc": "Bitcoin",
"currentAmount": 5000,
"category": "Cryptocurrency",
"_id": "662ffab8df4fbf42a526c6d5",
"createdAt": "2024-04-29T19:53:28.755Z",
"updatedAt": "2024-04-29T19:53:28.755Z"
}
]
}{
"status": "error",
"message": "User not found!"
}Investments
All Investments
This endpoint gets all the investments for the specified user.
Endpoint: https://cashboard-f5x2.onrender.com/investment/
Query Parameters: User UUID
The response body is a JSON object that contains an array of all the user’s investments. An individual investment includes:
-
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
All Investments
curl --request GET \
--url https://cashboard-f5x2.onrender.com/investmentimport requests
url = "https://cashboard-f5x2.onrender.com/investment"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://cashboard-f5x2.onrender.com/investment', 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",
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"
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")
.asString();require 'uri'
require 'net/http'
url = URI("https://cashboard-f5x2.onrender.com/investment")
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{
"investments": [
{
"desc": "Bitcoin",
"currentAmount": 95000,
"category": "Cryptocurrency",
"_id": "662ff8a5712cd9fd793e1fb7",
"createdAt": "2024-04-29T19:44:37.441Z",
"updatedAt": "2024-04-29T19:44:37.441Z"
},
{
"desc": "Bitcoin",
"currentAmount": 5000,
"category": "Cryptocurrency",
"_id": "662ff9e36e0d87944a3c4cf7",
"createdAt": "2024-04-29T19:49:55.065Z",
"updatedAt": "2024-04-29T19:49:55.065Z"
},
{
"desc": "Bitcoin",
"currentAmount": 5000,
"category": "Cryptocurrency",
"_id": "662ffab8df4fbf42a526c6d5",
"createdAt": "2024-04-29T19:53:28.755Z",
"updatedAt": "2024-04-29T19:53:28.755Z"
}
]
}{
"status": "error",
"message": "User not found!"
}Query Parameters
Response
OK
The response is of type object.

