Shifts

  • Create a new shift

    POST /api/1/shifts.json
    Formats
    json jsonp

    Creates a new shift. Requires a valid shift object to be posted.

    Errors
    • 401 Unauthorized
    • 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.

      • uuid

        A UUID to identify the shift. If null, one will be generated

      • start

        Start time of the project. Format as a RFC3339 time string in UTC

      • stop

        Stop time of the project. If omitted, the shift is considered to be running. Format as a RFC3339 time string in UTC

      • notes

        Notes associated with the shift

      • time_zone

        The time zone that the shift occured in. Must be a valid timezone string from the tz database.

      • time_zone_offset

        time_zone_offset

      • billable

        Indicates whether the shift is billable or not. If omitted, true is assumed

      • project_uuid

        The UUID of the project begin clocked against. The project must be accessible by the authenticated user.

      • 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

      • tag_list

        Array of tags

      • local_start_as_string

        A human readable time, that will attempted to be parsed. Will overwrite start if set.

      • local_stop_as_string

        A human readable time, that will attempted to be parsed. Will overwrite stop if set.

      • activity_uuid

        The UUID of the activity associated with this shift. Leave blank if there is no activity.

      • external_href

        Populated if the shift was created on an external website. Points at the external resource

    Create a new shift clocked against the specified project

    POST /api/1/projects/:project_uuid/shifts.json
    Formats
    json jsonp

    Creates a new shift. Requires a valid shift object to be posted.

    Errors
    • 401 Unauthorized
    • 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.

      • uuid

        A UUID to identify the shift. If null, one will be generated

      • start

        Start time of the project. Format as a RFC3339 time string in UTC

      • stop

        Stop time of the project. If omitted, the shift is considered to be running. Format as a RFC3339 time string in UTC

      • notes

        Notes associated with the shift

      • time_zone

        The time zone that the shift occured in. Must be a valid timezone string from the tz database.

      • time_zone_offset

        time_zone_offset

      • billable

        Indicates whether the shift is billable or not. If omitted, true is assumed

      • project_uuid

        The UUID of the project begin clocked against. The project must be accessible by the authenticated user.

      • 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

      • tag_list

        Array of tags

      • local_start_as_string

        A human readable time, that will attempted to be parsed. Will overwrite start if set.

      • local_stop_as_string

        A human readable time, that will attempted to be parsed. Will overwrite stop if set.

      • activity_uuid

        The UUID of the activity associated with this shift. Leave blank if there is no activity.

      • external_href

        Populated if the shift was created on an external website. Points at the external resource