A RESTful API built with ASP.NET Core 6 that provides access to citizen question/request data stored in Azure Cosmos DB Table Storage. This API is part of a larger project shared with a Front-end team and a Mobile App team.
| Technology | Version | Purpose |
|---|---|---|
| C# / ASP.NET Core | .NET 6 | API framework |
| Azure Cosmos DB Table Storage | — | Database |
| Swashbuckle (Swagger) | 6.5.0 | API documentation |
| WindowsAzure.Storage | 9.3.3 | Azure Table client |
WebApplicationApi/
├── Controllers/
│ └── PeopleController.cs # All API endpoints
├── Program.cs # App bootstrap and middleware
├── appsettings.json # App configuration
├── WebApplicationApi.csproj # Project dependencies
└── icons/ # Tech stack icons
- .NET 6 SDK
- Access to the Azure Cosmos DB Table Storage account
git clone https://github.com/dani01Lost4ever/WebApplicationApi.git
cd WebApplicationApi
dotnet runSwagger UI will be available at https://localhost:<port>/swagger when running in Development mode.
https://questionuser.azurewebsites.net/api/
All endpoints are under the People controller.
Retrieves the most recent n questions from the database.
- Method:
POST - URL:
/api/People/LastQuestions
| Parameter | Type | Required | Description |
|---|---|---|---|
quantity |
integer | Yes | Number of records to return (must be > 0) |
Example:
POST https://questionuser.azurewebsites.net/api/People/LastQuestions?quantity=2
Retrieves up to n questions submitted within a date range.
- Method:
POST - URL:
/api/People/GetQuestionsTimeOffset
| Parameter | Type | Required | Description |
|---|---|---|---|
quantity |
integer | Yes | Number of records to return (must be > 0) |
startDate |
date | Yes | Start of date range (e.g. 2000-01-01) |
endDate |
date | Yes | End of date range (e.g. 2030-01-01) |
Example:
POST https://questionuser.azurewebsites.net/api/People/GetQuestionsTimeOffset?startDate=2000-01-01&endDate=2030-01-01&quantity=3
Retrieves up to n questions within a date range, filtered by their current state.
- Method:
POST - URL:
/api/People/GetQuestionsTimeOffsetAndState
| Parameter | Type | Required | Description |
|---|---|---|---|
quantity |
integer | Yes | Number of records to return (must be > 0) |
startDate |
date | Yes | Start of date range |
endDate |
date | Yes | End of date range |
statoDellaDomanda |
integer | Yes | Question state: 1, 2, 3, or 4 |
Example:
POST https://questionuser.azurewebsites.net/api/People/GetQuestionsTimeOffsetAndState?startDate=2020-01-01&endDate=2025-01-01&quantity=1&statoDellaDomanda=1
Retrieves up to n questions submitted from a specific Italian province.
- Method:
POST - URL:
/api/People/ByProvince
| Parameter | Type | Required | Description |
|---|---|---|---|
quantity |
integer | Yes | Number of records to return (must be > 0) |
province |
string | Yes | Province name (letters only, e.g. Vicenza) |
Example:
POST https://questionuser.azurewebsites.net/api/People/ByProvince?quantity=4&province=Vicenza
Returns the total number of questions grouped by province, sorted alphabetically.
- Method:
GET - URL:
/api/People/userprovince
Example:
GET https://questionuser.azurewebsites.net/api/People/userprovince
Response:
[
{ "provincia": "Milano", "n_requests": 12 },
{ "provincia": "Vicenza", "n_requests": 7 }
]| Field | Type | Description |
|---|---|---|
Email |
string | User's email (partition key) |
DomandaID |
string | Unique question ID (row key) |
Nome |
string | First name |
Cognome |
string | Last name |
Indirizzo |
string | Street address |
CAP |
string | Postal code |
Comune |
string | Municipality |
Provincia |
string | Province |
DataPresentazioneDomanda |
DateTime | Date the question was submitted |
StatoDellaDomanda |
string | State of the question (1–4) |
| Status Code | Meaning |
|---|---|
400 |
Bad request — invalid or missing parameters |
500 |
Internal server error — database or server-side failure |
| GitHub |
|---|
| dani01Lost4ever |
| CavaliereDavid |
| catgrasso |
| Rikymeggio1234 |
| godwin-17 |