Shifts
-
Create a new shift
POST /api/1/shifts.jsonFormats
json jsonpCreates a new shift. Requires a valid shift object to be posted.
Errors
- 401 Unauthorized
- 403 Read Denied - if the user is not allowed to create shifts
- 404 Record Not Found - returned if the project with the specified UUID is not found
- 404 Record Not Found - returned if the shift with the specified UUID is not found
- 422 Invalid Record - if the shift fails validation. An error message will be returned, declaring the error.
Example
POST /api/1/shifts { "shift": { "start": "2013-08-16T13:19:26+08:00", "stop": "2013-08-16T14:19:26+08:00", "notes": "est qui quia neque maiores", "time_zone": "Australia/Perth", "project_uuid": "54020640-b1fe-4a87-a9f2-9859dd4fc319" } } 200 { "response": { "billable": true, "notes": "est qui quia neque maiores", "project_uuid": "54020640-b1fe-4a87-a9f2-9859dd4fc319", "start": "2013-08-16T05:19:26Z", "stop": "2013-08-16T06:19:26Z", "time_zone": "Australia/Perth", "time_zone_offset": null, "user_uuid": "9f85697d-4f2b-435c-81c9-4257ee689936", "uuid": "9406d9e6-02d9-4436-bbf6-7e46f60bffeb", "activity_uuid": null, "tag_list": [] } }Parameters
-
shift
A shift member JSON object.
Required-
uuid
A UUID to identify the shift. If null, one will be generated
Optional Format: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx -
start
Start time of the project. Format as a RFC3339 time string in UTC
Required Must be String -
stop
Stop time of the project. If omitted, the shift is considered to be running. Format as a RFC3339 time string in UTC
Optional Must be String -
notes
Notes associated with the shift
Optional Must be String -
time_zone
The time zone that the shift occured in. Must be a valid timezone string from the tz database.
Required Must be String -
time_zone_offset
time_zone_offset
Optional Must be String -
billable
Indicates whether the shift is billable or not. If omitted, true is assumed
Optional Must be one of: true, false. -
project_uuid
The UUID of the project begin clocked against. The project must be accessible by the authenticated user.
Required Must be String -
user_uuid
The UUID of the user that clocked the shift. The user must be a staff member of the authenticated user. If omitted, the authenticated user is used
Optional Must be String -
tag_list
Array of tags
Optional Must be Array -
local_start_as_string
A human readable time, that will attempted to be parsed. Will overwrite start if set.
Optional Must be String -
local_stop_as_string
A human readable time, that will attempted to be parsed. Will overwrite stop if set.
Optional Must be String -
activity_uuid
The UUID of the activity associated with this shift. Leave blank if there is no activity.
Optional Format: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx -
external_href
Populated if the shift was created on an external website. Points at the external resource
Optional Must be String
-
Create a new shift clocked against the specified project
POST /api/1/projects/:project_uuid/shifts.jsonFormats
json jsonpCreates a new shift. Requires a valid shift object to be posted.
Errors
- 401 Unauthorized
- 403 Read Denied - if the user is not allowed to create shifts
- 404 Record Not Found - returned if the project with the specified UUID is not found
- 404 Record Not Found - returned if the shift with the specified UUID is not found
- 422 Invalid Record - if the shift fails validation. An error message will be returned, declaring the error.
Example
POST /api/1/shifts { "shift": { "start": "2013-08-16T13:19:26+08:00", "stop": "2013-08-16T14:19:26+08:00", "notes": "est qui quia neque maiores", "time_zone": "Australia/Perth", "project_uuid": "54020640-b1fe-4a87-a9f2-9859dd4fc319" } } 200 { "response": { "billable": true, "notes": "est qui quia neque maiores", "project_uuid": "54020640-b1fe-4a87-a9f2-9859dd4fc319", "start": "2013-08-16T05:19:26Z", "stop": "2013-08-16T06:19:26Z", "time_zone": "Australia/Perth", "time_zone_offset": null, "user_uuid": "9f85697d-4f2b-435c-81c9-4257ee689936", "uuid": "9406d9e6-02d9-4436-bbf6-7e46f60bffeb", "activity_uuid": null, "tag_list": [] } }Parameters
-
shift
A shift member JSON object.
Required-
uuid
A UUID to identify the shift. If null, one will be generated
Optional Format: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx -
start
Start time of the project. Format as a RFC3339 time string in UTC
Required Must be String -
stop
Stop time of the project. If omitted, the shift is considered to be running. Format as a RFC3339 time string in UTC
Optional Must be String -
notes
Notes associated with the shift
Optional Must be String -
time_zone
The time zone that the shift occured in. Must be a valid timezone string from the tz database.
Required Must be String -
time_zone_offset
time_zone_offset
Optional Must be String -
billable
Indicates whether the shift is billable or not. If omitted, true is assumed
Optional Must be one of: true, false. -
project_uuid
The UUID of the project begin clocked against. The project must be accessible by the authenticated user.
Required Must be String -
user_uuid
The UUID of the user that clocked the shift. The user must be a staff member of the authenticated user. If omitted, the authenticated user is used
Optional Must be String -
tag_list
Array of tags
Optional Must be Array -
local_start_as_string
A human readable time, that will attempted to be parsed. Will overwrite start if set.
Optional Must be String -
local_stop_as_string
A human readable time, that will attempted to be parsed. Will overwrite stop if set.
Optional Must be String -
activity_uuid
The UUID of the activity associated with this shift. Leave blank if there is no activity.
Optional Format: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx -
external_href
Populated if the shift was created on an external website. Points at the external resource
Optional Must be String
-