All Expenses
curl --request GET \
--url https://cashboard-f5x2.onrender.com/expenseimport requests
url = "https://cashboard-f5x2.onrender.com/expense"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://cashboard-f5x2.onrender.com/expense', 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/expense",
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/expense"
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/expense")
.asString();require 'uri'
require 'net/http'
url = URI("https://cashboard-f5x2.onrender.com/expense")
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{
"expenses": [
{
"desc": "Electricity bill",
"category": "Utility",
"date": "2024-02-04T00:00:00.000Z",
"account": "662fbf9eac827e370c18d4b9",
"amount": 1000,
"_id": "662fce008f1d17198913a0ab"
}
]
}{
"status": "error",
"message": "Expenses not found!"
}Expenses
All Expenses
This endpoint is used to get all expenses for a specific user.
Endpoint: https://cashboard-f5x2.onrender.com/expense
Query: User’s UUID
The response will be a JSON object that includes an array of all the user’s expenses.
Each expense object in the array will have the following properties:
-
desc (string): Description of the expense
-
category (string): Category of the expense
-
date (timestamp): Date of the expense
-
account (string): Account associated with the expense
-
amount (number): Amount of the expense
-
_id (string): Unique identifier for the expense
GET
/
expense
All Expenses
curl --request GET \
--url https://cashboard-f5x2.onrender.com/expenseimport requests
url = "https://cashboard-f5x2.onrender.com/expense"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://cashboard-f5x2.onrender.com/expense', 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/expense",
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/expense"
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/expense")
.asString();require 'uri'
require 'net/http'
url = URI("https://cashboard-f5x2.onrender.com/expense")
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{
"expenses": [
{
"desc": "Electricity bill",
"category": "Utility",
"date": "2024-02-04T00:00:00.000Z",
"account": "662fbf9eac827e370c18d4b9",
"amount": 1000,
"_id": "662fce008f1d17198913a0ab"
}
]
}{
"status": "error",
"message": "Expenses not found!"
}Query Parameters
required
Response
OK
The response is of type object.

