POST institutions - ocariot/api-gateway GitHub Wiki
Description
Register a new institution.
Permissions:
- Only Admin user can do this.
Scope
institutions:create
URL
Request body
{
"type": "Institute of Scientific Research",
"name": "NUTES/UEPB",
"address": "Av. Juvêncio Arruda, S/N - Universitário, Campina Grande - PB, 58429-600",
"latitude": "-7.2100766",
"longitude": "-35.9175756"
}
Curl example
curl -X POST "https://localhost/v1/institutions" -H "accept: application/json" -H "Authorization: Bearer YOUR_ACCESS_TOKEN" -H "Content-Type: application/json" -d "{"type":"Institute of Scientific Research","name":"NUTES/UEPB","address":"Av. Juvêncio Arruda, S/N - Universitário, Campina Grande - PB, 58429-600","latitude":"-7.2100766","longitude":"-35.9175756"}"
Response body
-
201
Institution saved sucessfully.{ "id": "5db32dcabec1431c51ae15fc", "type": "Institute of Scientific Research", "name": "NUTES/UEPB", "address": "Av. Juvêncio Arruda, S/N - Universitário, Campina Grande - PB, 58429-600", "latitude": -7.2100766, "longitude": -35.9175756 }
-
400
Validation errors-
- Example
{ "code": 400, "message": "Required fields were not provided...", "description": "name, type are required!" }
-
- Example
{ "code": 400, "message": "One or more request fields are invalid...", "description": "type must have at least one character!" }
-
- Example
{ "code": 400, "message": "One or more request fields are invalid...", "description": "type must be a string!" }
-
403
Permission Error -
409
Conflict Error