Shifts

  • Return all of the user's shifts

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

    Returns an array of shift objects belonging to authenticated user. Can take a URL-encoded, SQL-like query string and order string which can help filter and order the results that will be returned. So the query string:

    start > "2013-08-14T00:00:00Z"

    which lookes like this when URL encoded:

    /api/1/staff.json?where=start>"2013-08-14T00%3A00%3A00"&order=start+asc

    will return all shifts started after Midnight, 14 Aug 2013 ordered by start in ascending order.

    Click here for more information on the API query string.

    Errors
    • 401 Unauthorized
    • 403 Read Denied - if the user is not allowed to read 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
    Example
    GET /api/1/shifts
    200
    {
      "response": [
        {
          "billable": true,
          "notes": "ut debitis id blanditiis distinctio voluptatibus consectetur repellendus omnis aliquid non totam qui sequi porro maxime ea quasi reprehenderit rerum",
          "project_uuid": "15fa15d2-9093-427a-97d6-05a9bf9856af",
          "start": "2013-07-16T05:19:26Z",
          "stop": "2013-07-16T06:19:26Z",
          "time_zone": "Australia/Perth",
          "time_zone_offset": null,
          "user_uuid": "0da708be-1811-4f4e-8a54-1585ce7d2caf",
          "uuid": "4fbb5e00-b38c-4489-b8da-fe8a132a326b",
          "activity_uuid": null,
          "tag_list": []
        },
        {
          "billable": true,
          "notes": "amet sed omnis sint incidunt eius optio aut ullam quae quo suscipit recusandae cum ut aut animi inventore at placeat",
          "project_uuid": "15fa15d2-9093-427a-97d6-05a9bf9856af",
          "start": "2013-08-15T05:19:26Z",
          "stop": "2013-08-15T06:19:26Z",
          "time_zone": "Australia/Perth",
          "time_zone_offset": null,
          "user_uuid": "0da708be-1811-4f4e-8a54-1585ce7d2caf",
          "uuid": "8acc6191-3d0a-4c86-80e8-f99bfc375fbf",
          "activity_uuid": null,
          "tag_list": []
        }
      ],
      "count": 2
    }
    Parameters
    • where

      An SQL-like query string which can filter the results that will be returned

    • order

      An SQL-like order string, that sets the order of the returned objects

    Return all of the user's shifts clocked against a specific project

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

    Returns an array of shift objects belonging to authenticated user. Can take a URL-encoded, SQL-like query string and order string which can help filter and order the results that will be returned. So the query string:

    start > "2013-08-14T00:00:00Z"

    which lookes like this when URL encoded:

    /api/1/staff.json?where=start>"2013-08-14T00%3A00%3A00"&order=start+asc

    will return all shifts started after Midnight, 14 Aug 2013 ordered by start in ascending order.

    Click here for more information on the API query string.

    Errors
    • 401 Unauthorized
    • 403 Read Denied - if the user is not allowed to read 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
    Example
    GET /api/1/shifts
    200
    {
      "response": [
        {
          "billable": true,
          "notes": "ut debitis id blanditiis distinctio voluptatibus consectetur repellendus omnis aliquid non totam qui sequi porro maxime ea quasi reprehenderit rerum",
          "project_uuid": "15fa15d2-9093-427a-97d6-05a9bf9856af",
          "start": "2013-07-16T05:19:26Z",
          "stop": "2013-07-16T06:19:26Z",
          "time_zone": "Australia/Perth",
          "time_zone_offset": null,
          "user_uuid": "0da708be-1811-4f4e-8a54-1585ce7d2caf",
          "uuid": "4fbb5e00-b38c-4489-b8da-fe8a132a326b",
          "activity_uuid": null,
          "tag_list": []
        },
        {
          "billable": true,
          "notes": "amet sed omnis sint incidunt eius optio aut ullam quae quo suscipit recusandae cum ut aut animi inventore at placeat",
          "project_uuid": "15fa15d2-9093-427a-97d6-05a9bf9856af",
          "start": "2013-08-15T05:19:26Z",
          "stop": "2013-08-15T06:19:26Z",
          "time_zone": "Australia/Perth",
          "time_zone_offset": null,
          "user_uuid": "0da708be-1811-4f4e-8a54-1585ce7d2caf",
          "uuid": "8acc6191-3d0a-4c86-80e8-f99bfc375fbf",
          "activity_uuid": null,
          "tag_list": []
        }
      ],
      "count": 2
    }
    Parameters
    • where

      An SQL-like query string which can filter the results that will be returned

    • order

      An SQL-like order string, that sets the order of the returned objects

  • Return a single shift

    GET /api/1/shifts/:uuid.json
    Formats
    json jsonp

    Returns a single shift object belonging the authenticated user.

    Errors
    • 401 Unauthorized
    • 403 Read Denied - if the user is not allowed to read this shift
    • 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
    Example
    GET /api/1/shifts/c207e502-a0df-4671-b17b-a00cb69c8811
    200
    {
      "response": {
        "billable": true,
        "notes": "ut consectetur est dolor et atque corrupti voluptas eos odit quam ex non consequuntur alias voluptas adipisci repellendus cupiditate est",
        "project_uuid": "c1ee5629-36b6-44e5-ad97-4e99c960035b",
        "start": "2013-07-16T05:19:27Z",
        "stop": "2013-07-16T06:19:27Z",
        "time_zone": "Australia/Perth",
        "time_zone_offset": null,
        "user_uuid": "8b9a9757-9d38-4e1c-8b4e-e3ce96893d4b",
        "uuid": "c207e502-a0df-4671-b17b-a00cb69c8811",
        "activity_uuid": null,
        "tag_list": []
      }
    }

    Return a single shift clocked against a specific project

    GET /api/1/projects/:project_uuid/shifts/:uuid.json
    Formats
    json jsonp

    Returns a single shift object belonging the authenticated user.

    Errors
    • 401 Unauthorized
    • 403 Read Denied - if the user is not allowed to read this shift
    • 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
    Example
    GET /api/1/shifts/c207e502-a0df-4671-b17b-a00cb69c8811
    200
    {
      "response": {
        "billable": true,
        "notes": "ut consectetur est dolor et atque corrupti voluptas eos odit quam ex non consequuntur alias voluptas adipisci repellendus cupiditate est",
        "project_uuid": "c1ee5629-36b6-44e5-ad97-4e99c960035b",
        "start": "2013-07-16T05:19:27Z",
        "stop": "2013-07-16T06:19:27Z",
        "time_zone": "Australia/Perth",
        "time_zone_offset": null,
        "user_uuid": "8b9a9757-9d38-4e1c-8b4e-e3ce96893d4b",
        "uuid": "c207e502-a0df-4671-b17b-a00cb69c8811",
        "activity_uuid": null,
        "tag_list": []
      }
    }
  • 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
    • 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.

      • 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
    • 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.

      • 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

  • Update a shift

    PUT /api/1/shifts/:uuid.json
    Formats
    json jsonp

    Update an existing shift. Requires a valid shift object to be posted. Missing attributes from the object will be merged with the existing shift.

    Errors
    • 401 Unauthorized
    • 403 Read Denied - if the user is not allowed to update this shift
    • 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
    PUT /api/1/shifts/2a3feeb3-c56d-48e2-8287-2bfac0ede323
    {
      "shift": {
        "start": "2013-08-16T13:19:27+08:00",
        "stop": "2013-08-16T14:19:27+08:00",
        "notes": "repellat provident dolores amet tenetur",
        "time_zone": "Australia/Perth",
        "project_uuid": "1a28b403-3915-446a-bb70-f9d3f24a2ee7"
      }
    }
    200
    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

    Update a shift against the specified project

    PUT /api/1/projects/:project_uuid/shifts/:uuid.json
    Formats
    json jsonp

    Update an existing shift. Requires a valid shift object to be posted. Missing attributes from the object will be merged with the existing shift.

    Errors
    • 401 Unauthorized
    • 403 Read Denied - if the user is not allowed to update this shift
    • 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
    PUT /api/1/shifts/2a3feeb3-c56d-48e2-8287-2bfac0ede323
    {
      "shift": {
        "start": "2013-08-16T13:19:27+08:00",
        "stop": "2013-08-16T14:19:27+08:00",
        "notes": "repellat provident dolores amet tenetur",
        "time_zone": "Australia/Perth",
        "project_uuid": "1a28b403-3915-446a-bb70-f9d3f24a2ee7"
      }
    }
    200
    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

  • Delete a shift

    DELETE /api/1/shifts/:uuid.json
    Formats
    json jsonp

    Deletes the shift associated with the supplied uuid

    Errors
    • 401 Unauthorized
    • 403 Read Denied - if the user is not allowed to delete this shift
    • 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
    Example
    DELETE /api/1/shifts/2429b3e3-3ce6-42af-af50-800186b6cfdf
    200

    Delete a shift against the specified project

    DELETE /api/1/projects/:project_uuid/shifts/:uuid.json
    Formats
    json jsonp

    Deletes the shift associated with the supplied uuid

    Errors
    • 401 Unauthorized
    • 403 Read Denied - if the user is not allowed to delete this shift
    • 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
    Example
    DELETE /api/1/shifts/2429b3e3-3ce6-42af-af50-800186b6cfdf
    200