Skip to content

2018‐05 Microservices

Andres Leon Rangel edited this page Aug 25, 2023 · 5 revisions

Class Attendance Microservices

1 Attendance Microservice

The Attendance Microservice allows a user to register whether they will be present or absent from a paper.

Endpoint URI's

POST

GET

Attendance Microservice Swagger Definition

---
swagger: 2.0

info:
  version: "2017-09-04T07:10:30Z"
  title: "dev-attendance-microservice"

host: "v7uvize1nc.execute-api.us-east-1.amazonaws.com"
basePath: "/dev"
schemes:
  - "https"
paths:
  /attendance:
    get:
      produces:
        - "application/json"
      responses:
        200:
          description: "200 response"
          schema:
            $ref: "#/definitions/Attendees"
      security:
        - 1_0Hd1KoM5a: []
    post:
      consumes:
        - "application/json"
      produces:
        - "application/json"
      parameters:
        - in: "body"
          name: "Attendance"
          required: true
          schema:
            $ref: "#/definitions/Attendance"
      responses:
        201:
          description: "201 response"
          schema:
            $ref: "#/definitions/Attendance"
      security:
        - 1_0Hd1KoM5a: []
    options:
      consumes:
        - "application/json"
      produces:
        - "application/json"
      responses:
        200:
          description: "200 response"
          headers:
            Access-Control-Allow-Origin:
              type: "string"
            Access-Control-Allow-Methods:
              type: "string"
            Access-Control-Allow-Credentials:
              type: "string"
            Access-Control-Allow-Headers:
              type: "string"

securityDefinitions:
  1_0Hd1KoM5a:
    type: "apiKey"
    name: "Authorization"
    in: "header"
    x-amazon-apigateway-authtype: "cognito_user_pools"

definitions:
  Attendance:
    type: "object"
    properties:
      studentId:
        type: "string"
        description: "A unique student identifier."
      createdAt:
        type: "string"
        format: "date-time"
        description: "Record creation date (read only)."
      classDate:
        type: "string"
        format: "date-time"
        description: "Class date date (read only)."
      paperId:
        type: "string"
        description: "A unique paper identifier."
      status:
        type: "string"
        description: "Status of the student - present | absent"
    title: "Attendance"

  Attendees:
    title: "Attendees"
    type: "array"
    items:
      $ref: "#/definitions/Attendance"

Sample Payloads

Make sure header content-type is set to _application/json_ in your REST Client

Register attendance for a student

N.B. call the Composite Service addAttendance() function to register your attendance.

  • HTTP POST
  • HTTP GET

Header Authorization:<IdToken>

List all attendances

(filter parameters studentId=? and/or paperId=?)

Validation

Figure 14: validation for student registration

The add paper orchestration allows an administrator to add a new course to the system, checking that the lecturer and room Id's passed are valid Id's in the system before creating the paper.

AddPaper

Figure 15: Add paper Orchestration

The add registration orchestration allows a student to register to take a particular paper in the system, first checking that they are a valid student and that the desired paper exists within the system.

Orchestration

Figure 16: Add registration orchestration

The signup form allows a user to register an identity and link it to their user profile for access to the system. An administrator must've first created their user record in the system. This orchestration will check for the existence of the user record, create their identity and assign it to an identity group based off information in the user record.

serviceSignUp

Figure17: Signup orchestration

Endpoint URI's

POST

Composite Service Swagger Definition

swagger: "2.0"

info:
  version: "2017-09-02T10:54:01Z"
  title: "dev-composite-service"

host: "xgdeevdwh1.execute-api.us-east-1.amazonaws.com"
basePath: "/dev"

schemes:
  - "https"

