Skip to main content

Api Contract Kampus Komerce (1.0.0)

Download OpenAPI specification:Download

This is an Api Contract for Kampus Komerce project. use Token to consumes endpoint.

Authentication

Bearer

Security Scheme Type API Key
Header parameter name: Authorization

Auth

Everything about Auth

Logs user into the system

Request Body schema: application/json
username
required
string
password
required
string <password>

Responses

Request samples

Content type
application/json
{
  • "username": "string",
  • "password": "pa$$word"
}

Response samples

Content type
application/json
{
  • "status": "success",
  • "code": "200",
  • "data": {
    }
}

Log out from application

Authorizations:

Responses

Response samples

Content type
application/json
{
  • "status": "success",
  • "code": "200",
  • "message": "logout successful"
}

Send link to forgot password

Responses

Response samples

Content type
application/json
{
  • "status": "success",
  • "code": "200",
  • "message": "Forgot passwword link has been sent to your email"
}

Update Password

query Parameters
email
required
string

get email from deep link

password
required
string

New password, 8 character minimum

Responses

Response samples

Content type
application/json
{
  • "status": "success",
  • "code": "200",
  • "message": "Password changed successfully"
}

Change password for authenticate user

Authorizations:
query Parameters
old_password
required
string

old password

new_password
required
string

New password, 8 character minimum

Responses

Response samples

Content type
application/json
{
  • "status": "success",
  • "code": "200",
  • "message": "Password changed successfully"
}

refresh-token

Authorizations:

Responses

Response samples

Content type
application/json
{
  • "status": "success",
  • "code": "200",
  • "message": "Refresh Token successful",
  • "access_token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJhdWQiOiIxIiwianRpIjoiMGQyMzE4NTg0YWNmYTU4MGQxYjM1ZWM1NzczNTFlYThjYzY2ZTA4MjNhODdkMWZiODJlYjVlYWQxYTUxNzA1M2RhMjVmYTk0MGI2NzExMDEiLCJpYXQiOjE2MjczNjc3MjMsIm5iZiI6MTYyNzM2NzcyMywiZXhwIjoxNjU4OTAzNzIzLCJzdWIiOiIyIiwic2NvcGVzIjpbXX0.Swq2EdjNWL7JrRZFu1Gh9x5ZHwo7jmCioZz4Z19IQB2rTIGUDyhkds276ZzPHh-pDwkrD2uEWhceOuXrKnlOwtvJOu3Kf3VymsabIKqJpb8e4dq76FWPbUD6k-WexL7QKQan9gH1LwoQey2nMKFi5hd7_3A9sFLRrQerqh3qugWdD7RqqYS3vYY9M3VqHf108w5iQa_GHkRx2KRv0PxRVRqofkTCBBf-Oc-kcvLkau8N6BVojkYDJ8Cl8uG5XcS0F1RjbNy6SuiuTyqq1BqaZmcasi87zwJEeuJSgdqBfnNch608impEBu9q_ON1kMIgK9LZvqL8_Uk1vP5qosUq39VgJj8qbFDpCKsKus6fjO78G-zeYbZ32D-s03QwPr9FkwoZXg_HaiyTDvsbTcgH63wU-Q7ycor8IgSKPsfkJN1OytohleJMWYOObiN-IKqKGbXnf85DnJrhZuOZB9tQdoq4fIXYx68LQgmiLSVemXUbHMtRmXbYWwAIFy3QexPRGtHxK8wCzqEH-whXh66RKBy31gf1Fu9wxHHEb95U_UfYYynbbDxapwurJHzgxUswdBWDNguNoAJZslZfwVMguAmgtylFvNYzIlEWkENTk5fcTNOJsmVWDYuO-QJyWwCStB7_a7jcPFHLqcs7pwu9cvV-X1__x0BgRD6E9VBfYQg"
}

Register new user

query Parameters
email
required
string

email active

password
required
string <password>

Password, 8 character minimum

Responses

Response samples

Content type
application/json
{
  • "status": "success",
  • "code": "200",
  • "message": "Register success."
}

Class

Admin to manage class

Returns class data

action add, edit, delete

Authorizations:

Responses

Response samples

Content type
application/json
{}

Get class by class_id

