Authentication
Untuk mengakses semua endpoint dalam API Rapatin, pengguna harus melakukan autentikasi terlebih dahulu menggunakan token. Token yang diterima harus digunakan di setiap request API berikutnya dengan menambahkannya ke header: Authorization: Bearer {token}
.
Header parameters
Content-TypestringRequiredExample:
application/json
AcceptstringRequiredExample:
application/json
Body
emailstring · emailRequired
Alamat email akun pengguna Rapatin
passwordstringRequired
Password akun Rapatin
devicestringRequired
Nama perangkat atau aplikasi (contoh: 'postman')
Responses
200
Token berhasil dibuat
application/json
422
Gagal login - Unauthorized
application/json
post
POST /auth/login HTTP/1.1
Host: api.rapatin.id
Content-Type: application/json
Accept: application/json
Content-Length: 60
{
"email": "[email protected]",
"password": "text",
"device": "text"
}
{
"response": {
"status": "success",
"status_code": 200,
"message": "Token generated successfully"
},
"data": {
"token": "13|bPC5YoBuiovI6GmI7SFo8rsdqAK7ecISA5WGxADwfd4cca67",
"user": {
"id": 5,
"name": "Account Name",
"email": "[email protected]",
"phone": "088122445566",
"address": "Account address here",
"role": 7,
"emailVerified": true,
"ordersCount": 6,
"createdAt": "2025-08-05T00:56:29.000000Z",
"updatedAt": "2025-08-19T04:35:04.000000Z"
}
}
}
Was this helpful?