paths:
  /addAttendance:
    post:
      produces:
        - "application/json"
      responses:
        200:
          description: "200 response"
          schema:
            $ref: "#/definitions/Empty"
    options:
      consumes:
        - "application/json"
      produces:
        - "application/json"
      responses:
        200:
          description: "200 response"
          schema:
            $ref: "#/definitions/Empty"
          headers:
            Access-Control-Allow-Origin:
              type: "string"
            Access-Control-Allow-Methods:
              type: "string"
            Access-Control-Allow-Headers:
              type: "string"

  /addPaper:
    post:
      produces:
        - "application/json"
      responses:
        200:
          description: "200 response"
          schema:
            $ref: "#/definitions/Empty"
    options:
      consumes:
        - "application/json"
      produces:
        - "application/json"
      responses:
        200:
          description: "200 response"
          schema:
            $ref: "#/definitions/Empty"
          headers:
            Access-Control-Allow-Origin:
              type: "string"
            Access-Control-Allow-Methods:
              type: "string"
            Access-Control-Allow-Headers:
              type: "string"

  /addRegistration:
    post:
      produces:
        - "application/json"
      responses:
        200:
          description: "200 response"
          schema:
            $ref: "#/definitions/Empty"
    options:
      consumes:
        - "application/json"
      produces:
        - "application/json"
      responses:
        200:
          description: "200 response"
          schema:
            $ref: "#/definitions/Empty"
          headers:
            Access-Control-Allow-Origin:
              type: "string"
            Access-Control-Allow-Methods:
              type: "string"
            Access-Control-Allow-Headers:
              type: "string"

  /signup:
    post:
      produces:
        - "application/json"
      responses:
        200:
          description: "200 response"
          schema:
            $ref: "#/definitions/Empty"

definitions:
  Empty:
    type: "object"
    title: "Empty Schema"

2 Identity Microservice

The Identity Microservice allows a user to login/logout/signup to the Attendance application.

Endpoint URI's

POST

GET

Identity Swagger Definition

swagger: "2.0"

info:
  version: "2017-09-01T22:11:06Z"
  title: "dev-identity-microservice"

host: "ctpoixww04.execute-api.us-east-1.amazonaws.com"
basePath: "/dev"

schemes:
  - "https"

paths:
  /identity:
    post:
      consumes:
        - "application/json"
      parameters:
        - in: "body"
          name: "CreateIdentityRequest"
          required: true
          schema:
            $ref: "#/definitions/CreateIdentityRequest"
      responses: {}
    options:
      consumes:
        - "application/json"
      produces:
        - "application/json"
      responses:
        200:
          description: "200 response"
          headers:
            Access-Control-Allow-Origin:
              type: "string"
            Access-Control-Allow-Methods:
              type: "string"
            Access-Control-Allow-Credentials:
              type: "string"
            Access-Control-Allow-Headers:
              type: "string"

  /identity/{id}/group:
    post:
      consumes:
        - "application/json"
      parameters:
        - in: "body"
          name: "AddIdentityToGroupRequest"
          required: true
          schema:
            $ref: "#/definitions/AddIdentityToGroupRequest"
      responses: {}
    options:
      consumes:
        - "application/json"
      produces:
        - "application/json"
      responses:
        200:
          description: "200 response"
          headers:
            Access-Control-Allow-Origin:
              type: "string"
            Access-Control-Allow-Methods:
              type: "string"
            Access-Control-Allow-Credentials:
              type: "string"
            Access-Control-Allow-Headers:
              type: "string"

  /login:
    post:
      consumes:
        - "application/json"
      parameters:
        - in: "body"
          name: "LoginRequest"
          required: true
          schema:
            $ref: "#/definitions/LoginRequest"
      responses: {}
    options:
      consumes:
        - "application/json"
      produces:
        - "application/json"
      responses:
        200:
          description: "200 response"
          headers:
            Access-Control-Allow-Origin:
              type: "string"
            Access-Control-Allow-Methods:
              type: "string"
            Access-Control-Allow-Credentials:
              type: "string"
            Access-Control-Allow-Headers:
              type: "string"

  /session:
    get:
      produces:
        - "application/json"
      responses:
        200:
          description: "200 response"
          schema:
            $ref: "#/definitions/Session"
      security:
        - 1_0Hd1KoM5a: []
    options:
      consumes:
        - "application/json"
      produces:
        - "application/json"
      responses:
        200:
          description: "200 response"
          headers:
            Access-Control-Allow-Origin:
              type: "string"
            Access-Control-Allow-Methods:
              type: "string"
            Access-Control-Allow-Credentials:
              type: "string"
            Access-Control-Allow-Headers:
              type: "string"

  /token:
    post:
      consumes:
        - "application/json"
      parameters:
        - in: "body"
          name: "TokenRequest"
          required: true
          schema:
            $ref: "#/definitions/TokenRequest"
      responses: {}
    options:
      consumes:
        - "application/json"
      produces:
        - "application/json"
      responses:
        200:
          description: "200 response"
          headers:
            Access-Control-Allow-Origin:
              type: "string"
            Access-Control-Allow-Methods:
              type: "string"
            Access-Control-Allow-Credentials:
              type: "string"
            Access-Control-Allow-Headers:
              type: "string"