Authorizations:
path Parameters
class_id
required
string

class_id from class list. This responses can be applied at edit page and detail page

Responses

Response samples

Content type
application/json
{}

Store new Class

Authorizations:
query Parameters
class_skill
required
string
Enum: "Advertiser" "Customer Service" "Admin Marketplace"

Post the id from class_skill

class_trailer_url
required
string

video url

class_trailer_description
required
string

short explanation of the class

class_status
required
string
Enum: "draft" "publish"

publish status

Request Body schema: application/octet-stream
string <binary>

Responses

Response samples

Content type
application/json
{
  • "status": "success",
  • "code": "200",
  • "message": "Class has been stored successfully."
}

Update current Class

Authorizations:
query Parameters
class_skill
required
string
Enum: "Advertiser" "Customer Service" "Admin Marketplace"

Post the id from class_skill

class_trailer_url
required
string

video url

class_trailer_description
required
string

short explanation of the class

class_status
required
string
Enum: "draft" "publish"

publish status

Request Body schema: application/octet-stream
string <binary>

Responses

Response samples

Content type
application/json
{}

Delete Class

Rules: cannot delete class if class has module, if class already publish, if class already has user joined

Authorizations:
query Parameters
class_id
required
integer

id of the class

Responses

Response samples

Content type
application/json
{
  • "status": "success",
  • "code": "200",
  • "message": "Class has been deleted successfully."
}

Module

Admin to manage module

Returns module data

action add, edit, delete

Authorizations:
query Parameters
class_id
required
integer

Responses

Response samples

Content type
application/json
{
  • "status": "success",
  • "code": "200",
  • "data": {
    }
}

Returns module data

action add, edit, delete

Authorizations:
path Parameters
class_id
required
integer
search
required
string

Responses

Response samples

Content type
application/json
{
  • "status": "success",
  • "code": "200",
  • "data": {
    }
}

Get module by module_id

Authorizations:
path Parameters
module_id
required
string

module_id from module list. This responses can be applied at edit page and detail page

Responses

Response samples

Content type
application/json
{
  • "status": "success",
  • "code": "200",
  • "data": {}
}

Store new Module

Authorizations:
query Parameters
module_title
required
string

Unique values. Duplicate module_title not allowed

module_subtitle
required
string
module_trainer
required
integer

select option

module_status
required
string
Enum: "draft" "publish"

publish status

module_class_id
required
integer
Request Body schema: application/octet-stream
string <binary>

Responses

Response samples

Content type
application/json
{
  • "status": "success",
  • "code": "200",
  • "message": "Module has been stored successfully."
}

Update current Module

Authorizations:
query Parameters
module_title
required
string

Unique values. Duplicate module_title not allowed

module_subtitle
required
string
module_trainer
required
integer

select option

module_status
required
string
Enum: "draft" "publish"

publish status

Request Body schema: application/octet-stream
string <binary>

Responses

Response samples

Content type
application/json
{
  • "status": "success",
  • "code": "200",
  • "data": {}
}

Delete Module

Rules: cannot delete module if module has lessons, if module already publish

Authorizations:
query Parameters
module_id
required
integer

id of the module

Responses

Response samples

Content type
application/json
{
  • "status": "success",
  • "code": "200",
  • "message": "Module has been deleted successfully."
}

Lesson

Admin to manage Lesson

Returns lesson data

action add, edit, delete

Authorizations:
query Parameters
module_id
required
integer

Responses

Response samples

Content type
application/json
{}

Returns lesson data

action add, edit, delete

Authorizations:
path Parameters
module_id
required
integer
filter_title
required
integer

Responses

Response samples

Content type
application/json
{}

Get lesson by lesson_id

Authorizations:
path Parameters
lesson_id
required
string

lesson_id from lesson list. This responses can be applied at edit page and detail page

Responses

Response samples

Content type
application/json
{}

Store new Lesson

Authorizations:
query Parameters
lesson_title
required
string

Unique values. Duplicate lesson_title not allowed

lesson_video_description
required
string
lesson_video_url
required
string
lesson_status
required
string
Enum: "draft" "publish"

publish status

lesson_class_id
required
integer
Request Body schema: application/octet-stream
string <binary>

Responses

Response samples

