Users Endpoint

{info} Mendapatkan informasi terkait pengguna.


Base URL

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

Get All Users

  • URL
    • /users
  • Method
    • GET
  • Headers
    • Authorization: Bearer <token>
  • Response
    {
        "success": true,
        "message": "Berhasil mengambil data",
        "data": {
            "users": [
                {
                    "id": 3,
                    "name": "Abdullah Ubaid",
                    "email": "ifs18004@delcom.org",
                    "email_verified_at": null,
                    "photo": "http://127.0.0.1:8000/default/img/user.png",
                    "created_at": "2024-10-05T03:26:57.000000Z",
                    "updated_at": "2024-10-05T03:26:57.000000Z"
                },
                {
                    "id": 2,
                    "name": "Abdullah Ubaid",
                    "email": "ifs18005@delcom.org",
                    "email_verified_at": null,
                    "photo": "http://127.0.0.1:8000/img/profile/2_1728103215.jpeg",
                    "created_at": "2024-10-05T03:18:14.000000Z",
                    "updated_at": "2024-10-05T04:40:15.000000Z"
                },
                {
                    "id": 1,
                    "name": "Delcom Testing",
                    "email": "testing@delcom.org",
                    "email_verified_at": null,
                    "photo": "http://127.0.0.1:8000/default/img/user.png",
                    "created_at": "2024-10-05T02:53:38.000000Z",
                    "updated_at": "2024-10-05T02:53:38.000000Z"
                }
            ]
        }
    }

Get User By Id

  • URL
    • /users/:id
  • Method
    • GET
  • Headers
    • Authorization: Bearer <token>
  • Response
    {
        "success": true,
        "message": "Berhasil mengambil data",
        "data": {
            "user": {
                "id": 2,
                "name": "Abdullah Ubaid",
                "email": "ifs18005@delcom.org",
                "email_verified_at": null,
                "photo": "http://127.0.0.1:8000/default/img/user.png",
                "created_at": "2024-10-05T03:18:14.000000Z",
                "updated_at": "2024-10-05T03:18:14.000000Z"
            }
        }
    }

Get Profile

  • URL
    • /users/me
  • Method
    • GET
  • Headers
    • Authorization: Bearer <token>
  • Response
    {
        "success": true,
        "message": "Berhasil mengambil data",
        "data": {
            "user": {
                "id": 3,
                "name": "Abdullah Ubaid",
                "email": "ifs18005@del.ac.id",
                "email_verified_at": null,
                "photo": "img/profile/3_1709251633.png",
                "created_at": "2024-02-29T23:46:32.000000Z",
                "updated_at": "2024-03-01T00:07:13.000000Z"
            }
        }
    }

Update Profile

  • URL
    • /users/me
  • Method
    • PUT
  • Headers
    • Content-Type: application/x-www-form-urlencoded
    • Authorization: Bearer <token>
  • Request Body
    • name as string
    • email as string
  • Response
    {
        "success": true,
        "message": "Berhasil mengubah data",
        "data": {
            "user": {
                "id": 1,
                "name": "Abdullah",
                "email": "ifs18005@del.ac.id",
                "email_verified_at": null,
                "photo": "img/profile/1_1709107233.png",
                "created_at": "2024-02-28T04:11:30.000000Z",
                "updated_at": "2024-10-05T01:21:09.000000Z"
            }
        }
    }

Change Photo Profile

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

Change Password

  • URL
    • /users/password
  • Method
    • PUT
  • Headers
    • Content-Type: application/x-www-form-urlencoded
    • Authorization: Bearer <token>
  • Request Body
    • password as string
    • new_password as string
  • Response
    {
        "success": true,
        "message": "Berhasil mengubah kata sandi"
    }