securityDefinitions:
  1_0Hd1KoM5a:
    type: "apiKey"
    name: "Authorization"
    in: "header"
    x-amazon-apigateway-authtype: "cognito_user_pools"

definitions:
  CreateIdentityRequest:
    type: "object"
    required:
      - "email"
      - "id"
      - "password"
    properties:
      password:
        type: "string"
      id:
        type: "string"
      email:
        type: "string"
    title: "CreateIdentityRequest"

  TokenRequest:
    type: "object"
    required:
      - "id"
      - "refreshToken"
    properties:
      id:
        type: "string"
      refreshToken:
        type: "string"
    title: "TokenRequest"

  AddIdentityToGroupRequest:
    type: "object"
    required:
      - "group"
    properties:
      group:
        type: "string"
    title: "AddIdentityToGroupRequest"

  LoginRequest:
    type: "object"
    required:
      - "id"
      - "password"
    properties:
      password:
        type: "string"
      id:
        type: "string"
    title: "LoginRequest"

  Session:
    type: "object"
    properties:
      groups:
        type: "string"
        description: "Group membership of the current logged-in User."
      username:
        type: "string"
        description: "Current logged-in User."
    title: "Session"

Sample Payloads

Make sure header content-type is set to application/json

User sign-up

HTTP Post Request N.B. call the Composite Service sign up function to register your user id.

User login

{
  "id": "246810",
  "password": "Value12#"
}
HTTP GET

Validate session

Header

Authorization:<IdToken>

no body

3 Paper Microservice

The Paper Microservice allows users to create, update, query and delete papers/courses.

Endpoint URI's

POST

GET

PUT

PATCH

DELETE

Paper Microservice Swagger Definition

swagger: "2.0"

info:
  version: "2017-09-04T07:12:14Z"
  title: "dev-paper-microservice"

host: "m4pss0w907.execute-api.us-east-1.amazonaws.com"
basePath: "/dev"

schemes:
  - "https"

paths:
  /paper:
    get:
      produces:
        - "application/json"
      responses:
        200:
          description: "200 response"
          schema:
            $ref: "#/definitions/Papers"
      security:
        - 1_0Hd1KoM5a: []
    post:
      consumes:
        - "application/json"
      produces:
        - "application/json"
      parameters:
        - in: "body"
          name: "Paper"
          required: true
          schema:
            $ref: "#/definitions/Paper"
      responses:
        201:
          description: "201 response"
          schema:
            $ref: "#/definitions/Paper"
      security:
        - 1_0Hd1KoM5a: []
    options:
      consumes:
        - "application/json"
      produces:
        - "application/json"
      responses:
        200:
          description: "200 response"
          headers:
            Access-Control-Allow-Origin:
              type: "string"
            Access-Control-Allow-Methods:
              type: "string"
            Access-Control-Allow-Credentials:
              type: "string"
            Access-Control-Allow-Headers:
              type: "string"

  /paper/{id}:
    get:
      produces:
        - "application/json"
      responses:
        200:
          description: "200 response"
          schema:
            $ref: "#/definitions/Paper"
      security:
        - 1_0Hd1KoM5a: []
    put:
      consumes:
        - "application/json"
      produces:
        - "application/json"
      parameters:
        - in: "body"
          name: "Paper"
          required: true
          schema:
            $ref: "#/definitions/Paper"
      responses:
        201:
          description: "201 response"
          schema:
            $ref: "#/definitions/Paper"
      security:
        - 1_0Hd1KoM5a: []
    delete:
      produces:
        - "application/json"
      responses:
        200:
          description: "200 response"
          schema:
            $ref: "#/definitions/Paper"
      security:
        - 1_0Hd1KoM5a: []
    options:
      consumes:
        - "application/json"
      produces:
        - "application/json"
      responses:
        200:
          description: "200 response"
          headers:
            Access-Control-Allow-Origin:
              type: "string"
            Access-Control-Allow-Methods:
              type: "string"
            Access-Control-Allow-Credentials:
              type: "string"
            Access-Control-Allow-Headers:
              type: "string"
    patch:
      consumes:
        - "application/json"
      produces:
        - "application/json"
      parameters:
        - in: "body"
          name: "Paper"
          required: true
          schema:
            $ref: "#/definitions/Paper"
      responses:
        201:
          description: "201 response"
          schema:
            $ref: "#/definitions/Paper"
      security:
        - 1_0Hd1KoM5a: []

