Lost & Founds Endpoint

{info} Mengolah data kehilangan dan temuan.


Base URL

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

Add New Lost & Found

  • URL
    • /lost-founds
  • Method
    • POST
  • Headers
    • Content-Type: application/x-www-form-urlencoded
    • Authorization: Bearer <token>
  • Request Body
    • title as string
    • description as string
    • status as lost | found
  • Response
{
    "success": true,
    "message": "Berhasil menambahkan data",
    "data": {
        "lost_found_id": 1
    }
}

Change Cover Lost & Found

  • URL
    • /lost-founds/: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 Lost & Found

  • URL
    • /lost-founds/:id
  • Method
    • PUT
  • Headers
    • Content-Type: application/x-www-form-urlencoded
    • Authorization: Bearer <token>
  • Request Body
    • title as string
    • description as string
    • status as lost | found
    • is_completed as 1 | 0
      • Notes:
        • 1 as true
        • 0 as false
  • Response
{
    "success": true,
    "message": "Berhasil mengubah data"
}

Get All Lost & Founds

  • URL
    • /lost-founds
  • Parameters
    • is_completed as 1 | 0
      • Notes:
        • 1 as true
        • 0 as false
    • is_me as 1
      • Notes:
        • 1 as retrieve all data created
    • status as lost | found
  • Method
    • GET
  • Headers
    • Authorization: Bearer <token>
  • Response
{
    "success": true,
    "message": "Berhasil mengambil data",
    "data": {
        "lost_founds": [
            {
                "id": 8,
                "user_id": 1,
                "title": "Update judul 2",
                "description": "Update deskripsi 2",
                "status": "found",
                "is_completed": 0,
                "cover": "img/lost-founds/cover/1_1709106579.png",
                "created_at": "2024-02-28T07:49:32.000000Z",
                "updated_at": "2024-02-28T07:49:39.000000Z",
                "author": {
                    "name": "Delcom Testing",
                    "photo": null
                }
            },
            {
                "id": 9,
                "user_id": 1,
                "title": "Testing Title 2",
                "description": "Testing Deskripsi 2",
                "status": "found",
                "is_completed": 0,
                "cover": null,
                "created_at": "2024-02-28T07:50:37.000000Z",
                "updated_at": "2024-02-28T07:50:37.000000Z",
                "author": {
                    "name": "Delcom Testing",
                    "photo": null
                }
            }
        ]
    }
}

Detail Lost & Found

  • URL
    • /lost-founds/:id
  • Method
    • GET
  • Headers
    • Authorization: Bearer <token>
  • Response
{
    "success": true,
    "message": "Berhasil mengambil data",
    "data": {
        "lost_found": {
            "id": 9,
            "user_id": 1,
            "title": "Testing Title 2",
            "description": "Testing Deskripsi 2",
            "status": "found",
            "is_completed": 0,
            "cover": null,
            "created_at": "2024-02-28T07:50:37.000000Z",
            "updated_at": "2024-02-28T07:50:37.000000Z",
            "author": {
                "name": "Delcom Testing",
                "photo": null
            }
        }
    }
}

Delete Lost & Found

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

Get Stats Daily

  • URL
    • /lost-founds/stats/daily
  • Request Body
    • end_date as timestamp, example: 2024-10-05 22:00:00
    • total_data as number
  • Method
    • GET
  • Headers
    • Authorization: Bearer <token>
  • Response
{
    "success": true,
    "message": "Berhasil mengambil data",
    "data": {
        "stats_losts": {
            "01-10-2024": 0,
            "02-10-2024": 0,
            "03-10-2024": 0,
            "04-10-2024": 0,
            "05-10-2024": 0,
            "06-10-2024": 1,
            "07-10-2024": 0
        },
        "stats_losts_completed": {
            "01-10-2024": 0,
            "02-10-2024": 0,
            "03-10-2024": 0,
            "04-10-2024": 0,
            "05-10-2024": 0,
            "06-10-2024": 0,
            "07-10-2024": 0
        },
        "stats_losts_process": {
            "01-10-2024": 0,
            "02-10-2024": 0,
            "03-10-2024": 0,
            "04-10-2024": 0,
            "05-10-2024": 0,
            "06-10-2024": 1,
            "07-10-2024": 0
        },
        "stats_founds": {
            "01-10-2024": 0,
            "02-10-2024": 0,
            "03-10-2024": 0,
            "04-10-2024": 0,
            "05-10-2024": 0,
            "06-10-2024": 1,
            "07-10-2024": 0
        },
        "stats_founds_completed": {
            "01-10-2024": 0,
            "02-10-2024": 0,
            "03-10-2024": 0,
            "04-10-2024": 0,
            "05-10-2024": 0,
            "06-10-2024": 0,
            "07-10-2024": 0
        },
        "stats_founds_process": {
            "01-10-2024": 0,
            "02-10-2024": 0,
            "03-10-2024": 0,
            "04-10-2024": 0,
            "05-10-2024": 0,
            "06-10-2024": 1,
            "07-10-2024": 0
        }
    }
}

Get Stats Monthly

  • URL
    • /lost-founds/stats/monthly
  • Request Body
    • end_date as timestamp, example: 2024-10-05 22:00:00
    • total_data as number
  • Method
    • GET
  • Headers
    • Authorization: Bearer <token>
  • Response
{
    "success": true,
    "message": "Berhasil mengambil data",
    "data": {
        "stats_losts": {
            "06-2024": 0,
            "07-2024": 0,
            "08-2024": 0,
            "09-2024": 0,
            "10-2024": 1
        },
        "stats_losts_completed": {
            "06-2024": 0,
            "07-2024": 0,
            "08-2024": 0,
            "09-2024": 0,
            "10-2024": 0
        },
        "stats_losts_process": {
            "06-2024": 0,
            "07-2024": 0,
            "08-2024": 0,
            "09-2024": 0,
            "10-2024": 1
        },
        "stats_founds": {
            "06-2024": 0,
            "07-2024": 0,
            "08-2024": 0,
            "09-2024": 0,
            "10-2024": 1
        },
        "stats_founds_completed": {
            "06-2024": 0,
            "07-2024": 0,
            "08-2024": 0,
            "09-2024": 0,
            "10-2024": 0
        },
        "stats_founds_process": {
            "06-2024": 0,
            "07-2024": 0,
            "08-2024": 0,
            "09-2024": 0,
            "10-2024": 1
        }
    }
}