9. Downloading and Uploading Schedules via API
Creating and Retrieving Employee Rota Schedules
These API functions allow external systems to create rota shift schedule records for employees and retrieve rota schedules from the Go2Clock system.
Create / Update Employee Rota
POST (Create Employee Shift Schedule)
To create or update rota entries for an employee you must send a POST request to the Go2Clock server.
This endpoint supports multi-day shift creation by specifying the number of days.
If a rota record already exists for the same employee and date, it will automatically be replaced with the new shift.
The web address format you are going to send in is as follows...
Base URL format: https://app.go2clock.com/api/employee_rota
Header Authentication Parameter: APIKEY=xxxxxxxxxxx This must match API key value in Go2Clock instance.
POST Parameters
| userid | Required: Yes | Employee ID number. Must be numeric. Must exist |
| start_date | Required: Yes | The first date of the rota entry (format: YYYY-MM-DD). |
| shift_name | Required: Yes | The name of the shift as defined in the company shift settings. |
| nodays | Required: Optional | Number of consecutive days the shift should be applied. Default = 1. |
Example cURL command:
curl --location --request POST 'https://app.go2clock.com/api/employee_rota' \ --header 'APIKEY: xxxxxxxxxxx' \ --header 'Content-Type: application/x-www-form-urlencoded' \ --data-urlencode 'userid=10002' \ --data-urlencode 'start_date=2026-03-01' \ --data-urlencode 'shift_name=Day Shift' \ --data-urlencode 'nodays=5'
Server Responses
The server will respond with an array of key values for each user, below is an example...
{
"status": true,
"message": "5 rota record(s) created successfully.",
"from": "2026-03-01",
"to": "2026-03-05"
}
Validation Rules
The API will return an error if:
- userid is not numeric
- start_date is not in YYYY-MM-DD format
- shift_name does not exist in the company’s shift configuration
- required parameters are missing
{
"status": false,
"message": "Invalid date format. Expected YYYY-MM-DD."
}
Important Notes
- shift_name must match exactly with a shift defined in the Go2Clock Shift Settings.
- Multi-day creation automatically creates one record per day.
- Existing rota entries for the same employee and date will be overwritten.
---------------------------------------------------------------------------------------------------------------------------------------------------------------
Retrieve Employee Rota
GET (Retrieve Employee Shift Schedule)
This API endpoint allows external systems to retrieve rota records for employees within a specified date range.
Base URL format: https://app.go2clock.com/api/employee_rota
Header Authentication Parameter: APIKEY=xxxxxxxxxxx This must match API key value in Go2Clock instance.
Note: This is a GET request and NOT a POST request!
GET Parameters
| userid | Required: Yes | Employee ID number. Must be numeric. |
| start_date | Required: Yes | Start date of the search range (YYYY-MM-DD). |
| end_date | Required: Yes | End date of the search range (YYYY-MM-DD). |
Example cURL command:
curl --location --request GET 'https://app.go2clock.com/api/employee_rota?userid=10002&start_date=2026-03-01&end_date=2026-03-10' \ --header 'APIKEY: xxxxxxxxxxx'
Server Responses for Clock Credentials
The server will respond with an array of key values for each user, below is an example...
{
"status": true,
"data": [
{
"rota_userid": "10002",
"rota_date": "2026-03-01",
"rota_shift": "Day Shift",
"shift_colour": "#4CAF50",
"calc_hours": "8",
"event_log": "Rota created by API on Fri Mar 6 2026 - 10:30"
},
{
"rota_userid": "10002",
"rota_date": "2026-03-02",
"rota_shift": "Day Shift",
"shift_colour": "#4CAF50",
"calc_hours": "8",
"event_log": "Rota created by API on Fri Mar 6 2026 - 10:30"
}
]
}
If No Records Are Found
{
"status": false,
"message": "No rota records found."
}