securityDefinitions:
  1_0Hd1KoM5a:
    type: "apiKey"
    name: "Authorization"
    in: "header"
    x-amazon-apigateway-authtype: "cognito_user_pools"

definitions:
  Papers:
    title: "Papers"
    type: "array"
    items:
      $ref: "#/definitions/Paper"

  Paper:
    type: "object"
    properties:
      lecturerId:
        type: "string"
        description: "A unique lecturer identifier."
      createdAt:
        type: "string"
        format: "date-time"
        description: "Record creation date (read only)."
      stream:
        type: "string"
        description: "Stream of the paper."
      year:
        type: "string"
        description: "Semester of the paper."
      name:
        type: "string"
        description: "Descriptive name of the paper."
      id:
        type: "string"
        description: "A unique paper identifier."
      room:
        type: "string"
        description: "Reference to the building and room location of the paper."
      status:
        type: "string"
        description: "Status of the paper - active|inactive."
      updatedAt:
        type: "string"
        format: "date-time"
        description: "Record update date (read only)."

Paper

title: "Paper" Sample Payloads

Make sure header content-type is set to application/json

HTTP POST

Register a new paper

N.B. call the Composite Service addPaper function to register your new Class course

Registration Microservice

The Registration Microservice allows a user to register to attend a paper

Endpoint URI's

POST

GET

DELETE

Swagger Definition

swagger: "2.0"

info:
  version: "2017-09-04T07:14:01Z"
  title: "dev-registration-microservice"

host: "tsom3l8zzg.execute-api.us-east-1.amazonaws.com"
basePath: "/dev"

schemes:
  - "https"

paths:
  /registration:
    get:
      produces:
        - "application/json"
      responses:
        200:
          description: "200 response"
          schema:
            $ref: "#/definitions/Registrations"
      security:
        - 1_0Hd1KoM5a: []
    post:
      consumes:
        - "application/json"
      produces:
        - "application/json"
      parameters:
        - in: "body"
          name: "Registration"
          required: true
          schema:
            $ref: "#/definitions/Registration"
      responses:
        201:
          description: "201 response"
          schema:
            $ref: "#/definitions/Registration"
      security:
        - 1_0Hd1KoM5a: []
    options:
      consumes:
        - "application/json"
      produces:
        - "application/json"
      responses:
        200:
          description: "200 response"
          headers:
            Access-Control-Allow-Origin:
              type: "string"
            Access-Control-Allow-Methods:
              type: "string"
            Access-Control-Allow-Credentials:
              type: "string"
            Access-Control-Allow-Headers:
              type: "string"

  /registration/{id}:
    get:
      produces:
        - "application/json"
      responses:
        200:
          description: "200 response"
          schema:
            $ref: "#/definitions/Registration"
      security:
        - 1_0Hd1KoM5a: []
    delete:
      produces:
        - "application/json"
      responses:
        200:
          description: "200 response"
          schema:
            $ref: "#/definitions/Registration"
      security:
        - 1_0Hd1KoM5a: []
    options:
      consumes:
        - "application/json"
      produces:
        - "application/json"
      responses:
        200:
          description: "200 response"
          headers:
            Access-Control-Allow-Origin:
              type: "string"
            Access-Control-Allow-Methods:
              type: "string"
            Access-Control-Allow-Credentials:
              type: "string"
            Access-Control-Allow-Headers:
              type: "string"

securityDefinitions:
  1_0Hd1KoM5a:
    type: "apiKey"
    name: "Authorization"
    in: "header"
    x-amazon-apigateway-authtype: "cognito_user_pools"

definitions:
  Registrations:
    title: "Registrations"
    type: "array"
    items:
      $ref: "#/definitions/Registration"

  Registration:
    type: "object"
    properties:
      studentId:
        type: "string"
        description: "A unique student identifier."
      createdAt:
        type: "string"
        format: "date-time"
        description: "Record creation date (read only)."
      paperId:
        type: "string"
        description: "A unique paper identifier."
      status:
        type: "string"
        description: "Status of the user - active|inactive."
      updatedAt:
        type: "string"
        format: "date-time"
        description: "Record update date (read only)."
    title: "Registration"

