TMetric REST API
 3.2.1 
OAS 3.0

This is the latest version of the TMetric API documentation. Though, it does not cover all the functionality. Use the TMetric REST API to create calls to get the data you need to integrate with TMetric.

See API v2 specification here

Authentication

You must authenticate all requests to the TMetric REST API, which uses bearer authentication.

Bearer authentication (also called token authentication) is an HTTP authentication scheme that involves security tokens called bearer tokens. The name “Bearer authentication” can be understood as “give access to the bearer of this token.” The bearer token is a cryptic string, usually generated by the server in response to a login request.

The client must send this token in the Authorization header when making requests to protected resources:

Authorization: Bearer <token>

Where <token> is your personal access token, generated by TMetric authorization server. You can get a token from your profile page inside the TMetric web app.

How to get an API token

  1. Click your name in the left bottom corner.
  2. Select My Profile in the drop-down list.
  3. On the My Profile page, click the Get new API token link.
  4. Copy the newly created token and use it to make API requests.

Note: An API token will be valid for 1 year. If you generate a new token, the previous one becomes invalid.

Errors

For API responses, TMetric uses HTTP status codes, which indicate whether a specific HTTP request has been executed successfully or not. Status codes, which start with 2, indicate success. Codes starting with 4 mean client-side errors (e.g., incorrect syntax, authentication has failed, etc.). Codes that begin with 5 indicate server-side errors (occur rarely).

Status codeMeaning
400 Bad RequestThe request could not be understood by the server. Incoming parameters might not be valid.
401 UnauthorizedThe supplied credentials, if any, are not sufficient to access the resource.
404 Not foundThe requested resource is not found.
403 ForbiddenThe user on whose behalf the request is being made is denied access to the resource.
429 Too Many RequestsToo many requests have been made in a short period of time (Throttling).
500, 502, 503, 504 - Server ErrorsSomething went wrong on TMetric's end. (These are rare.)

Account ID and User ID

Most of API requests require {accountId} and {userId} parameters.

  • {accountId} is an identifier of a TMetric workspace
  • {userId} is a TMetric user identifier.

The best way to get current user's ID and the list of available workspaces is to issue an HTTP GET request to the User API endpoint.

How to get parameter values from UI

If you don't want to send an extra request, you can get {accountId} and {userId} from the application UI.

To get {accountId} value:

  1. Open the Time page in the TMetric web app
  2. Copy the number from the browser's address line.
    • The only number if the {accountId} parameter value you need.

To get {userId} value:

  1. Open the Project Summary report in the TMetric web app.
  2. Select a user in the dropdown Team filter (don't select the dynamic 'Me' parameter).
  3. Apply the filter. You will get the following string in the browser's address line.
https://app.tmetric.com/#/reports/2345/projects?range=thismonth&user=7882
  1. Copy the user parameter value from the address line.
Servers

User

Endpoints to work with user

Members

Endpoints to work with workspace members

Time Balance

Endpoints to work with time balance

Time Entries

Endpoints to work with time entries

Tasks

Endpoints to work with tasks

Schedule

Endpoints to work with schedule

Time Off

Endpoints to work with time off

Reports

Endpoints to work with Reports

Timesheets

Endpoints to work with timesheets Experimental

Notifications

Endpoints to work with notifications settings

Projects

Clients

Teams