-
Notifications
You must be signed in to change notification settings - Fork 1
Auth
Syarif Ubaidillah edited this page Jul 9, 2022
·
3 revisions
Setiap fitur yang memiliki header
Authorization
berarti harus login untuk mendapatkanaccess_token
danrefresh_token
.
Setiap fitur yang memiliki
Query Param
dapat digunakan seperti ini/api/example?paramA=12¶mB=331
.
Method | Path |
---|---|
POST | /api/login |
Header | Value |
---|---|
Content-Type | application/json |
{
"email": "alsyadahmad@holyhos.co.id",
"password": "password"
}
{
"message": "User Logged In",
"data": {
"id": 3,
"code": "DRS00001",
"email": "alsyadahmad@holyhos.co.id",
"full_name": "Alsyad Ahmad",
"gender": "Male",
"roles": "Doctor",
"facility": "General",
"status": 1
},
"jwt": {
"access_token": "<access_token>",
"refresh_token": "<refresh_token>"
}
}
Method | Path |
---|---|
POST | /api/register |
Header | Value |
---|---|
Content-Type | application/json |
{
"email": "syarif@holyhos.co.id",
"password": "password",
"facility_id": 2,
"full_name": "Syarif Ubaidillah",
"gender": "Male",
"role_id": 2
}
{
"message": "Register success",
}
Method | Path |
---|---|
POST | /api/find_email |
Header | Value |
---|---|
Content-Type | application/json |
{
"email": "alsyadahmad@holyhos.co.id",
}
{
"message": "User Logged In",
"data": {
"id": 3,
"code": "NRS00001",
"email": "priscillahalim@holyhos.co.id",
"full_name": "Priscilla Halim",
"gender": "Female",
"roles": "Nurse",
"facility": "General",
"status": 1
},
"jwt": {
"access_token": "<access_token>",
"refresh_token": "<refresh_token>"
}
}
Method | Path |
---|---|
POST | /api/forgot_password |
Header | Value |
---|---|
Content-Type | application/json |
Query Param | Value |
---|---|
token | token_from_find_email |
{
"password": "password",
}
{
"message": "Password Changed",
}
Method | Path |
---|---|
GET | /api/profile |
Header | Value |
---|---|
Authorization | Bearer <access_token> |
{
"email": "alsyadahmad@holyhos.co.id",
"password": "password"
}
{
"message": "User Logged In",
"data": {
"id": 3,
"code": "NRS00001",
"email": "priscillahalim@holyhos.co.id",
"full_name": "Priscilla Halim",
"gender": "Female",
"roles": "Nurse",
"facility": "General",
"status": 1
},
}
Method | Path |
---|---|
POST | /api/profile/change_password |
Header | Value |
---|---|
Content-Type | application/json |
Authorization | Bearer <access_token> |
{
"password": "password",
}
{
"message": "Password Changed",
}
Method | Path |
---|---|
POST | /api/refresh_token |
Header | Value |
---|---|
Content-Type | application/json |
Authorization | Bearer <refresh_token> |
Query Param | Value |
---|---|
token | access_token |
{
"message": "Token Refreshed",
"data": {
"access_token": "<token>",
"refresh_token": "<token>"
}
}
Method | Path |
---|---|
POST | /api/logout |
Header | Value |
---|---|
Authorization | Bearer <access_token> |
{
"message": "User Logged Out",
}