Sample Payloads

Make sure header content-type is set to application/json

Header Authorization:

Register course for a student

N.B. call the Composite Service addRegistration() function to register a student for a new course.

5 Room Microservice

The Room Microservice allows users to create and query classrooms.

Endpoint URI's

POST

GET

Swagger Definition

swagger: "2.0"

info:
  version: "2017-09-04T07:15:15Z"
  title: "dev-room-microservice"

host: "rcd471phrl.execute-api.us-east-1.amazonaws.com"
basePath: "/dev"

schemes:
  - "https"

paths:
  /room:
    get:
      produces:
        - "application/json"
      responses:
        200:
          description: "200 response"
          schema:
            $ref: "#/definitions/Rooms"
      security:
        - 1_0Hd1KoM5a: []
    post:
      consumes:
        - "application/json"
      produces:
        - "application/json"
      parameters:
        - in: "body"
          name: "Room"
          required: true
          schema:
            $ref: "#/definitions/Room"
      responses:
        201:
          description: "201 response"
          schema:
            $ref: "#/definitions/Room"
      security:
        - 1_0Hd1KoM5a: []
    options:
      consumes:
        - "application/json"
      produces:
        - "application/json"
      responses:
        200:
          description: "200 response"
          headers:
            Access-Control-Allow-Origin:
              type: "string"
            Access-Control-Allow-Methods:
              type: "string"
            Access-Control-Allow-Credentials:
              type: "string"
            Access-Control-Allow-Headers:
              type: "string"

  /room/{id}:
    get:
      produces:
        - "application/json"
      responses:
        200:
          description: "200 response"
          schema:
            $ref: "#/definitions/Room"
      security:
        - 1_0Hd1KoM5a: []
    options:
      consumes:
        - "application/json"
      produces:
        - "application/json"
      responses:
        200:
          description: "200 response"
          headers:
            Access-Control-Allow-Origin:
              type: "string"
            Access-Control-Allow-Methods:
              type: "string"
            Access-Control-Allow-Credentials:
              type: "string"
            Access-Control-Allow-Headers:
              type: "string"

securityDefinitions:
  1_0Hd1KoM5a:
    type: "apiKey"
    name: "Authorization"
    in: "header"
    x-amazon-apigateway-authtype: "cognito_user_pools"

definitions:
  Room:
    type: "object"
    properties:
      createdAt:
        type: "string"
        format: "date-time"
        description: "Record creation date (read only)."
      description:
        type: "string"
        description: "A unique descriptor for the room."
      id:
        type: "string"
        description: "A unique room identifier."
    title: "Room"

  Rooms:
    title: "Rooms"
    type: "array"
    items:
      $ref: "#/definitions/Room"

Sample Payloads

Make sure header content-type is set to application/json

HTTP POST

Header Authorization:<IdToken>

Create a new room record

{
  "id": "WT201",
  "description": "A class room in the WT building"
}

User Microservice

The User Microservice allows us to create/update/get/list a User from the Attendance application

Endpoint URI's

POST

GET

PUT

PATCH

DELETE

Swagger Definition

swagger: "2.0"

info:
  version: "2017-09-04T07:16:51Z"
  title: "dev-user-microservice"

host: "fahze41owc.execute-api.us-east-1.amazonaws.com"
basePath: "/dev"
schemes:
  - "https"

