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