Overview
The Establishments API allows authenticated users to register and manage their dairy farm establishments. Each user can have one establishment associated with their account.
Base URL
Authentication Required: All endpoints require authentication via cookie-based JWT token.
Create Establishment
POST /establecimiento/registrar
curl -X POST https://api.tambo360.com/establecimiento/registrar \
-H "Content-Type: application/json" \
-H "Cookie: token=<jwt_token>" \
-d '{
"nombre": "Establecimiento Norte",
"localidad": "Rafaela",
"provincia": "Santa Fe"
}'
Registers a new dairy farm establishment for the authenticated user.
Request Body
Name of the establishment. Must contain at least 2 characters and at least one letter or number.
City or locality where the establishment is located. Minimum 2 characters.
Province or state where the establishment is located. Minimum 2 characters.
Response
HTTP status code (201 for success)
“Establecimiento creado correctamente”
Created establishment object: UUID of the establishment
201 Success
400 Validation Error
400 Already Exists
401 Unauthorized
{
"statusCode" : 201 ,
"message" : "Establecimiento creado correctamente" ,
"data" : {
"idEstablecimiento" : "c2b8e8a2-4f92-4f3f-b0c5-1a2b3c4d5e6f" ,
"nombre" : "Establecimiento Norte" ,
"localidad" : "Rafaela" ,
"provincia" : "Santa Fe" ,
"idUsuario" : "a1b2c3d4-5678-90ab-cdef-1234567890ab"
},
"success" : true
}
List Establishments
GET /establecimiento/listar
curl -X GET https://api.tambo360.com/establecimiento/listar \
-H "Cookie: token=<jwt_token>"
Retrieves the establishment(s) registered for the authenticated user.
Response
HTTP status code (200 for success)
“Establecimientos obtenidos correctamente”
Establishment data: UUID of the establishment
200 Success
401 Unauthorized
{
"statusCode" : 200 ,
"message" : "Establecimientos obtenidos correctamente" ,
"data" : {
"idEstablecimiento" : "c2b8e8a2-4f92-4f3f-b0c5-1a2b3c4d5e6f" ,
"nombre" : "Establecimiento Norte" ,
"localidad" : "Rafaela" ,
"provincia" : "Santa Fe" ,
"idUsuario" : "a1b2c3d4-5678-90ab-cdef-1234567890ab"
},
"success" : true
}
Error Responses
All endpoints may return the following error responses:
400 Bad Request
Invalid input data
Validation errors
User already has an establishment
401 Unauthorized
Missing authentication token
Invalid or expired JWT token
500 Internal Server Error
Unexpected server error
Database connection issues