paths:
  /user:
    get:
      produces:
        - "application/json"
      responses:
        200:
          description: "200 response"
          schema:
            $ref: "#/definitions/Users"
      security:
        - 1_0Hd1KoM5a: []
    post:
      consumes:
        - "application/json"
      produces:
        - "application/json"
      parameters:
        - in: "body"
          name: "User"
          required: true
          schema:
            $ref: "#/definitions/User"
      responses:
        201:
          description: "201 response"
          schema:
            $ref: "#/definitions/User"
      security:
        - 1_0Hd1KoM5a: []
    options:
      consumes:
        - "application/json"
      produces:
        - "application/json"
      responses:
        200:
          description: "200 response"
          headers:
            Access-Control-Allow-Origin:
              type: "string"
            Access-Control-Allow-Methods:
              type: "string"
            Access-Control-Allow-Credentials:
              type: "string"
            Access-Control-Allow-Headers:
              type: "string"
  /user/{id}:
    get:
      produces:
        - "application/json"
      responses:
        200:
          description: "200 response"
          schema:
            $ref: "#/definitions/User"
    put:
      consumes:
        - "application/json"
      produces:
        - "application/json"
      parameters:
        - in: "body"
          name: "User"
          required: true
          schema:
            $ref: "#/definitions/User"
      responses:
        201:
          description: "201 response"
          schema:
            $ref: "#/definitions/User"
      security:
        - 1_0Hd1KoM5a: []
    delete:
      produces:
        - "application/json"
      responses:
        200:
          description: "200 response"
          schema:
            $ref: "#/definitions/User"
      security:
        - 1_0Hd1KoM5a: []
    options:
      consumes:
        - "application/json"
      produces:
        - "application/json"
      responses:
        200:
          description: "200 response"
          headers:
            Access-Control-Allow-Origin:
              type: "string"
            Access-Control-Allow-Methods:
              type: "string"
            Access-Control-Allow-Credentials:
              type: "string"
            Access-Control-Allow-Headers:
              type: "string"
    patch:
      consumes:
        - "application/json"
      produces:
        - "application/json"
      parameters:
        - in: "body"
          name: "User"
          required: true
          schema:
            $ref: "#/definitions/User"
      responses:
        200:
          description: "200 response"
          schema:
            $ref: "#/definitions/User"
      security:
        - 1_0Hd1KoM5a: []

securityDefinitions:
  1_0Hd1KoM5a:
    type: "apiKey"
    name: "Authorization"
    in: "header"
    x-amazon-apigateway-authtype: "cognito_user_pools"

definitions:
  User:
    type: "object"
    properties:
      firstName:
        type: "string"
      lastName:
        type: "string"
      createdAt:
        type: "string"
        format: "date-time"
        description: "Record creation date (read only)."
      id:
        type: "string"
        description: "A unique user identifier."
      type:
        type: "string"
        description: "Type of user - student | lecturer | administrator"
      status:
        type: "string"
        description: "Status of the user - active|inactive."
      updatedAt:
        type: "string"
        format: "date-time"
        description: "Record update date (read only)."
    title: "User"

  Users:
    title: "Users"
    type: "array"
    items:
      $ref: "#/definitions/User"

Sample JSON Payloads

Make sure header content-type is set to application/json

List users ( no user id passed in URI)

[
  {
    "id": "102030",
    "firstName": "Julito",
    "lastName": "Schwartzenegger",
    "type": "administrator",
    "status": "active",
    "createdAt": "2017-08-31T00:10:38.357Z",
    "updatedAt": "2017-08-31T00:10:38.357Z"
  },
  {
    "id": "103460",
    "firstName": "Barrack",
    "lastName": "Obama",
    "type": "student",
    "status": "inactive",
    "createdAt": "2017-08-31T00:10:38.357Z",
    "updatedAt": "2017-08-31T00:10:38.357Z"
  }
  // Add more user objects if needed
]

Retrieve user. user id passed in URI

{
  "id": "102030",
  "firstName": "Julito",
  "lastName": "Schwartzenegger",
  "type": "administrator",
  "status": "active",
  "createdAt": "2017-08-31T00:10:38.357Z",
  "updatedAt": "2017-08-31T00:10:38.357Z"
}

HTTP POST Header Authorization:<IdToken> Request body with "id"

{
  "id": "10295765",
  "firstName": "Arnold",
  "lastName": "Schwarzenegger",
  "type": "administrator"
}

Request body no "id" (will be autogenerated)

{
  "firstName": "Arnold",
  "lastName": "Schwarzenegger",
  "type": "administrator"
}

Request body fail Scenario

{
  "firstName": "Arnold",
  "lastName": "Schwarzenegger",
  "type": "trapeze artist"
}

HTTP PUT Header Authorization:<IdToken>

Request body activate user (user id passed in URI)

{
  "firstName": "Jack",
  "lastName": "Black",
  "type": "lecturer",
  "status": "active"
}

Request body deactivate user (user id passed in URI)

{
  "firstName": "Jack",
  "lastName": "Black",
  "type": "lecturer",
  "status": "inactive"
}

Request body fail scenario (user id passed in URI)

{
  "firstName": "Jack",
  "lastName": "Black",
  "type": "lecturer",
  "status": "off"
}