Release Notes

July 22, 2024

The July 22, 2024 Karbon API release includes updates to the Timesheets API to show billed status, and new endpoints to List and Download Files.

Billed status on Time Entries

GET Timesheets

Endpoints:

  • JSONCopied!
    https://api.karbonhq.com/v3/Timesheets
  • JSONCopied!
    https://api.karbonhq.com/v3/Timesheets/{TimeSheetKey}

When used with the

JSONCopied!
GET
method and the query string parameter
JSONCopied!
$expand=TimeEntries
, these endpoints will now include an additional
JSONCopied!
BilledStatus
property in the collection of
JSONCopied!
TimeEntries
returned. This status can be used to determine if the time entry has been billed, returning one of the following
JSONCopied!
Unbilled
,
JSONCopied!
Draft
,
JSONCopied!
InterimBilled
or
JSONCopied!
Billed
.

Refer to the Timesheets API documentation for a full example of the response from this endpoint.

Example use case

You want to build a report of work for each of your clients, broken down by billed or unbilled time.

You'll need:

  • A list of
    JSONCopied!
    WorkItem
    keys you want the time entries for - you can use the
    JSONCopied!
    WorkItems
    endpoint to get this
  • A list of
    JSONCopied!
    TimeSheets
    related to those
    JSONCopied!
    WorkItems
    - you can use
    JSONCopied!
    WorkItemKey
    filtering on the
    JSONCopied!
    TimeSheets
    endpoint to get this , e.g.
    JSONCopied!
    $filter=WorkItemKeys/any(x: x in ('3bfwkMBgL8rz'))

Make a call to

JSONCopied!
https://api.karbonhq.com/v3/TimeSheets/2zgGcqrC9JcD?$expand=TimeEntries
. This will return a response containing a time sheet and it's corresponding time entries. Each item in the array of TimeEntries include a billed status, for example:

JSONCopied!
{ "TimesheetKey": "2zgGcqrC9JcD", "StartDate": "2023-02-20T00:00:00Z", "EndDate": "2023-02-26T00:00:00Z", "UserKey": "3bxT8HkHxHCG", "Status": "Submitted", "WorkItemKeys": [ "3bfwkMBgL8rz" ], "TimeEntries": [ { "TimeEntryKey": "2hYhcb9VDXtB-3bfwkMBgL8rz-3bxT8HkHxHCG-4cDMPvqnsPJj-2vlSLxVWmxCY-2zgGcqrC9JcD-4", "EntityKey": "3bfwkMBgL8rz", "WorkItemKey": "3bfwkMBgL8rz", "ClientKey": "3dVWVdTQx2cs", "ClientType": "Organization", "RoleName": "Admin", "TaskTypeName": "Admin", "Minutes": 384, "HourlyRate": 86.0000, "Descriptions": [], "BilledStatus": "Billed" } ] }

List and download files

GET File List and GET File

Endpoints:

  • JSONCopied!
    https://api.karbonhq.com/v3/FileList/{EntityType}?EntityKey={Key}
  • JSONCopied!
    https://api.karbonhq.com/v3/Files?token={token}

These new endpoints allow the listing and downloading of files associated with Work, Contacts and Organizations in Karbon.

Files retrievable with the FileList endpoint are those shown on:

  • a WorkItem (under the Documents tab), or
  • a Contact or Organization (under the Details tab)

Refer to the Files API documentation for a full example of the response from this endpoint.

Example use case

You want to automate the downloading a number of files associated with WorkItems in Karbon for archiving in another system.

To retrieve a list of Files associated with the

JSONCopied!
WorkItem
key
JSONCopied!
3bXVhdMHgc9P
, make a call to
JSONCopied!
https://api.karbonhq.com/v3/FileList/WorkItem?EntityKey=3bXVhdMHgc9P
. This will return a reponse that includes an array of
JSONCopied!
Attachments
, each with details of each associated File, e.g.:

JSONCopied!
{ "@odata.context": "https://api-dev.karbonhq.com/v3/$metadata#FileList/$entity", "EntityKey": "3bXVhdMHgc9P", "EntityType": "WorkItem", "Attachments": [ { "FileContextKey": "S8bsBjvCRJ3", "FileName": "image.jpeg", "FileSize": 7316, "MimeType": "image/jpeg", "DownloadUrl": "/V3/Files?token=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJGaWxlQ29udGV4dFBlcm1hS2V5IjoiUzhic0JqdkNSSjMiLCJpYXQiOjE3MjE1NTUzNjIuMCwiZXhwIjoxNzIxNTU2MjYyLjB9.AtYCQLz_uik7r3nAjwPR-lfJTh6Kf6Dz_9fhWvZVD8Q", "DateCreated": "2024-07-18T23:44:26Z" } ] }

To start the file download of

JSONCopied!
image.jpeg
make a request to the Files endpoint using the token from the
JSONCopied!
FileList
endpoint response, e.g.
JSONCopied!
https://api.karbonhq.com/v3/Files?token=yJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJGaWxlQ29udGV4dFBlcm1hS2V5IjoiUzhic0JqdkNSSjMiLCJpYXQiOjE3MjE1NTUzNjIuMCwiZXhwIjoxNzIxNTU2MjYyLjB9.AtYCQLz_uik7r3nAjwPR-lfJTh6Kf6Dz_9fhWvZVD8Q
. If required, the filename can be found in the response
JSONCopied!
Content-Disposition
header, e.g.
JSONCopied!
inline; filename=image.jpeg
.

Note:

  • Tokens will only work to download a file for 15 minutes from the point they are generated in the FileList request. When the token has expired, you will receive a HTTP
    JSONCopied!
    400
    response from the endpoint.
  • There is some rate limiting applied to downloads, you should attempt no more than a maximum of two concurrent downloads at a time. Exceeding this limit may result in throttling of your API requests.
  • Archived files are shown in the FileList response, but not yet clearly marked as having been archived.