Skip to content
This repository was archived by the owner on Mar 25, 2026. It is now read-only.

dani01Lost4ever/WebApplicationApi

Repository files navigation

WebApplicationApi

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 Stack

C# Microsoft Azure Azure Cosmos DB
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

Project Structure

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

Getting Started

Prerequisites

  • .NET 6 SDK
  • Access to the Azure Cosmos DB Table Storage account

Run locally

git clone https://github.com/dani01Lost4ever/WebApplicationApi.git
cd WebApplicationApi
dotnet run

Swagger UI will be available at https://localhost:<port>/swagger when running in Development mode.

Base URL

https://questionuser.azurewebsites.net/api/

API Endpoints

All endpoints are under the People controller.


1. Get latest N questions

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

2. Get questions between two dates

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

3. Get questions between two dates filtered by state

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

4. Get questions by province

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

5. Get question count per province

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 }
]

Data Model

User (Question record)

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)

Error Responses

Status Code Meaning
400 Bad request — invalid or missing parameters
500 Internal server error — database or server-side failure

Team

GitHub
dani01Lost4ever
CavaliereDavid
catgrasso
Rikymeggio1234
godwin-17

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages