API Endpoint: http://pm-api.herokuapp.com/public/users
Authentication
Request
Endpoint : "/users"
e.g. curl http://pm-api.herokuapp.com/public/users -i -u test:pass1234 -X POST -d "firstname=chibunna&lastname=odunoye&gender=M&date_of_birth=2015-04-08"
Method: POST
Data:
{
"firstname": "chibunna",
"lastname": "oduonye",
"gender": "M",
"date_of_birth": "2015-04-08"
}
Response
Code: 200
Data:
{
"id": "1",
"firstname": "chibunna",
"lastname": "oduonye",
"gender": "M",
"date_of_birth": "2015-04-08",
"date_created": "2014-07-17T03:03:34",
"date_updated": "2014-07-17T03:03:34"
}
Request
Endpoint : "/users"
e.g. curl http://pm-api.herokuapp.com/public/users -i -u test:pass1234
or
e.g. curl http://pm-api.herokuapp.com/public/users?filter_field=firstname&filter_value=chibunna -i -u test:pass1234
Method: GET
Parameters (Optional):
Response
Code: 200
Data:
[
{
"id": "1",
"firstname": "chibunna",
"lastname": "oduonye",
"gender": "M",
"date_of_birth": "1990-04-08",
"date_created": "2014-07-17T03:03:34",
"date_updated": "2014-07-17T03:03:34"
},
{
"id": "2",
"firstname": "Godwin",
"lastname": "Orubebe",
"gender": "M",
"date_of_birth": "1965-04-08",
"date_created": "2014-07-17T04:12:25",
"date_updated": "2014-07-17T04:12:25"
}
]
Request
Endpoint : "/users/{id}"
e.g. curl http://pm-api.herokuapp.com/public/users/1 -i -u test:pass1234
Method: GET
Response:
Code: 200
Data:
{
"id": "1",
"firstname": "chibunna",
"lastname": "oduonye",
"gender": "M",
"date_of_birth": "2015-04-08",
"date_created": "2014-07-17T03:03:34",
"date_updated": "2014-07-17T03:03:34"
}
Request
Method: PUT
Endpoint: "users/{id}"
e.g. curl http://pm-api.herokuapp.com/public/users/2 -i -u test:pass1234 -X PUT -d "firstname=Godwin&lastname=Jega&gender=M&date_of_birth=2015-04-08"
Payload:
{
"id": "2"
"firstname": "Godwin",
"lastname": "Jega",
"gender": "M",
"date_of_birth": "2015-04-08"
}
Response
Code: 200
Data:
{
"id": "2"
"firstname": "Godwin",
"lastname": "Jega",
"gender": "M",
"date_of_birth": "2015-04-08",
"date_created": "2014-07-17T04:12:25",
"date_updated": "2014-07-17T18:44:19"
}
Request
Method: DELETE
Endpoint: "users/{id}"
e.g curl http://pm-api.herokuapp.com/public/users/1 -i -u test:pass1234 -X DELETE
Response
Code: 200
Data: