Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ---
- openapi: 3.0.0
- info:
- title: Mobis API Specification
- version: 1.0.0
- servers:
- - url: "http://mobis.dbkl.gov.my/MobileWebApiDev/api/v1"
- - url: "{scheme}://{hostname}:{port}{basePath}"
- variables:
- hostname:
- default: localhost
- scheme:
- enum:
- - http
- - https
- default: http
- port:
- enum:
- - "443"
- - "80"
- - "1234"
- default: "1234"
- basePath:
- default: /api/v1
- paths:
- "/users/me":
- get:
- security:
- - bearerAuth: []
- tags:
- - users
- summary: Get current user detail
- responses:
- '200':
- description: Current user detail
- content:
- application/json:
- schema:
- "$ref": "#/components/schemas/User"
- "401":
- description: Unauthorized
- content:
- application/json:
- "$ref": "#/components/schemas/ErrorMessage"
- put:
- security:
- - bearerAuth: []
- summary: Update current user detail (Full)
- tags:
- - users
- requestBody:
- required: true
- content:
- application/json:
- schema:
- "$ref": "#/components/schemas/UserUpdate"
- responses:
- '200':
- description: Updated user detail
- content:
- application/json:
- schema:
- "$ref": "#/components/schemas/User"
- '400':
- description: Failed to update user
- content:
- application/json:
- "$ref": "#/components/schemas/ErrorMessage"
- "401":
- description: Unauthorized
- content:
- application/json:
- "$ref": "#/components/schemas/ErrorMessage"
- patch:
- security:
- - bearerAuth: []
- summary: Patch current partial user detail (Partial)
- tags:
- - users
- requestBody:
- required: true
- content:
- application/json:
- schema:
- "$ref": "#/components/schemas/UserPatch"
- responses:
- '200':
- description: Updated user detail
- content:
- application/json:
- schema:
- "$ref": "#/components/schemas/User"
- '400':
- description: Failed to update user
- content:
- application/json:
- "$ref": "#/components/schemas/ErrorMessage"
- "401":
- description: Unauthorized
- content:
- application/json:
- "$ref": "#/components/schemas/ErrorMessage"
- "/users":
- post:
- summary: Create a user
- tags:
- - users
- requestBody:
- required: true
- content:
- application/json:
- schema:
- "$ref": "#/components/schemas/UserCreate"
- responses:
- '201':
- description: Successfully registered user
- content:
- application/json:
- schema:
- "$ref": "#/components/schemas/User"
- "/sessions":
- post:
- summary: Create a new session or exchange a refresh token for a new session
- tags:
- - users
- requestBody:
- required: true
- content:
- application/json:
- schema:
- oneOf:
- - "$ref": "#/components/schemas/SessionCreate"
- - "$ref": "#/components/schemas/SessionExchange"
- responses:
- '201':
- description: Session successfully created
- content:
- application/json:
- schema:
- "$ref": "#/components/schemas/Session"
- '400':
- description: Failed to create session
- content:
- application/json:
- "$ref": "#/components/schemas/ErrorMessage"
- "/recoveries":
- post:
- summary: Recover a user
- tags:
- - users
- requestBody:
- required: true
- content:
- application/json:
- schema:
- "$ref": "#/components/schemas/RecoveryCreate"
- responses:
- '201':
- description: Recovery initiated
- content:
- application/json:
- schema:
- type: object
- properties:
- message:
- type: string
- description: A message to tell user of what to do next
- '400':
- description: Failed to recover user
- content:
- application/json:
- "$ref": "#/components/schemas/ErrorMessage"
- "/recoveries/{code}":
- patch:
- summary: Use recovery code to recover user
- tags:
- - users
- parameters:
- - in: path
- name: code
- required: true
- schema:
- type: string
- description: The recovery code
- requestBody:
- required: true
- content:
- application/json:
- schema:
- "$ref": "#/components/schemas/RecoveryUsage"
- responses:
- '200':
- description: User detail
- content:
- application/json:
- schema:
- "$ref": "#/components/schemas/User"
- "400":
- description: Invalid
- content:
- application/json:
- "$ref": "#/components/schemas/ErrorMessage"
- "/announcements":
- get:
- security:
- - bearerAuth: []
- summary: List announcements
- tags:
- - announcements
- responses:
- '204':
- description: Empty list of announcements
- '200':
- description: A list of announcements
- content:
- application/json:
- schema:
- type: array
- items:
- "$ref": "#/components/schemas/Announcement"
- "401":
- description: Unauthorized
- content:
- application/json:
- "$ref": "#/components/schemas/ErrorMessage"
- "/compounds":
- get:
- summary: List compounds
- security:
- - bearerAuth: []
- tags:
- - compounds
- parameters:
- - in: query
- name: ic_number
- schema:
- type: string
- description: Nombor IC / IC number
- required: true
- - in: query
- name: vehicle_number
- schema:
- type: string
- description: Nombor kenderaan / Vehicle number
- required: true
- responses:
- '200':
- description: A list of compounds
- content:
- application/json:
- schema:
- type: array
- items:
- "$ref": "#/components/schemas/Compound"
- '400':
- description: Validation error
- content:
- application/json:
- schema:
- "$ref": "#/components/schemas/ErrorMessage"
- "401":
- description: Unauthorized
- content:
- application/json:
- schema:
- "$ref": "#/components/schemas/ErrorMessage"
- "/compounds/{number}":
- get:
- summary: Show compound
- security:
- - bearerAuth: []
- tags:
- - compounds
- parameters:
- - in: path
- name: number
- required: true
- schema:
- type: string
- description: The compound number
- responses:
- '200':
- description: A list of compounds
- content:
- application/json:
- "$ref": "#/components/schemas/CompoundDetail"
- '400':
- description: Validation error
- content:
- application/json:
- "$ref": "#/components/schemas/ErrorMessage"
- "401":
- description: Unauthorized
- content:
- application/json:
- "$ref": "#/components/schemas/ErrorMessage"
- "/compound_payments":
- post:
- security:
- - bearerAuth: []
- tags:
- - compounds
- summary: Create a payment for compounds
- requestBody:
- required: true
- content:
- application/json:
- schema:
- "$ref": "#/components/schemas/CompoundPaymentCreate"
- responses:
- "201":
- description: Successfully created payment resource to be charged
- content:
- application/json:
- schema:
- "$ref": "#/components/schemas/CompoundPayment"
- "401":
- description: Unauthorized
- content:
- application/json:
- "$ref": "#/components/schemas/ErrorMessage"
- "/receipts":
- get:
- security:
- - bearerAuth: []
- tags:
- - receipts
- summary: List receipts
- responses:
- "200":
- description: A list of receipts
- content:
- application/json:
- schema:
- type: array
- items:
- "$ref": "#/components/schemas/Receipt"
- "401":
- description: Unauthorized
- content:
- application/json:
- schema:
- "$ref": "#/components/schemas/ErrorMessage"
- "/receipts/{id}":
- get:
- parameters:
- - in: path
- name: id
- required: true
- schema:
- type: string
- description: The receipt ID
- tags:
- - receipts
- security:
- - bearerAuth: []
- summary: Get receipt
- responses:
- "200":
- description: Show receipt
- content:
- application/json:
- schema:
- "$ref": "#/components/schemas/Receipt"
- "404":
- description: Not found
- content:
- application/json:
- "$ref": "#/components/schemas/ErrorMessage"
- "401":
- description: Unauthorized
- content:
- application/json:
- "$ref": "#/components/schemas/ErrorMessage"
- "/receipts/{id}/resend":
- post:
- parameters:
- - in: path
- name: id
- required: true
- schema:
- type: string
- description: The receipt ID
- tags:
- - receipts
- security:
- - bearerAuth: []
- summary: Resend receipt to email
- responses:
- "201":
- description: Receipt resent
- content:
- application/json:
- schema:
- type: object
- properties:
- message:
- type: string
- description: A message to tell user of what to do next
- "/assessments/{id}":
- get:
- parameters:
- - in: path
- name: id
- required: true
- schema:
- type: string
- description: The assessment ID
- tags:
- - assessments
- security:
- - bearerAuth: []
- summary: Show assessment detail
- responses:
- "200":
- description: Receipt resent
- content:
- application/json:
- schema:
- type: object
- properties:
- message:
- type: string
- description: A message to tell user of what to do next
- "/license":
- get:
- parameters:
- - in: path
- name: license_file_num
- required: true
- schema:
- type: string
- description: The License File number
- - in: path
- name: id_type
- required: true
- schema:
- type: string
- description: ID Type Associated with the License
- - in: path
- name: id_number
- required: true
- schema:
- type: string
- description: ID Number associated with the License
- tags:
- - License
- security:
- - bearerAuth: []
- summary: Get license detail
- components:
- schemas:
- User:
- title: User
- type: object
- properties:
- id:
- type: string
- description: User ID
- full_name:
- type: string
- description: Nama penuh / Full name
- ic_type:
- type: string
- description: Jenis Kad Pengenalan / Type of IC
- ic_number:
- type: string
- description: Nombor Kad Pengenalan / IC number
- email:
- type: string
- description: Emel / Email
- phone_number:
- type: string
- description: Phone number / Nombor telefon
- UserCreate:
- title: UserCreate
- type: object
- properties:
- full_name:
- type: string
- description: Nama penuh / Full name
- ic_type:
- type: string
- description: Jenis Kad Pengenalan / Type of IC
- ic_number:
- type: string
- description: Nombor Kad Pengenalan / IC number
- email:
- type: string
- description: Emel / Email
- password:
- type: string
- description: Alphanumeric password with minimum length of 8
- phone_number:
- type: string
- description: Phone number / Nombor telefon
- required:
- - full_name
- - ic_type
- - ic_number
- - email
- - phone_number
- - password
- UserUpdate:
- title: UserUpdate
- type: object
- properties:
- full_name:
- type: string
- description: Nama penuh / Full name
- ic_type:
- type: string
- description: Jenis Kad Pengenalan / Type of IC
- ic_number:
- type: string
- description: Nombor Kad Pengenalan / IC number
- email:
- type: string
- description: Emel / Email
- password:
- type: string
- description: Alphanumeric password with minimum length of 8
- phone_number:
- type: string
- description: Phone number / Nombor telefon
- required:
- - full_name
- - ic_type
- - ic_number
- - email
- - phone_number
- - password
- UserPatch:
- title: UserPatch
- type: object
- properties:
- full_name:
- type: string
- description: Nama penuh / Full name
- ic_type:
- type: string
- description: Jenis Kad Pengenalan / Type of IC
- ic_number:
- type: string
- description: Nombor Kad Pengenalan / IC number
- email:
- type: string
- description: Emel / Email
- phone_number:
- type: string
- description: Phone number / Nombor telefon
- password:
- type: string
- description: Alphanumeric password with minimum length of 8
- RecoveryCreate:
- title: RecoveryCreate
- type: object
- properties:
- ic_number:
- type: string
- description: IC number to recover account
- required:
- - ic_number
- Session:
- title: Session
- type: object
- properties:
- access_token:
- type: string
- description: Bearer token, used to authenticate requests. Token expires
- when time is past the expiry_date. Can be refreshed using refresh_token
- refresh_token:
- type: string
- description: Refresh token, used to refresh the current session before expiry.
- Can only be used once and expires when time is past the expiry date
- expires_at:
- type: string
- format: date-time
- description: Token expiry datetime in ISO 8601 format in GMT+8
- RecoveryUsage:
- title: RecoveryUsage
- type: object
- properties:
- ic_number:
- type: string
- description: Nombor Kad Pengenalan / IC number
- password:
- type: string
- description: Alphanumeric password with minimum length of 8
- required:
- - ic_number
- - password
- SessionCreate:
- title: SessionCreate
- type: object
- properties:
- grant_type:
- type: string
- value: [password, refresh_token]
- ic_number:
- type: string
- description: Nombor IC / IC number
- password:
- type: string
- description: User password
- required:
- - grant_type
- - ic_number
- - password
- SessionExchange:
- title: SessionExchange
- type: object
- properties:
- grant_type:
- type: string
- value: [password, refresh_token]
- refresh_token:
- type: string
- description: The refresh token needed to create a new session
- required:
- - grant_type
- - refresh_token
- Announcement:
- title: Announcement
- type: object
- properties:
- id:
- type: string
- description: "ID Pengumuman / Announcement ID"
- title:
- type: string
- description: "Tajuk / Title"
- description:
- type: string
- description: "Huraian / Description"
- image_url:
- type: string
- description: "Gambar / Image"
- ErrorMessage:
- title: ErrorMessage
- type: object
- properties:
- message:
- type: string
- description: User friendly message
- Compound:
- title: Compound
- type: object
- properties:
- id:
- type: string
- description: ID kompaun / Compound ID
- number:
- type: string
- description: Nombor kompaun / Compound Number
- issued_at:
- type: string
- format: date-time
- description: ISO 8601 formatted date of compound issuance
- address:
- type: string
- description: Alamat / Address
- amount:
- type: integer
- description: "Harga Kompaun / Compound Amount. MUST BE IN CENTS"
- CompoundDetail:
- title: CompoundDetail
- type: object
- properties:
- id:
- type: string
- description: ID kompaun / Compound ID
- number:
- type: string
- description: Nombor kompaun / Compound Number
- name:
- type: string
- description: Offender name
- ic_number:
- type: string
- vehicle_number:
- type: string
- offence_act:
- type: string
- offence_section:
- type: string
- offence_description:
- type: string
- notice_status:
- type: string
- blacklist_status:
- type: boolean
- address:
- type: string
- issued_at:
- type: string
- format: date-time
- description: ISO 8601 formatted date of compound issuance
- amount:
- type: integer
- description: "Harga Kompaun / Compound Amount. MUST BE IN CENTS"
- CompoundPaymentCreate:
- title: CompoundPaymentCreate
- type: object
- properties:
- compound_ids:
- type: array
- description: Compound IDs to be paid
- items:
- type: integer
- CompoundPayment:
- title: CompoundPayment
- type: object
- properties:
- id:
- type: string
- description: Payment ID
- redirect_url:
- type: string
- description: A URL to redirect the user to. Typically the payment gateway. Presents only when payment status is pending.
- amount:
- type: integer
- description: Total chargable amount. Must be in cents
- compound_ids:
- type: array
- description: Compound IDs that are payable
- items:
- type: integer
- status:
- type: string
- description: Payment status
- enum:
- - success
- - fail
- - void
- - pending
- receipt_id:
- type: string
- description: Presents only when payment status is success. Null otherwise
- Receipt:
- title: Receipt
- type: object
- properties:
- id:
- type: string
- description: Receipt ID
- paid_at:
- type: string
- items:
- type: array
- items:
- type: object
- properties:
- title:
- type: string
- description: Item title
- amount:
- type: string
- description: Item amount. MUST BE IN CENTS
- subtotal_amount:
- type: integer
- description: Subtotal amount
- total_amount:
- type: integer
- description: Total amount
- securitySchemes:
- bearerAuth:
- type: http
- scheme: bearer
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement