This API Endpoint is https://budget-api.sililoconnect.com
let endpoint = 'https://budget-api.sililoconnect.com';
<?php
$endpoint = 'https://budget-api.sililoconnect.com';
This API requires authentication using Bearer tokens. All requests (except for /auth/*) should have a
valid Bearer token in the header.
The authentication process involves obtaining a token by logging in using the /auth/login endpoint. The
obtained token should then be included in the Authorization header for subsequent authenticated requests.
The Personal Budgeting App allows users to manage their budgets categorized in events. Here is a step-by-step guide on how to use the app:
Start by creating an event. An event represents a specific category or occasion for which you want to manage a
budget. Use the /events/create endpoint to create a new event. Provide the required information
such as
the event name and any additional details. A user can creates several events as needed.
Once an event is created, you can view a list of all your events using the /events endpoint. This
will provide details such as the event name, total of budgets amount, and the number of budget items associated
with each event.
After creating an event, you can create a budget in that event. Budgets helps you allocate funds for different
purposes within the event. Use the /budgets/create/{event_id} endpoint, where
{event_id}
is the ID of the event for which you want to create a budget. Provide the budget name and any additional
details.
NOTE: A user can have several budgets for different purposes related to a single Event.
View a list of all budgets associated with a specific event using the /budgets/index/{event_id}
endpoint. This will display details such as the budget name, total budget amount, and the number of budget items
associated with each budget.
Within each budget, you can add budget items to represent specific expenses or allocations. Use the
/budgets/create-item/{budget_id} endpoint, where {budget_id} is the ID of the budget
to
which you want to add an item. Provide the item name, amount, and any additional details.
View a list of all budget items associated with a specific budget using the
/budgets/list-items/{budget_id} endpoint. This will display details such as the item name and
amount.
You can also update or delete individual budget items using the respective endpoints.
By following these steps, users can effectively manage their budgets, allocate funds to specific events, and keep track of their financial activities.
Below is are code examples of requests. Ensure to replace YOUR_BEARER_TOKEN with the
actual Bearer token obtained after login.
let endpoint = 'https://budget-api.sililoconnect.com';
$.ajax({
url: endpoint + "/events",
method: "GET",
headers: {
"Authorization": "Bearer YOUR_BEARER_TOKEN"
},
success: function (data) {
console.log("Request successful", data);
},
error: function (error) {
console.error("Request failed", error);
}
});
<?php
$endpoint = 'https://budget-api.sililoconnect.com';
$bearerToken = 'YOUR_BEARER_TOKEN';
// Data to be sent in the POST request (if any)
$postData = [
// Add your POST data here
];
// Initialize cURL session
$ch = curl_init();
// Set cURL options
curl_setopt($ch, CURLOPT_URL, $endpoint . '/events');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'GET');
curl_setopt($ch, CURLOPT_HTTPHEADER, [
'Authorization: Bearer ' . $bearerToken,
'Content-Type: application/json', // Adjust content type if needed
]);
// Add POST data if present
if (!empty($postData)) {
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($postData));
}
// Execute cURL session and get the response
$response = curl_exec($ch);
// Check for errors
if (curl_errno($ch)) {
echo 'Curl error: ' . curl_error($ch);
}
// Close cURL session
curl_close($ch);
// Output the response
echo "Response: " . $response;
?>
Make sure to include the Bearer token in the Authorization header for each
authenticated request.