This REST API provides a small system for managing people, offering the functionality to register a person by their first name, last name, CPF (Brazilian individual registry identification), date of birth, and personal phone numbers. In addition, it is also possible to query a record or list all records according to a sorting criterion.
The API was developed in Java with Spring Boot.
The project is also hosted on Heroku, click here to access it.
Click here to access the complete documentation made with swagger.
-
/persons
Finds all registered people.
/persons?sort=firstName
Returns all records ordered by name.
/persons?sort=birthDate
Returns all records ordered by birthdate.
/persons/{id}
Returns a person, if exists, by its id.
/persons/search/{name}
Returns a person, if exists, by its name. -
/persons
Allows you to register a new Person.
The request body requires the following properties: firstName, lastName, cpf, birthDate and phones(one or more).
Example:{ "firstName": "Elvis", "lastName": "Presley", "cpf": "123.456.789-00", "birthDate": "01-01-1930", "phones": [ { "type": "MOBILE", "number": "(11)987654321" } ] }
-
/persons/{id}
Allows you to update a record, if exists, by its id.
The request body requires the following properties: id, firstName, lastName, cpf, birthDate and phones(one or more).
Example:{ "firstName": "Elvis", "lastName": "Presley", "cpf": "123.456.789-00", "birthDate": "01-01-1935", "phones": [ { "type": "MOBILE", "number": "(11)987654321" } ] }
-
/persons/{id}
Removes a person, if exists, by its id.