Skip to content

Latest commit

 

History

History
215 lines (178 loc) · 4.23 KB

README.md

File metadata and controls

215 lines (178 loc) · 4.23 KB

Coolest Projects - User Service

API

Error Format

All error http codes will return a json structure which will contain a list of errors inside the errorDetails variable.

 {
 	"errorDetails": [""] //list string error messages
 }

User Service

conf/routes


# User service
GET     /user/:email                controllers.UserController.get(email: String)
POST    /user/create                controllers.UserController.createUser()
POST    /user/update                controllers.UserController.update()
POST    /user/updatepassword        controllers.UserController.updatePassword()
POST    /user/authenticate          controllers.UserController.authenticate()

POST    /user/lostpassword/:username           controllers.UserController.lostPassword(username: String)

Create User

Heading Details
Url /user/create
Http Method POST

Request Body Format

 {
 	"firstname": "", //string
 	"lastname": "", //string
 	"dateOfBirth": DD-MM-YYYY, //date
 	"coderdojoId": 0l, //long
 	"email": "", //string
 	"password": "", //string
 	"acceptTerms": true | false, //boolean
 	"parentName": "", //string
    "parentEmail": "", //string
    "parentMobile": "", //string
    "twitter": "", //string
    "mobileNumber": "" //string
 }

Response Body Format

  • Http Success or Error Code
 {
    "id": 0l, //long
 	"firstname": "", //string
 	"lastname": "", //string
 	"dateOfBirth": DD-MM-YYYY, //date
 	"coderdojoId": 0l, //long
 	"email": "", //string
 	"parentName": "", //string
    "parentEmail": "", //string
    "parentMobile": "", //string
    "twitter": "", //string
    "mobileNumber": "", //string
    "profileImage": "",//string
    "roles": [
        {
            "id": 0l, //long
            "name": "" //string
        }
    ]
 }

Get User

Heading Details
Url /user/:email
Http Method GET

Request Body Format

No request body

Response Body Format

 {
    "id": 0l, //long
 	"firstname": "", //string
 	"lastname": "", //string
 	"dateOfBirth": DD-MM-YYYY, //date
 	"coderdojoId": 0l, //long
 	"email": "", //string
 	"parentName": "", //string
    "parentEmail": "", //string
    "parentMobile": "", //string
    "twitter": "", //string
    "mobileNumber": "", //string
    "profileImage": "",//string
    "roles": [
        {
            "id": 0l, //long
            "name": "" //string
        }
    ]
 }

Update User

Heading Details
Url /user/update
Http Method POST

Request Body Format

 {
     "id": 0l, //long
  	"firstname": "", //string
  	"lastname": "", //string
  	"dateOfBirth": DD-MM-YYYY, //date
  	"coderdojoId": 0l, //long
  	"email": "", //string
  	"parentName": "", //string
     "parentEmail": "", //string
     "parentMobile": "", //string
     "twitter": "", //string
     "mobileNumber": "" //string
 }

Response Body Format

  • Http Success or Error Code
 {
    "id": 0l, //long
 	"firstname": "", //string
 	"lastname": "", //string
 	"dateOfBirth": DD-MM-YYYY, //date
 	"coderdojoId": 0l, //long
 	"email": "", //string
 	"parentName": "", //string
    "parentEmail": "", //string
    "parentMobile": "", //string
    "twitter": "", //string
    "mobileNumber": "", //string
    "profileImage": "",//string
    "roles": [
        {
            "id": 0l, //long
            "name": "" //string
        }
    ]
 }

Update User Password

Heading Details
Url /user/updatepassword
Http Method POST

Request Body Format

 {
    "email": "", //string
 	"password": "" //string	
 }

Response Body Format

  • Http Success or Error Code
 {
    "id": 0l, //long
 	"firstname": "", //string
 	"lastname": "", //string
 	"dateOfBirth": DD-MM-YYYY, //date
 	"coderdojoId": 0l, //long
 	"email": "", //string
 	"parentName": "", //string
    "parentEmail": "", //string
    "parentMobile": "", //string
    "twitter": "", //string
    "mobileNumber": "", //string
    "profileImage": "",//string
    "roles": [
        {
            "id": 0l, //long
            "name": "" //string
        }
    ]
 }