GET api/Expenses?categoryID={categoryID}
Retrieves Expenses based on the provided category.
Request Information
URI Parameters
Name | Description | Type | Additional information |
---|---|---|---|
categoryID |
The ID of the category to filter the Expenses. |
integer |
Required |
Body Parameters
None.
Response Information
Resource Description
A list of Expenses matching the provided category ID.
Collection of ExpenseName | Description | Type | Additional information |
---|---|---|---|
Id |
The unique identifier of the expense. |
integer |
None. |
Description |
The description of the expense. |
string |
None. |
Amount |
The amount of the expense. |
decimal number |
None. |
Date |
The date of the expense. |
date |
None. |
CategoryID |
The category of the expense. |
integer |
None. |
Response Formats
application/json, text/json
Sample:
[ { "Id": 1, "Description": "sample string 2", "Amount": 3.0, "Date": "2025-04-29T16:14:03.0105045+00:00", "CategoryID": 5 }, { "Id": 1, "Description": "sample string 2", "Amount": 3.0, "Date": "2025-04-29T16:14:03.0105045+00:00", "CategoryID": 5 } ]
application/xml, text/xml
Sample:
<ArrayOfExpense xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/OTJServices.Models"> <Expense> <Amount>3</Amount> <CategoryID>5</CategoryID> <Date>2025-04-29T16:14:03.0105045+00:00</Date> <Description>sample string 2</Description> <Id>1</Id> </Expense> <Expense> <Amount>3</Amount> <CategoryID>5</CategoryID> <Date>2025-04-29T16:14:03.0105045+00:00</Date> <Description>sample string 2</Description> <Id>1</Id> </Expense> </ArrayOfExpense>