Content type
application/json
{
  • "status": "success",
  • "code": "200",
  • "message": "Lesson has been stored successfully."
}

Update current Lesson

Authorizations:
query Parameters
lesson_title
required
string

Unique values. Duplicate lesson_title not allowed

lesson_video_description
required
string
lesson_video_url
required
string
lesson_status
required
string
Enum: "draft" "publish"

publish status

lesson_class_id
required
integer
Request Body schema: application/octet-stream
string <binary>

Responses

Response samples

Content type
application/json
{}

Delete Lesson

Rules: cannot delete lesson if lesson has lessons, if lesson already publish

Authorizations:
query Parameters
lesson_id
required
integer

id of the lesson

Responses

Response samples

Content type
application/json
{
  • "status": "success",
  • "code": "200",
  • "message": "Lesson has been deleted successfully."
}

Quiz

Admin to manage Quiz

Returns quiz data

action add, edit, delete

Authorizations:

Responses

Response samples

Content type
application/json
{
  • "status": "success",
  • "code": "200",
  • "data": {
    }
}

Returns quiz data

Authorizations:
Request Body schema: application/json
quiz_id
uuid
question_id
uuid
question
string
type
string
answers_type
string
position
integer
Array of objects (answers) [ items ]

Responses

Request samples

Content type
application/json
{
  • "quiz_id": "55a0ba74-f1ca-4944-9d0c-bb2397139d7k",
  • "question_id": "55a0ba74-f1ca-4944-9d0c-bb2397139d7k",
  • "question": "1 + 1 =",
  • "type": "text",
  • "answers_type": "choices",
  • "position": "0",
  • "answers": [
    ]
}

Response samples

Content type
application/json
{
  • "status": "success",
  • "code": "200",
  • "message": "quiz has been stored successfully."
}

quiz-update

Authorizations:
Request Body schema: application/json
quiz_id
uuid
question_id
uuid
question
string
type
string
answers_type
string
position
integer
Array of objects (answers) [ items ]

Responses

Request samples

Content type
application/json
{
  • "quiz_id": "55a0ba74-f1ca-4944-9d0c-bb2397139d7k",
  • "question_id": "55a0ba74-f1ca-4944-9d0c-bb2397139d7k",
  • "question": "1 + 1 =",
  • "type": "text",
  • "answers_type": "choices",
  • "position": "0",
  • "answers": [
    ]
}

Response samples

Content type
application/json
{
  • "status": "success",
  • "code": "200",
  • "data": {
    }
}

Delete question

Rules: cannot delete question if quiz has user joined

Authorizations:
query Parameters
question_id
required
uuid

id of the question

Responses

Response samples

Content type
application/json
{
  • "status": "success",
  • "code": "200",
  • "message": "question has been deleted successfully."
}

Trainer

Admin to manage Trainer

Returns trainer data

action add, edit, delete

Authorizations:

Responses

Response samples

Content type
application/json
{}

Returns trainer data

action add, edit, delete

Authorizations:

Responses

Response samples

Content type
application/json
{}

Returns trainer data

Authorizations:
query Parameters
name
required
string

name

skill_id
required
string
Enum: "Advertiser" "Customer Service" "Admin Marketplace"

Post the id from skill_id

phone
required
string

phone

email
required
string

email

bank_name
required
string

bank_name

bank_account_number
required
string

bank_account_number

bank_account_name
required
string

bank_account_name

npwp
required
string

npwp

province_id
required
integer
regency_id
required
integer
distric_id
required
integer
address
required
string

detail address

Request Body schema: application/octet-stream
string <binary>

Responses

Response samples

Content type
application/json
{
  • "status": "success",
  • "code": "200",
  • "message": "Trainer has been stored successfully."
}

trainer-update

Authorizations:
Request Body schema: application/json
id
integer
name
string
skill_id
integer
Enum: "Advertiser" "Customer Service" "Admin Marketplace"
phone
string
email
string
photo_profile
string
bank_name
string
bank_account_number
char
bank_account_name
string
npwp
char
cv
string
province_id
char
regency_id
char
distric_id
char
address
string

Responses

Request samples

Content type
application/json
{}

Response samples

Content type
application/json
{
  • "status": "success",
  • "code": "200",
  • "message": "trainer has been updated successfully."
}

