[2️] My Staff API
Update a record

How to update a record

After you create a record, you can update the registered data through My Staff API.


  1. Run this GET request to list all your registered employee data.
curl --location 'https://dummy.restapiexample.com/api/v1/employees'
  1. You'll receive a response similar to this:
{
  "status": "success",
  "data": [
    {
      "id": 1,
      "employee_name": "Tiger Nixon",
      "employee_salary": 320800,
      "employee_age": 61,
      "profile_image": ""
    },
    {
      "id": 2,
      "employee_name": "Garrett Winters",
      "employee_salary": 170750,
      "employee_age": 63,
      "profile_image": ""
    },
    {
      "id": 3,
      "employee_name": "Ashton Cox",
      "employee_salary": 86000,
      "employee_age": 66,
      "profile_image": ""
    }
  ],
  "message": "Successfully! All records has been fetched."
}
  1. Copy the id for the record you want to update.
  2. Run this PUT request to update a specific employee record.
curl --location --request PUT 'https://dummy.restapiexample.com/api/v1/update/<id>/' \
--header 'Content-Type: application/json' \
--data '{
  "employee_name": "Jhon Moore",
  "employee_salary": "345",
  "employee_age": "23",
  "profile_image": ""
}
'

💡 Replace <id> for the ID of your employee in your database.

Update the values as explained in this table:

VariableData TypeDescription
employee_nameStringThe name and last name of your employee
employee_salaryStringThe salary for your employee
employee_ageStringThe age of your employee
profile_imageStringThe URL to fetch the profile image of your employee

💡 Add any other variable you created for your database.

  1. You'll receive a response similar to this:
{
    "status": "success",
    "data": {
      "employee_name": "Jhon Moore",
      "employee_salary": "345",
      "employee_age": "23",
      "profile_image": "",
      "id": 9139
    },
    "message": "Successfully! Record has been updated."
}

Done. Your record has been updated with the new data.