4. Updating Employee via API

Update Employee Details

To update an existing Employee with new details you are going to send a PUT request to the Go2Clock server.

The web address format you are going to send in is as follows...

Base URL format: app.go2clock.com/api/employee_update/


Header Authentication Parameter: APIKEY=xxxxxxxxxxx  This must match API key value in Go2Clock instance. 

Body: Is made up of JSON key pair values in the format of application/x-www-form-urlencoded,

For example... field1=value1&field2=value2&field3=value3

You must send the correct 'userid' key for the update to work.

You don't need to send all the params, just the key pairs you require to be updated, the keys available are:

'name', 'mobilenumber', 'deptname', 'tradename', 'payrollno', 'photo', 'sageref', 'sagerefot', 'sagerefdt', 'sagerefsick', 'payrate', 'payrateot', 'payratedt', 'payratecustom', 'hourlypay', 'email', 'max_hours_week', 'max_hours_day', 'peoplehr_employeeid', 'sagehr_employeeno', 'holiday_total_allowed', 'role_manager', 'role_supervisor', 'role_first_aider', 'role_safety_manager', 'role_employee', 'role_apprentice', 'role_agency_staff', 'role_subcontractor', 'role_fire_warden', 'start_date', 'termination_date', 'termination_reason', 'date_of_birth', 'home_phone', 'home_address', 'emergency_contacts'

Example cURL command:

curl --location --request PUT 'https://dev.go2clock.com/api/employee_update' \
--header 'APIKEY: xxxxxxxxxxx' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'userid=999000' \
--data-urlencode 'name=John Doe' \  
--data-urlencode 'mobilenumber=1234567890' \
--data-urlencode 'email=john.doe@example.com'

Server Responses for Employee Details

The server will respond, below examples...

{"status":"success","message":"User updated successfully"}

{"status":"failure","message":"User not found"}
Did this answer your question? Thanks for the feedback There was a problem submitting your feedback. Please try again later.

Still need help? Contact Us Contact Us