Delete trainer

Rules: cannot delete trainer if trainer has lessons

Authorizations:
query Parameters
trainer_id
required
uuid

id of the trainer

Responses

Response samples

Content type
application/json
{
  • "status": "success",
  • "code": "200",
  • "message": "trainer has been deleted successfully."
}

Dashboard

Admin Dashboard

Returns dasboard data

Data for admin dashboard, cart object filtered by default with start_date = {current_year}/01/01 and end_date = {current_year}/12/31

Authorizations:

Responses

Response samples

Content type
application/json
{
  • "status": "success",
  • "code": "200",
  • "data": {
    }
}

Returns dasboard data

only return data for displaying cart

Authorizations:
query Parameters
start_date
string <YY/MM/DD>
Example: start_date=2021/01/01
end_date
string <YY/MM/DD>
Example: end_date=2021/12/31

Responses

Response samples

Content type
application/json
{
  • "status": "success",
  • "code": "200",
  • "data": {
    }
}

Report

Admin Report

Returns my class data

Authorizations:

Responses

Response samples

Content type
application/json
{
  • "status": "success",
  • "code": "200",
  • "data": {
    }
}

Public-object

Returns province, district, regency data

get data

Authorizations:

Responses

Response samples

Content type
application/json
{
  • "status": "success",
  • "code": "200",
  • "data": [
    ]
}

Returns Skill data

Get Skill data

Authorizations:

Responses

Response samples

Content type
application/json
{
  • "status": "success",
  • "code": "200",
  • "data": [
    ]
}

Profile

Manage Profile

Returns profile data

action add, edit, delete

Authorizations:

Responses

Response samples

Content type
application/json
{
  • "status": "success",
  • "code": "200",
  • "data": [
    ]
}

Get user by user_id

Authorizations:
path Parameters
user_id
required
string

user_id from list. This responses can be applied at edit page and detail page

Responses

Response samples

Content type
application/json
{
  • "status": "success",
  • "code": "200",
  • "data": {}
}

Check profile complete

Authorizations:

Responses

Response samples

Content type
application/json
{
  • "status": "success",
  • "code": "200",
  • "data": {
    }
}

Store new Profile Deprecated

Authorizations:
query Parameters
user_name
required
string

user_name

user_birth_date
required
date <dd-mm-yyyy>

user_birth_date

user_gender
required
enum
Enum: "1 | Laki-laki" "2 | Perempuan"

user_gender

user_marital_status
required
enum
Enum: "0 | Belum Menikah" "1 | Menikah" "else | -"

user_marital_status

user_email
required
string

user_email

user_phone
required
string

user_phone

user_province_id
required
integer

user_province_id

user_regency_id
required
integer

user_regency_id

user_regency_id
required
integer

user_regency_id

user_education
required
enum
Enum: "Sarjana" "SMA/SMK" "SMP" "SD"

user_education

user_address
required
string

user_address

user_email
required
string

user_email

user_has_work_experience
required
boolean

1=true,0=false

user_work_experience
required
enum
Enum: "< 1 year" "1 year" "2 years" "3 years"

user_work_experience

Request Body schema: application/octet-stream
string <binary>

Responses

Response samples

Content type
application/json
{
  • "status": "success",
  • "code": "200",
  • "message": "Profile has been stored successfully."
}

Update current Profile

send only field which need to be updated, no need to sent all the field.

Authorizations:
query Parameters
user_fullname
string

user_fullname

user_birth_date
date <dd-mm-yyyy>

user_birth_date

user_gender
enum
Enum: "1 | Laki-laki" "2 | Perempuan"

user_gender

user_marital_status
enum
Enum: "0 | Belum Menikah" "1 | Menikah" "else | -"

user_marital_status

user_email
string

user_email

user_phone
string

user_phone

user_province_id
integer

user_province_id

user_regency_id
integer

user_regency_id

user_regency_id
integer

user_regency_id

user_education
enum
Enum: "Sarjana" "SMA/SMK" "SMP" "SD"

user_education

user_address
string

user_address

user_email
string

user_email

user_has_work_experience
boolean

1=true,0=false

user_work_experience
enum
Enum: "< 1 year" "1 year" "2 years" "3 years"

user_work_experience

