Aucations Endpoint

{info} Mengolah data pelelangan.


Base URL

https://public-api.delcom.org/api/v1

Add New Aucation

  • URL
    • /aucations
  • Method
    • POST
  • Headers
    • Content-Type: multipart/form-data
    • Authorization: Bearer <token>
  • Request Body
    • cover as file
    • title as string
    • description as string
    • start_bid as number
    • closed_at as timestamp, example: 2024-10-05 22:00:00
  • Response
{
    "success": true,
    "message": "Berhasil menambahkan data",
    "data": {
        "aucation_id": 3
    }
}

Change Cover Aucation

  • URL
    • /aucations/:id/cover
  • Method
    • POST
  • Headers
    • Content-Type: multipart/form-data
    • Authorization: Bearer <token>
  • Request Body
    • cover as file
  • Response
{
    "success": true,
    "message": "Berhasil mengubah cover"
}

Update Aucation

  • URL
    • /aucations/:id
  • Method
    • PUT
  • Headers
    • Content-Type: application/x-www-form-urlencoded
    • Authorization: Bearer <token>
  • Request Body
    • title as string
    • description as string
    • start_bid as number
    • closed_at as timestamp, example: 2024-10-05 22:00:00
  • Response
{
    "success": true,
    "message": "Berhasil mengubah data"
}

Get All Aucations

  • URL
    • /aucations
  • Parameters
    • is_me as 1
      • Notes:
        • 1 as retrieve all data created
    • is_closed as 0 | 1
      • Notes:
        • 0 as retrieve all closed aucations
        • 1 as retrieve all opened aucations
  • Method
    • GET
  • Headers
    • Authorization: Bearer <token>
  • Response
{
    "success": true,
    "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]
            }
        ]
    }
}

Detail Aucation

  • URL
    • /aucations/:id
  • Method
    • GET
  • Headers
    • Authorization: Bearer <token>
  • Response
{
    "success": true,
    "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"
            }
        }
    }
}

Delete Aucation

  • URL
    • /aucations/:id
  • Method
    • DELETE
  • Headers
    • Authorization: Bearer <token>
  • Response
{
    "success": true,
    "message": "Berhasil menghapus data"
}

Add Bid

  • URL
    • /aucations/:id/bids
  • Method
    • POST
  • Headers
    • Content-Type: application/x-www-form-urlencoded
    • Authorization: Bearer <token>
  • Request Body
    • bid as number
  • Response
{
    "success": true,
    "message": "Berhasil memberikan tawaran pada lelang"
}

Delete Bid

  • URL
    • /aucations/:id/bids
  • Method
    • DELETE
  • Headers
    • Authorization: Bearer <token>
  • Response
{
    "success": true,
    "message": "Berhasil menghapus tawaran pada lelang"
}