Skip to main content

Get Up and Running

This quickstart guide will walk you through setting up the Medical Appointment Management API locally and making your first API calls.
1

Prerequisites

Before you begin, ensure you have the following installed:
  • .NET 10 SDK - Download from dotnet.microsoft.com
  • Git - For cloning the repository
  • A code editor like Visual Studio, VS Code, or Rider (optional)
Verify your .NET installation:
dotnet --version
You should see version 10.0 or higher.
2

Clone the Repository

Clone the project from GitHub:
git clone https://github.com/redox11223/ServiciosWebPreliminar.git
cd ServiciosWebPreliminar
3

Run the API

Start the API server:
dotnet run
The API will start on https://localhost:5001 and http://localhost:5000.You should see output similar to:
info: Microsoft.Hosting.Lifetime[14]
      Now listening on: https://localhost:5001
info: Microsoft.Hosting.Lifetime[14]
      Now listening on: http://localhost:5000
The first run may take a few moments as NuGet packages are restored and the project is compiled.
4

Access the API Documentation

Open your browser and navigate to the Scalar API documentation interface:
https://localhost:5001/scalar/v1
This provides an interactive interface where you can:
  • Browse all available endpoints
  • View request/response schemas
  • Test API calls directly from the browser
  • Generate code snippets for various languages
Scalar provides a beautiful, modern UI for exploring the OpenAPI documentation. It’s more feature-rich than the standard Swagger UI.
5

Create Your First Specialty

Create a medical specialty using the only fully functional endpoint:
curl -X POST https://localhost:5001/api/Especialidad \
  -H "Content-Type: application/json" \
  -d '{
    "nombre": "Cardiología"
  }'
{
  "id": 1,
  "nombre": "Cardiología"
}
6

List All Specialties

Retrieve all specialties:
curl https://localhost:5001/api/Especialidad
[
  {
    "id": 1,
    "nombre": "Cardiología"
  }
]
7

Get a Specific Specialty

Get a specialty by ID:
curl https://localhost:5001/api/Especialidad/1
8

Update a Specialty

Update an existing specialty:
curl -X PUT https://localhost:5001/api/Especialidad/1 \
  -H "Content-Type: application/json" \
  -d '{
    "nombre": "Cardiología Clínica"
  }'
{
  "id": 1,
  "nombre": "Cardiología Clínica"
}
9

Try Other Common Specialties

Create additional specialties to explore the API:
# Pediatrics
curl -X POST https://localhost:5001/api/Especialidad \
  -H "Content-Type: application/json" \
  -d '{"nombre": "Pediatría"}'

# Dermatology
curl -X POST https://localhost:5001/api/Especialidad \
  -H "Content-Type: application/json" \
  -d '{"nombre": "Dermatología"}'

# General Medicine
curl -X POST https://localhost:5001/api/Especialidad \
  -H "Content-Type: application/json" \
  -d '{"nombre": "Medicina General"}'
10

Delete a Specialty

Delete a specialty (if no longer needed):
curl -X DELETE https://localhost:5001/api/Especialidad/1
Returns 204 No Content on success.
This is a preliminary prototype. Patient, Doctor, and Appointment endpoints are not yet implemented. Only the Especialidad resource has functional CRUD operations.

Next Steps

Now that you have the API running and have made your first calls:

Explore All Endpoints

Browse the complete API reference with all available operations

Understand the Architecture

Learn about the service-oriented design and architecture patterns

Learn About Data Models

Explore the entity structures and relationships

Development Guide

Learn how to extend and customize the API

Common Issues

If ports 5000 or 5001 are already in use, you can specify different ports:
dotnet run --urls "https://localhost:7001;http://localhost:7000"
If you encounter SSL certificate errors in development, trust the development certificate:
dotnet dev-certs https --trust
Ensure .NET 10 SDK is installed and added to your PATH. Download from dotnet.microsoft.com.

Build docs developers (and LLMs) love