How to work with the REST API implemented as a web service to Vertec
Vertec provides a generic REST API to Vertec as a Web Service with version 6.8.0.17.
It is called REST and can be found in the folder Settings > Extensions > Web Services:

The REST web service is delivered inactive. To activate and use it, the same conditions must be met as for all web services (user rights and API tokens are present).
The call is made via <ServerURL>/api/webservice/REST.
The Vertec objects can be accessed via /objects Objects can be queried (GET), changed (PUT), created (POST) or deleted (DELETE).
The current logged-in user is provided by the following endpoint: /functions/currentuser. For this purpose, the query parameters can optionally be functions, result_members and bi_measures(see the sections Features Return Values and Bi data (measures)).
/objects/1665/objects/Administrator/UserAdmin.The data can also be queried globally. Directly with a member search or also via OCL or SQL.
For this purpose, a query is placed directly on the class, i.e. on /objects/Project. The query starts with a ?, followed by the corresponding query parameters. Several query parameters are & attached.
query_member the member is specified, with query_value the searched value. For each queried member, the combination of query_member and query_value numbered: query_member0 and query_value0, query_member1 and query_value1 etc. Supported operators (as prefix in value): =, <, >, <=, >= for integer, date, datetime, currency.
/objects/Project?query_member0=code&query_value0=com% searches for projects whose code begins with com.query_value the internal ID of the object sought is specified: /objects/Project?query_member0=type&query_value0=179.Via SQL: For SQL, the query parameter sql a global SQL query is sent: /objects/Project?sql=bold_id IN (SELECT project FROM openservice).
ocl an OCL expression is discontinued: /objects?ocl=user->select(active)./objects/1665?ocl=openservices.The result contains an object or a list of objects. By default, each result object returns the internal ID (objid), the String Representation of the object (stringrepresentation), the class name (classname) and whether the object is valid (isvalid) and the reason (hintisvalid), if an object is invalid.
To output additional members, you can use the query parameter result_members a comma-separated list of the corresponding members is given: /objects/1665?result_members=code,description,regarding. The specified members are output for each result object.
About the Parameter functions can call features on objects and can be used for users, projects and phases. The parameter must be given as a query parameter and can be comma-separated comparable to query parameters result_members (see last section Return value).
The example retrieves the standard hours and working time of the logged-in user with the time and date in minutes and the month of January 2026.
/objects?ocl=user&result_members=loginname,abbreviation&functions=getStdHours,getWorkingHours&date_from=2026-01-01&date_till=2026-01-31
Here is an example of a request with functions and result_members:
/objects?ocl=user&result_members=loginname,abbreviation&functions=getStdHours,getWorkingHours&date_from=2026-01-01&date_till=2026-01-31
Result:
[
{
"objid": 506,
"stringrepresentation": "Administrator",
"classname": "User",
"isvalid" true,
"hintisvalid": "",
"loginname": "Administrator",
"abbreviation": "",
"getStdHours": 11220,
"getWorkingHours": 60
},
… // weitere User
]
Listed below are all the values that apply to functions can be called. Many of these values are the same and work in the same way as the Ocl operators for users These are linked accordingly.
| Values for users | Significance |
|---|---|
getStdHours |
Standard hours in minutes |
getWorkingHours |
Working time in minutes |
getOvertimeCarryover |
Overtime balance in minutes by date until yesterday(-1), except on end date a bring forward is entered, then this bring forward is output. |
getOvertimeCarryoverDate |
Date of the last overtime report before the end date |
getOvertimeBalance |
Overtime balance in minutes by end date |
getVacationCredit |
Holiday credit in minutes by time (from, to) |
getVacationTaken |
Vacation reference in minutes by time (from, to) |
getVacationCarryover |
Vacation balance in minutes by date until yesterday(-1), except on end date a presentation is brought forwardentered then this presentation is brought forward. |
getVacationCarryoverDate |
Last vacation carryover in minutes before the end date. |
getVacationStart |
Start date of the holiday period |
getVacationEnd |
End date of the holiday period |
getVacationBalance |
Vacation balance in minutes by end date |
getVacationBalanceAccrued |
Accrued vacation balance including holiday credit in minutes |
getSalary |
Salary by time (from, to) |
getOverheads |
Labor costs by time (from, to) |
getAssignedStdHours |
Standard hours in minutes by time indication (from, until) only on the basis of the specifications |
getAssignedStdHoursGroup |
Target standard hours in minutes per time (from, until) only based on user group settings |
getStdHoursOnlyGroupAbs |
Standard hours in minutes per time indication (from, to) of the user group including absences |
getEmploymentLevel |
user’s employment level by end date |
getAbsenceTimeOff |
Absence with type indication (code) by time indication (from, until) |
getStdHoursGroup |
Standard hours in minutes per time indication (from, to) of the user group in minutes including group absences |
isBlockedDate |
Returns True/False depending on whether end date is locked on service and expense. |
enteringprojects |
List of projects for which the user may entered services and expenses |
currentAbsences |
List of absences by end date |
getTrackingUsers |
List of users who are allowed to enter services, expenses and expenses. |
| Values for projects | Significance |
|---|---|
enteringphases |
List of project phases on which the user may entered services and expenses. |
| Values for Phases | Significance |
|---|---|
enteringservicetypes |
List of activity types on services for phases that the user is allowed to time track for service recording. |
enteringexpensetypes |
List of phase expense types that the user is allowed to use for expense recording. |
The API can directly provide BI measures for an object.
The parameters are
bi_measures=MinutesExt,MinutesInt,...(internal BI names) bi_date_from=2026-02-01bi_date_till=2026-02-28bi_currency=CHF (Currency code)projection_dimension=Project(e.g. a second dimension like customer & phase)A PUT call adjusts an existing Vertec object. The fields to be changed are passed in the JSON body. The object ID comes from the URL and the body contains the new values for the desired members.
/objects/Administrator/UserAdmin or /objects/1665 {
"abbreviation": "AD",
"level": 500,
}
For each field, the API checks whether it is a valid, persistent field of the class.
Data types are validated and converted (e.g. date in ISO format, booleans, integers, currencies).
For Associations:
On success, as with a GET query, a result containing the updated object is returned.
a POST call creates a new Vertec object. The class of the object is defined via the URL and the values of the fields are passed in the JSON body. Unlike PUT, this is not about updating an existing object, but about creating a new one.
/objects/Project creates a new projectThe JSON body looks like PUT and writes the appropriate members to the newly created object. If an error occurs (e.g. invalid value or missing right), the newly created object is deleted and an error message is returned.
If successful, the response corresponds to the output of a GET call for the newly created object.
a DELETE call permanently deletes an existing Vertec object. The instance to be deleted is deleted via the objid or the entryID identified in the URL.
/objects/1665 or /objects/Administrator/UserAdminThe specified object is searched for and then deleted.
If rights are missing, HTTP status is 403 Forbidden returned and the HTTP status on other errors 400 Bad Request.
On success, no object is returned as a JSON response, but only a corresponding HTTP status is returned.
The API can also save files (e.g. Pdf or images) to the following Vertec objects. The binary data of the file are transmitted Base64-encoded in the JSON body of a PUT or POST call.
- Activities
– Expense expenses
Accounts payable
In the JSON body of a PUT or POST call, the corresponding document field is filled with a Base64-encoded string. The API decodes this Base64-encoded string and saves the file internally in its own document object.
Special case for activity: For activities, the field activity additionally documentfullname required. This field contains the file name including the file extension so that Vertec knows the name of the stored document.
Example: Document attached to activity attachments
/objects/Activity/12345 {
"document": BASE64DATEN
"documentfullname": "Besuchsbericht.pdf"
}
In this example, the activity with the objid 12345 saves a document with the file name visit report.pdf. The API internally calls the appropriate document function of the activity class and creates a DocumentData object with the passed binary data.
Example: Attach a document to an invoice
/objects/Expenses/9876 {
"document": BASE64DATEN
}
Here a document is saved for the invoice with the internal ID 9876 by using the field document with the Base64-encoded content.
The web service class VertecREST has a method onrequest(self), which is called on each WebRequest. In the base implementation, this method has no feature. You can override this method in a derived class to perform a defined feature, such as logging, for each request. Then swap the class reference in the Web service (vtcrest.VertecREST) against your new class reference. Below is an example of onrequest(self) Implementation:
The script:
from vtcrest import VertecREST
class REST(VertecREST):
def onrequest(self):
method = self.http_method
path = "/".join(self.path_parameters)
query = self.querystring
self.log("Received request: {} {}?{}".format(method, path, query))
The REST web service entry:

The API typically responds with the following error codes:
400 Bad Request
This status code is used for all technical and technical errors caused by incorrect entries or invalid requests. Typical causes are:
403 Forbidden
This status code signals missing user rights for the requested operation. Common causes are:
The error messages usually include:
For correct requests, HTTP is always used 200 OK returned (also with DELETE).
The definitions necessary for using the REST API are implemented in the Vertec python module “vtcrest”.