[2️] My Staff API
Create a new record

How to create a new record

You can create and add new records to your database via My Staff API.


Creating a new record

  1. Run this POST request to create a new employee record, including name, salary, age, and profile image.
curl --location 'https://dummy.restapiexample.com/api/v1/create' \
--header 'Content-Type: application/json' \
--data '{
  "employee_name": "Jhon Moore",
  "employee_salary": "345",
  "employee_age": "23",
  "profile_image": ""
}
'

Replace 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
  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 added."
}

Done! Your new record has been created successfully.


Customizing the variables

You can add as many variables as required in your request.

This example includes location and the team, besides the default variables. In this case, the request body looks as follows:

curl --location 'https://dummy.restapiexample.com/api/v1/create' \
--header 'Content-Type: application/json' \
--data '{
  "employee_name": "Jhon Moore",
  "employee_salary": "345",
  "employee_age": "23",
  "profile_image": "",
  "location": "Boston",
  "team": "Marketing"
}
'