Get the List of Time Entries

GET /time-entries/ — Use this method to retrieve the list of time entries.

Parameters

Path parameters

None

Query string parameter

Path parameter

Required / Optional

Description

Type

expand

Optional

A comma-separated list of attributes available for expansion. The comma-separated list may include spaces (or %20 in the URL encoded string).

Note:

The expand value must contain only attributes referencing a supported object type. If return_object is set to any value other than 0 (zero), and the comma-separated list includes at least one attribute that is not available for expansion, the request fails — an error is returned and the object is not added or updated. For more information about attributes available for expansion and supported object types, see Available Expansions and Supported Object Types.

string

fields

Optional

A comma-separated list of attributes to include in the response. If not specified, the response includes all attributes for each time entry returned. See Response Data Modifiers.

string

filterSetId

Optional

The internal ID of the filter set to be applied.

  • When specified, the response includes only data that is available when the specified filter set is active in OpenAir. The filter set with the specified internal ID must exist and must be associated with the user who authorized the application as per the access token.

  • Otherwise and by default, the primary filter set associated with the user who authorized the application is applied.

integer

limit

Optional

A limit on the length of the page. See Pagination.

integer

offset

Optional

A cursor for use in pagination. See Pagination.

integer

orderBy

Optional

The attribute to sort the list by. Use a plus sign (+) or minus sign (-) before the attribute name to specify an ascending (+) or descending (-) sort order. An ascending sort order is used if the sort order is not specified. See Sorting.

string

q

Optional

A URL-encoded query expression used to filter the resource collection and return the objects matching the specified search criteria. See Filtering.

string

Response definitions

A successful request returns a JSON object with the following properties:

Property

Description

data

An array containing the time entries requested. See Returned Data.

included

An array of expanded objects, if the expand parameter was set in the request.

See Referenced Objects and Expansion.

meta

An object containing response metadata. The meta object may include information about:

  • The page returned, the number of objects per page, the total number of pages and objects in the list, and links to other pages. See Pagination.

  • Objects referenced by internal ID in the data array (object type and internal ID). See Referenced Objects and Expansion.

message

A string containing a brief message about the status of your request — e.g. “Success”.

A failed request returns a JSON object with the following properties:

Property

Description

message

A string containing a brief message about the status of your request.

Sample request

            GET /rest/v1/time-entries/ HTTP/1.1
Host: company-id.app.openair.com
Authorization: Bearer <OAuth2_access_token> 

          

In the example, <OAuth2_access_token> is the OAuth 2.0 access token obtained for the client application connecting to OpenAir. See Authentication.

Sample response

            {
   "data": [
      {
         ...
      },
         {
         ...
      },
         ...
   ],
   "message": "success",
   "meta": {
       "rowsPerPage": 100,
       "totalPages": 14,
        "relationships": [
            {
                ...
            },
            {
                ...
            },
         ...
        ],
       "totalRows": 1386,
       "links": [
            {
                "rel": "first",
                "href": "https://company-id.app.openair.com/rest/v1/time-entries"
            },
            {
                "rel": "self",
                "href": "https://company-id.app.openair.com/rest/v1/time-entries"
            },
            {
                "rel": "next",
                "href": "https://company-id.app.openair.com/rest/v1/time-entries?limit=100&offset=100"
            },
            {
                "rel": "last",
                "href": "https://company-id.app.openair.com/rest/v1/time-entries?limit=100&offset=1300"
            }
       ]
   }
}