Dokumentasi API
Aucations
Aucations Endpoint
info: Mengolah data pelelangan.
- Base URL
- Add New Aucation
- Change Cover Aucation
- Update Aucation
- Get All Aucation
- Detail Aucation
- Delete Aucation
- Add Bid
- Delete Bid
- Delete All Aucations
Base URL
https://open-api.delcom.org/api/v1
Add New Aucation
Membuat sesi lelang (aucation) barang baru dengan penawaran awal dan batas waktu.
- URL
/aucations
- Method
- POST
- Headers
Content-Type:application/jsonAuthorization:Bearer <token>
- Request Body
titleasstringdescriptionasstringstart_bidasnumberclosed_atastimestamp, example:2024-10-05 22:00:00
- Contoh Request
POST {{BaseURL}}/aucations Accept: application/json Authorization: Bearer <token> Content-Type: application/json { "title": "Contoh Judul", "description": "Contoh deskripsi", "start_bid": 10000, "closed_at": "2026-12-31 23:59:59" } - Catatan: upload cover dilakukan terpisah lewat Change Cover Aucation.
Change Cover Aucation
Mengunggah atau memperbarui gambar sampul (cover) barang lelang.
- URL
/aucations/:id/cover
- Method
- POST
- Headers
Content-Type:multipart/form-dataAuthorization:Bearer <token>
- Request Body
coverasfile
- Contoh Request
POST {{BaseURL}}/aucations/1/cover Accept: application/json Authorization: Bearer <token> Content-Type: multipart/form-data; boundary=----DelcomFormBoundary ------DelcomFormBoundary Content-Disposition: form-data; name="cover"; filename="cover.jpg" Content-Type: image/jpeg < ./cover.jpg ------DelcomFormBoundary-- - Response Berhasil
{ "status": "success", "message": "Berhasil mengubah cover" } - Response Gagal
{ "status": "fail", "message": "Data tidak valid", "data": { "field": [ "Pesan validasi" ] } }
Update Aucation
Memperbarui data dan detail lelang yang telah dibuat.
- URL
/aucations/:id
- Method
- PUT
- Headers
Content-Type:application/jsonAuthorization:Bearer <token>
- Request Body
titleasstringdescriptionasstringstart_bidasnumberclosed_atastimestamp, example:2024-10-05 22:00:00
- Contoh Request
PUT {{BaseURL}}/aucations/1 Accept: application/json Authorization: Bearer <token> Content-Type: application/json { "title": "Contoh Judul", "description": "Contoh deskripsi", "start_bid": 10000, "closed_at": "2026-12-31 23:59:59" } - Response Berhasil
{ "status": "success", "message": "Berhasil mengubah data" } - Response Gagal
{ "status": "fail", "message": "Data tidak valid", "data": { "field": [ "Pesan validasi" ] } }
Get All Aucations
Mengambil daftar seluruh sesi lelang yang tersedia atau milik sendiri.
- URL
/aucations
- Parameters
is_meas1- Notes:
1asretrieve all data created
- Notes:
is_closedas0 | 1- Notes:
0asretrieve all closed aucations1asretrieve all opened aucations
- Notes:
- Method
- GET
- Headers
Authorization:Bearer <token>
- Contoh Request
GET {{BaseURL}}/aucations Accept: application/json Authorization: Bearer <token> - Response Berhasil
{ "status": "success", "message": "Berhasil mengambil data", "data": { "aucations": [ { "id": 3, "user_id": 2, "title": "Keyboard Gaming RGB", "cover": "http://127.0.0.1:8000/img/aucations/cover/2_1728119129.jpeg", "description": "Barang masih mulus...", "start_bid": 200000, "closed_at": "2024-10-05 16:05:29", "created_at": "2024-10-05T09:04:49.000000Z", "updated_at": "2024-10-05T09:05:29.000000Z", "author": { "name": "Abdullah Ubaid", "photo": "http://127.0.0.1:8000/default/img/user.png" }, "bids": [] }, { "id": 2, "user_id": 1, "title": "Oculus Quest 2", "cover": "http://127.0.0.1:8000/img/aucations/cover/1_1728117244.jpeg", "description": "Oculus Quest 2 second mulus", "start_bid": 5000000, "closed_at": "2024-10-05 22:00:00", "created_at": "2024-10-05T08:34:04.000000Z", "updated_at": "2024-10-05T08:34:04.000000Z", "author": { "name": "Abdullah Ubaid", "photo": "http://127.0.0.1:8000/default/img/user.png" }, "bids": [2] } ] } } - Response Gagal
{ "status": "fail", "message": "Data tidak valid", "data": { "field": [ "Pesan validasi" ] } }
Detail Aucation
Melihat informasi lengkap barang lelang beserta riwayat penawaran (bids).
- URL
/aucations/:id
- Method
- GET
- Headers
Authorization:Bearer <token>
- Contoh Request
GET {{BaseURL}}/aucations/1 Accept: application/json Authorization: Bearer <token> - Response Berhasil
{ "status": "success", "message": "Berhasil mengambil data", "data": { "aucation": { "id": 2, "user_id": 1, "title": "Oculus Quest 2", "cover": "http://127.0.0.1:8000/img/aucations/cover/1_1728117244.jpeg", "description": "Oculus Quest 2 second mulus", "start_bid": 5000000, "closed_at": "2024-10-05 22:00:00", "created_at": "2024-10-05T08:34:04.000000Z", "updated_at": "2024-10-05T08:34:04.000000Z", "author": { "name": "Abdullah Ubaid", "photo": "http://127.0.0.1:8000/default/img/user.png" }, "bids": [ { "id": 2, "bid": 7000000, "created_at": "2024-10-05T08:44:12.000000Z", "updated_at": "2024-10-05T08:44:12.000000Z" } ], "my_bid": { "id": 2, "bid": 7000000, "created_at": "2024-10-05T08:44:12.000000Z", "updated_at": "2024-10-05T08:44:12.000000Z" } } } } - Response Gagal
{ "status": "fail", "message": "Data tidak valid", "data": { "field": [ "Pesan validasi" ] } }
Delete Aucation
Menghapus sesi lelang yang dipilih dari sistem.
- URL
/aucations/:id
- Method
- DELETE
- Headers
Authorization:Bearer <token>
- Contoh Request
DELETE {{BaseURL}}/aucations/1 Accept: application/json Authorization: Bearer <token> - Response Berhasil
{ "status": "success", "message": "Berhasil menghapus data" } - Response Gagal
{ "status": "fail", "message": "Data tidak valid", "data": { "field": [ "Pesan validasi" ] } }
Add Bid
Mengajukan nominal penawaran harga (bid) baru pada sesi lelang.
- URL
/aucations/:id/bids
- Method
- POST
- Headers
Content-Type:application/jsonAuthorization:Bearer <token>
- Request Body
bidasnumber
- Contoh Request
POST {{BaseURL}}/aucations/1/bids Accept: application/json Authorization: Bearer <token> Content-Type: application/json { "bid": 10000 } - Response Berhasil
{ "status": "success", "message": "Berhasil memberikan tawaran pada lelang" } - Response Gagal
{ "status": "fail", "message": "Data tidak valid", "data": { "field": [ "Pesan validasi" ] } }
Delete Bid
Menghapus atau membatalkan penawaran lelang yang telah diajukan.
- URL
/aucations/:id/bids
- Method
- DELETE
- Headers
Authorization:Bearer <token>
- Contoh Request
DELETE {{BaseURL}}/aucations/1/bids Accept: application/json Authorization: Bearer <token> - Response Berhasil
{ "status": "success", "message": "Berhasil menghapus tawaran pada lelang" } - Response Gagal
{ "status": "fail", "message": "Data tidak valid", "data": { "field": [ "Pesan validasi" ] } }
Delete All Aucations
Menghapus semua data lelang milik pengguna saat ini secara permanen beserta berkas cover dan tawaran (bids) terkait.
- URL
/aucations
- Method
- DELETE
- Headers
Authorization:Bearer <token>
- Contoh Request
DELETE {{BaseURL}}/aucations Accept: application/json Authorization: Bearer <token> - Response Berhasil
{ "status": "success", "message": "Berhasil menghapus semua data pelelangan" } - Response Gagal
{ "status": "fail", "message": "Unauthenticated." }