Pada halaman Employee Asset ini Anda dapat menggunakan metode :
1. POST
2. GET
1. POST
- Add new Asset of Employee
Tujuan : Untuk menambahkan aset perusahaan baru yang dimiliki oleh Karyawan
Method : POST
API Endpoint : [[baseurl]]/api/integration/v1/employee/assets
HEADER
X-TenantID: [[tenantid]]
Authorization: Bearer [[accesstoken]]
๐Notes Untuk mengetahui [[baseurl]], And [[tenantid]], Anda dapat mempelajarinya pada halaman Integration Credential. Dan untuk [[accesstoken]] dapat dipelajari pada halaman Authorization Token.
BODY PAYLOAD (JSON)
{
"employeeNo": "0921092",
"asset_name": "tes1",
"receiveDate": "2022-01-01",
"returnDate": "2022-03-01",
"remark": "tes",
"isActive": false
}
CONSUME VIA CURL
curl --location --request POST '[[baseurl]]/api/integration/v1/employee/assets'
--header 'X-TenantID: [[tenantid]]'
--header 'Authorization: Bearer [[accesstoken]]'
--header 'Content-Type: application/json'
--data-raw '{
"employeeNo" : "0921092",
"asset_name" : "tes1",
"receiveDate":"2022-01-01",
"returnDate":"2022-03-01",
"remark":"tes",
"isActive":false
}'
API Response :
{
"message": "Create Data Successfully",
"error": false
}
2. GET
- Get detail Employee Assets with employeeNo parameter
Tujuan : Untuk mendapatkan detail aset perusahaan yang dimiliki oleh Karyawan dengan parameter employeeNo
Method : GET
API Endpoint : [[baseurl]]/api/integration/v1/employee/assets?active=[[value]]&employeeNo=[[employeenumber]]
๐Notes Parameter [[value]] diisi dengan “true” jika data karyawan tersebut aktif atau “false” jika data karyawan tersebut tidak aktif. Dan parameter [[employeenumber]] diisi dengan nomor karyawan yang diinginkan.
HEADER
X-TenantID: [[tenantid]]
Authorization: Bearer [[accesstoken]]
CONSUME VIA CURL
curl --location --request GET '[[baseurl]]/api/integration/v1/employee/assets?active=[[value]]&employeeNo=[[employeenumber]]'
--header 'X-TenantID: [[tenantid]]'
--header 'Authorization: Bearer [[accesstoken]]'
๐Notes Untuk mengetahui [[baseurl]], And [[tenantid]], Anda dapat mempelajarinya pada halaman Integration Credential. Dan untuk [[accesstoken]] dapat dipelajari pada halaman Authorization Token.
API Response :
[
{
"employeeId": "eba2b46b-929c-11eb-97ce-0adbcc9eaaa8",
"employeeNo": "1219003",
"details": [
{
"id": "8b719626-630b-45b6-a4f6-7fd5ceb25403",
"name": "Iphone XR 64 GB",
"tagNo": "TG002",
"serialNo": "X023345XXX",
"category": "Iphone",
"receiveDate": "2021-07-08",
"returnDate": "2021-07-23",
"remark": "wwde",
"active": true
},
{
"id": "3472807e-8be0-4dbb-83b9-d9d49372a27c",
"name": "Iphone XR 64 GB",
"tagNo": "TG002",
"serialNo": "X023345XXX",
"category": "Iphone",
"receiveDate": "2021-07-13",
"returnDate": null,
"remark": null,
"active": true
},
{
"id": "965e6894-d985-11eb-946e-560003594849",
"name": "Lenovo Yoga Slim 7i",
"tagNo": "TG001",
"serialNo": "SNXXX00928",
"category": "Laptop",
"receiveDate": "2021-07-01",
"returnDate": null,
"remark": "test",
"active": true
}
]
}
]