Skip to content
Syarif Ubaidillah edited this page Jul 7, 2022 · 1 revision

User

Setiap fitur yang memiliki header Authorization berarti harus login untuk mendapatkan access_token dan refresh_token.

Setiap fitur yang memiliki Query Param dapat digunakan seperti ini /api/example?paramA=12&paramB=331.

Create

Fitur terbatas pada role Administrator

Method Path
POST /api/user
Header Value
Content-Type application/json
Authorization Bearer <access_token>
Request Body
{
	"email": "milimnava@holyhos.co.id",
	"password": "password",
	"full_name": "Milim Nava",
	"gender": "Female",
	"role_id": 2
	"facility_id": 3,
}
Response Body
{
	"message": "User Created",
}

FindAll

Method Path
GET /api/user
Header Value
Authorization Bearer <access_token>
Query Param Data Type
role_id Numeric
facility_id Numeric
Response Body
{
	"data": [
		{
			"id": 1,
			"code": "DR00001",
			"email": "alsyadahmad@holyhos.co.id",
			"full_name": "Alsyad Ahmad",
			"gender": "Male",
			"facility": "General",
			"roles": "Doctor",
			"status": 1
		}
	],
	"message": "User Fetched"
}

FindByID

Method Path
GET /api/user/{id}
Header Value
Authorization Bearer <access_token>
Response Body
{
	"data": {
		"id": 1,
		"code": "DR00001",
		"email": "alsyadahmad@holyhos.co.id",
		"full_name": "Alsyad Ahmad",
		"gender": "Male",
		"facility": "General",
		"roles": "Doctor",
		"status": 1
	},
	"message": "User Fetched"
}

Update

Fitur terbatas pada role Administrator

Method Path
PUT /api/user/{id}/update
Header Value
Content-Type application/json
Authorization Bearer <access_token>
Request Body
{
	"email": "alsyadahmad@holyhos.co.id",
	"password": "password",
	"full_name": "Alsyad Ahmad",
	"gender": "Male",
	"facility": "General",
	"roles": "Doctor",
}
Response Body
{
	"message": "User #{id} Updated",
}

Delete

Fitur terbatas pada role Administrator

Method Path
DELETE /api/user/{id}/delete
Header Value
Authorization Bearer <access_token>
Response Body
{
	"message": "User #{id} Deleted",
}
Clone this wiki locally