Login Account
Login API
Section titled “Login API”Login Account merupakan API yang digunakan untuk mendapatkan token Authentication dengan mengirimkan data berupa Username dan Password.
Endpoint
Section titled “Endpoint”POST https://h2h.amdigipay.com/api/loginRequest
Section titled “Request”Headers
Section titled “Headers”| Name | Type | Description |
|---|---|---|
| Content-Type | string | application/json |
Body Parameters
Section titled “Body Parameters”| Name | Type | Required | Description |
|---|---|---|---|
| username | string | Yes | Username untuk login |
| password | string | Yes | Password untuk login |
Example Request
Section titled “Example Request”{ "username": "your_username", "password": "your_password"}Response
Section titled “Response”Success Response (200 OK)
Section titled “Success Response (200 OK)”{ "error": false, "message": "Login success", "data": { "access_token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwOi8vYXBpLXNhbmRib3guYmlzYWJpbGxlci5jb20vYXBpL2xvZ2luIiwiaWF0IjoxNjc5NjI0MzI3LCJleHAiOjE2Nzk2Mjc5MjcsIm5iZiI6MTY3OTYyNDMyNywianRpIjoidFR2UGpldnVQVzRLdlZKVCIsInN1YiI6IjEyMiIsInBydiI6IjIzYmQ1Yzg5NDlmNjAwYWRiMzllNzAxYzQwMDg3MmRiN2E1OTc2ZjcifQ.wlH6rG7UluU09WMQOVtBr1PeUS2t4mrGuDaz6qBcYwQ", "token_type": "bearer", "expires_in": 3600 }}Error Response (401 Unauthorized) (WIP)
Section titled “Error Response (401 Unauthorized) (WIP)”{ "status": "error", "message": "Invalid username or password", "data": null}Error Response (500 Internal Server Error) (WIP)
Section titled “Error Response (500 Internal Server Error) (WIP)”{ "status": "error", "message": "Internal server error", "data": null}Notes (WIP)
Section titled “Notes (WIP)”- Token yang diterima harus disimpan dan digunakan untuk autentikasi pada API lainnya.
- Token memiliki masa aktif tertentu, biasanya 24 jam.
- Setelah token kadaluarsa, pengguna harus melakukan login kembali.