Request Body schema: application/octet-stream
string <binary>

Responses

Response samples

Content type
application/json
{
  • "status": "success",
  • "code": "200",
  • "data": {}
}

no-auth

get data without auth

Returns class only published class

action view

Responses

Response samples

Content type
application/json
{}

Get class by class_id for no auth user

path Parameters
class_id
required
string

class_id from class list. This responses can be applied at detail page

Responses

Response samples

Content type
application/json
{}

Returns only published testimonial data

action view detail

Responses

Response samples

Content type
application/json
{}

Student-Class

Student Class

Returns only published class data

action show detail, join

Authorizations:

Responses

Response samples

Content type
application/json
{
  • "status": "success",
  • "code": "200",
  • "data": [
    ]
}

Get class by class_id

Authorizations:
path Parameters
class_id
required
string

class_id from class list. This responses can be applied at edit page and detail page

Responses

Response samples

Content type
application/json
{
  • "status": "success",
  • "code": "200",
  • "data": {
    }
}

Get class with module. only published class and module

Authorizations:
path Parameters
class_id
required
string

class_id from class list. This responses can be applied at edit page and detail page

Responses

Response samples

Content type
application/json
{}

join Class

generate row for my-module and my-lesson which the first object`s status is unlocked and the rest are locked.

Authorizations:
query Parameters
class_id
required
int
Example: class_id=1

Post the id

Responses

Response samples

Content type
application/json
{
  • "status": "success",
  • "code": "200",
  • "message": "Class has been stored successfully."
}

Student-Module

Student Module

Get module with Lesson . only published module and Lesson

Authorizations:
path Parameters
module_id
required
string

Responses

Response samples

Content type
application/json
{}

Student-Quiz

Student Quiz

Returns quiz data

Authorizations:
query Parameters
lesson_id
required
int
Example: lesson_id=1

Responses

Response samples

Content type
application/json
{
  • "status": "success",
  • "code": "200",
  • "data": {
    }
}

My-Class

Class which joined

Returns my class data

Authorizations:

Responses

Response samples

Content type
application/json
{}

My-Module

Module which joined

Returns my module data

class_id = id from lms_class_id

Authorizations:
query Parameters
class_id
required
string

Responses

Response samples

Content type
application/json
{
  • "status": "success",
  • "code": "200",
  • "data": {
    }
}

My-Lesson

lesson which joined

Returns my lesson data

Authorizations:
query Parameters
module_id
required
string

Responses

Response samples

Content type
application/json
{}

My-Quiz

My Quiz which joined

Returns quiz data

answers sort by position

Authorizations:
query Parameters
lesson_id
required
integer

Responses

Response samples

Content type
application/json
{
  • "status": "success",
  • "code": "200",
  • "data": {
    }
}

Submit Quiz to save score

if score > 50 then is_pass = 1 and finish lesson, and unlocked next lesson or finish lesson, or unlocked new module or finish module, or finish class

Authorizations:
Request Body schema: application/json
lesson_id
integer
score
integer

Responses

Request samples

Content type
application/json
{
  • "lesson_id": "1",
  • "score": "70"
}

Response samples

Content type
application/json
{
  • "status": "success",
  • "code": "200",
  • "message": "Quiz Finished!"
}

My-Certificate

Returns my certificate data

Authorizations:

Responses

Response samples

Content type
application/json
{}

Returns my certificate data

Authorizations:

Responses

Response samples

Content type
application/json
{}

notification

user notification

Returns my certificate data

Authorizations:

Responses

Response samples

Content type
application/json
{
  • "status": "success",
  • "code": "200",
  • "data": [
    ]
}

Delete notification

Authorizations:
query Parameters
notif_id
required
integer

id of the notification

Responses

Response samples

Content type
application/json
{
  • "status": "success",
  • "code": "200",
  • "message": "Notification has been deleted successfully."
}

Read Notification

Authorizations:
query Parameters
notif_id
required
integer

Responses

Response samples

Content type
application/json
{
  • "status": "success",
  • "code": "200",
  • "message": "Notification updated successfully."
}

Read All Notification

Authorizations:

Responses

Response samples

Content type
application/json
{
  • "status": "success",
  • "code": "200",
  • "message": "Notification updated successfully."
}