-
Notifications
You must be signed in to change notification settings - Fork 1
POST children
Jefferson Medeiros edited this page Feb 7, 2020
·
7 revisions
Register a new children.
Permissions:
- Only Admin user can do this.
children:create
{
"username": "BR9999",
"password": "mys3cr3tp4ss",
"institution_id": "5a62be07de34500146d9c624",
"gender": "male",
"age": 11
}
curl -X POST "https://localhost:3001/v1/children" -H "accept: application/json" -H "Content-Type: application/json" -d "{"username":"BR9999","password":"mys3cr3tp4ss","institution_id":"5a62be07de34500146d9c624","gender":"male","age":11}"
-
201
Child saved sucessfully.{ "id": "5db1cf6c099ed31587a74cf4", "username": "BR99999", "institution_id": "5a62be07de34500146d9c624", "gender": "male", "age": 11 }
-
400
Validation errors-
- Example
{ "code": 400, "message": "Required fields were not provided...", "description": "username, password, institution, gender, age are required!" }
-
- Example
{ "code": 400, "message": "One or more request fields are invalid...", "description": "Username must have at least one character!" }
-
- Example
{ "code": 400, "message": "One or more request fields are invalid...", "description": "username must be a string!" }
-
Invalid gender
{ "code": 400, "message": "One or more request fields are invalid...", "description": "The names of the allowed genders are: male, female." }
-
Invalid age (number)
{ "code": 400, "message": "One or more request fields are invalid...", "description": "Age cannot be less than or equal to zero!" }
-
Invalid date format (age or age_calc_date)
{ "code": 400, "message": "Date: {date_parameter}, is not in valid ISO 8601 format.", "description": "Date must be in the format: yyyy-MM-dd" }
-
Invalid year (age or age_calc_date)
{ "code": 400, "message": "Date {date_parameter} has year not allowed. The year must be greater than 1678 and less than 2261." }
-
Invalid day (age or age_calc_date)
{ "code": 400, "message": "Date: {date_parameter}, is not in valid ISO 8601 format." }
-
The date received is newer than the current system date (age or age_calc_date)
{ "code": 400, "message": "Datetime: {date_parameter}, cannot be used!", "description": "The 'age' and 'age_calc_date' fields can only receive past or present dates." }
-
409
Conflict Error
OCARIoT Account Microservice API (Full documentation)
- POST institutions
- GET institutions
- GET institutions.inst_id
- PATCH institutions.inst_id
- DELETE institutions.inst_id
- POST educators.children.groups
- GET educators.children.groups
- GET educators.children.groups.group_id
- PATCH educators.children.groups.group_id
- DELETE educators.children.groups.group_id
- POST healthprofessionals
- GET healthprofessionals
- GET healthprofessionals.hprof_id
- PATCH healthprofessionals.hprof_id