Skip to main content
POST
/
Donantes
/
CrearDonante
Create Donor
curl --request POST \
  --url https://api.example.com/Donantes/CrearDonante \
  --header 'Content-Type: application/json' \
  --data '
{
  "nombredonante": "<string>",
  "domicilio": "<string>"
}
'
{
  "200": {},
  "400": {},
  "result": "<string>"
}

Overview

This endpoint creates a new donor record in the system with their name and address information.

Request Body

The request body should be a JSON object with the following fields:
nombredonante
string
required
The full name of the donor
domicilio
string
required
The address/domicile of the donor

Response

result
string
A success message indicating the donor was created, typically containing the donor ID or confirmation details

Status Codes

200
OK
Donor successfully created. Returns the result string with donor information.
400
Bad Request
Request failed due to:
  • Missing or invalid donor data
  • Database error during creation
  • Donor could not be inserted

Example Request

curl -X POST "https://api.donasf.com/Donantes/CrearDonante" \
  -H "Content-Type: application/json" \
  -d '{
    "nombredonante": "Juan Pérez García",
    "domicilio": "Calle Principal 123, Ciudad de México"
  }'

Example Response

"Donante creado exitosamente con ID: 12345"

Notes

  • Both nombredonante and domicilio fields are required
  • The response returns a string message with the creation result
  • If the donor cannot be inserted, a 400 error is returned with details

Build docs developers (and LLMs) love