TriReg2 Admin API

An OpenAPI specification for time registrations to be used by an administrator
More information: https://github.com/trifork/trireg2-api
Contact Info: example@example.com
Version: 0.2.0
BasePath:
MIT License
https://github.com/trifork/trireg2-api/LICENSE.md

Access

  1. HTTP Basic Authentication

Methods

[ Jump to Models ]

Table of Contents

ExportConfiguration

TagConfiguration

TagTaskMapping

Task

UserGroup

UserGroupRelation

UserPermission

ExportConfiguration

Up
get /config/export
(getExportConfiguration)
Gets the export configurations for the specified export system. This is essentially a key-value mapping of the different settings that can be configured for the export system.

Query parameters

exportSystemId (required)
Query Parameter — The id of the export system to get configurations for. default: null

Return type

ExportConfigurationResponse

Example data

Content-Type: application/json
{
  "settings" : [ {
    "exportSettingValue" : "exportSettingValue",
    "exportSettingKey" : "exportSettingKey",
    "isValid" : true,
    "exportSettingDescription" : "exportSettingDescription"
  }, {
    "exportSettingValue" : "exportSettingValue",
    "exportSettingKey" : "exportSettingKey",
    "isValid" : true,
    "exportSettingDescription" : "exportSettingDescription"
  } ],
  "isValid" : true,
  "exportSystemId" : "exportSystemId"
}

Produces

This API call produces the following media types according to the Accept request header; the media type will be conveyed by the Content-Type response header.

Responses

200

The export configuration for the specified export system. ExportConfigurationResponse

401

JWT is missing or invalid

404

Unable to find the configuration for the parameters (e.g. no configuration exists for the specified id)

Up
post /config/export
(saveExportConfiguration)
Saves one or more export settings for the specified export system. This will only change values for the settings that are included in the request. If a setting is not included, it will not be changed. Saving a setting with an invalid value, e.g. a wrong format, will not cause an error, but the setting will be marked as invalid and the resulting export configuration can't be used.

Consumes

This API call consumes the following media types via the Content-Type request header:

Request body

ExportSettingSaveRequest ExportSettingSaveRequest (required)
Body Parameter

Query parameters

exportSystemId (required)
Query Parameter — The id of the export system to save configurations for. default: null

Return type

ExportConfigurationResponse

Example data

Content-Type: application/json
{
  "settings" : [ {
    "exportSettingValue" : "exportSettingValue",
    "exportSettingKey" : "exportSettingKey",
    "isValid" : true,
    "exportSettingDescription" : "exportSettingDescription"
  }, {
    "exportSettingValue" : "exportSettingValue",
    "exportSettingKey" : "exportSettingKey",
    "isValid" : true,
    "exportSettingDescription" : "exportSettingDescription"
  } ],
  "isValid" : true,
  "exportSystemId" : "exportSystemId"
}

Example data

Content-Type: text/plain
Custom MIME type example not yet supported: text/plain

Produces

This API call produces the following media types according to the Accept request header; the media type will be conveyed by the Content-Type response header.

Responses

200

The tag configuration was successfully created ExportConfigurationResponse

400

Request contains invalid data. The export settings were not saved String

401

JWT is missing or invalid

403

Insufficient permission to invoke endpoint

404

Unable to find the configuration for the parameters (e.g. no configuration exists for the specified id)

TagConfiguration

Up
post /config/tag
(createTagConfiguration)
Creates a new tag configuration

Consumes

This API call consumes the following media types via the Content-Type request header:

Request body

TagConfigurationCreateRequest TagConfigurationCreateRequest (required)
Body Parameter

Return type

DefaultCreateResponse

Example data

Content-Type: application/json
{
  "id" : 12345,
  "status" : "The data was created successfully"
}

Example data

Content-Type: text/plain
Custom MIME type example not yet supported: text/plain

Produces

This API call produces the following media types according to the Accept request header; the media type will be conveyed by the Content-Type response header.

Responses

200

The tag configuration was successfully created DefaultCreateResponse

400

Request contains invalid data. The tag configuration was not created String

401

JWT is missing or invalid

403

Insufficient permission to invoke endpoint

Up
get /config/tag
(getTagConfigurations)
Gets tag configurations based on the provided query parameters

Query parameters

tagConfigurationId (optional)
Query Parameter — The id of the tag configuration to get. If unspecified, all tag configurations are returned default: null format: int64

Return type

array[TagConfigurationResponse]

Example data

Content-Type: application/json
[ {
  "tagConfigurationDescription" : "tagConfigurationDescription",
  "tagConfigurationId" : 0,
  "tagConfigurationName" : "tagConfigurationName"
}, {
  "tagConfigurationDescription" : "tagConfigurationDescription",
  "tagConfigurationId" : 0,
  "tagConfigurationName" : "tagConfigurationName"
} ]

Produces

This API call produces the following media types according to the Accept request header; the media type will be conveyed by the Content-Type response header.

Responses

200

List of tag configurations for the provided query parameters

401

JWT is missing or invalid

404

Unable to find tag configurations for the query parameters (e.g. no tag configuration with specified id exists)

Up
put /config/tag
(updateTagConfiguration)
Updates an existing tag configuration

Consumes

This API call consumes the following media types via the Content-Type request header:

Request body

TagConfigurationUpdateRequest TagConfigurationUpdateRequest (required)
Body Parameter

Query parameters

tagConfigurationId (required)
Query Parameter — The id of the tag configuration to update default: null format: int64

Return type

DefaultUpdateResponse

Example data

Content-Type: application/json
{
  "id" : 12345,
  "status" : "The data was updated successfully"
}

Example data

Content-Type: text/plain
Custom MIME type example not yet supported: text/plain

Produces

This API call produces the following media types according to the Accept request header; the media type will be conveyed by the Content-Type response header.

Responses

200

The tag configuration was successfully updated DefaultUpdateResponse

400

Request contains invalid data. The tag configuration was not updated String

401

JWT is missing or invalid

403

Insufficient permission to invoke endpoint

404

The specified tag configuration was not found String

TagTaskMapping

Up
post /config/task-tag
(createNewTagTaskMapping)
Creates a new relation between a task and a tag configuration

Consumes

This API call consumes the following media types via the Content-Type request header:

Request body

TagTaskMappingCreateRequest TagTaskMappingCreateRequest (required)
Body Parameter

Return type

DefaultCreateResponse

Example data

Content-Type: application/json
{
  "id" : 12345,
  "status" : "The data was created successfully"
}

Example data

Content-Type: text/plain
Custom MIME type example not yet supported: text/plain

Produces

This API call produces the following media types according to the Accept request header; the media type will be conveyed by the Content-Type response header.

Responses

200

TagTask mapping successfully created DefaultCreateResponse

400

Request contains invalid data. The TagTask mapping could not be created String

401

JWT is missing or invalid

403

Insufficient permission to invoke endpoint

Up
get /config/task-tag
(getTagTaskMappings)
Gets all tag configurations that are associated to the provided task

Query parameters

taskId (required)
Query Parameter — The id of the task to get associated tag configurations for default: null format: int64
includeHidden (optional)
Query Parameter — Include tags that are normally hidden and automatically added when registering time on the task default: null

Return type

array[TagTaskConfigurationResponse]

Example data

Content-Type: application/json
[ {
  "tagValueType" : "tagValueType",
  "tagConfigurationId" : 6,
  "tagConfigurationName" : "tagConfigurationName",
  "tagTaskMappingId" : 0,
  "tagDefaultValue" : "tagDefaultValue",
  "taskId" : 1,
  "tagTaskRelation" : "tagTaskRelation",
  "tagDescription" : "tagDescription"
}, {
  "tagValueType" : "tagValueType",
  "tagConfigurationId" : 6,
  "tagConfigurationName" : "tagConfigurationName",
  "tagTaskMappingId" : 0,
  "tagDefaultValue" : "tagDefaultValue",
  "taskId" : 1,
  "tagTaskRelation" : "tagTaskRelation",
  "tagDescription" : "tagDescription"
} ]

Produces

This API call produces the following media types according to the Accept request header; the media type will be conveyed by the Content-Type response header.

Responses

200

List of valid tag configurations for the specified task

401

JWT is missing or invalid

404

Unable to find tag configurations for the specified task (No task with specified taskId exists)

Up
put /config/task-tag
(updateTagTaskMapping)
Updates a relation between a task and a tag configuration

Consumes

This API call consumes the following media types via the Content-Type request header:

Request body

TagTaskMappingUpdateRequest TagTaskMappingUpdateRequest (required)
Body Parameter

Query parameters

tagTaskMappingId (required)
Query Parameter — The id of the relation to update default: null format: int64

Return type

DefaultUpdateResponse

Example data

Content-Type: application/json
{
  "id" : 12345,
  "status" : "The data was updated successfully"
}

Example data

Content-Type: text/plain
Custom MIME type example not yet supported: text/plain

Produces

This API call produces the following media types according to the Accept request header; the media type will be conveyed by the Content-Type response header.

Responses

200

The relation was successfully updated DefaultUpdateResponse

400

Request contains invalid data. The relation was not updated String

401

JWT is missing or invalid

403

Insufficient permission to invoke endpoint

404

The specified relation was not found String

Task

Up
post /task
(createNewTask)
Create a new task

Consumes

This API call consumes the following media types via the Content-Type request header:

Request body

TaskCreateRequest TaskCreateRequest (required)
Body Parameter

Return type

DefaultCreateResponse

Example data

Content-Type: application/json
{
  "id" : 12345,
  "status" : "The data was created successfully"
}

Example data

Content-Type: text/plain
Custom MIME type example not yet supported: text/plain

Produces

This API call produces the following media types according to the Accept request header; the media type will be conveyed by the Content-Type response header.

Responses

200

Successfully created the new task DefaultCreateResponse

400

Request contains invalid data. The task was not created String

401

JWT is missing or invalid

403

Insufficient permission to invoke endpoint

Up
get /task
(getTasksForUser)
Gets the tasks available to the user

Query parameters

userId (optional)
Query Parameter — The id of the user to get tasks for (Default is the user logged in) default: null format: int64

Return type

array[TaskResponse]

Example data

Content-Type: application/json
[ {
  "name" : "name",
  "kmEligible" : true,
  "description" : "description",
  "taskId" : 0
}, {
  "name" : "name",
  "kmEligible" : true,
  "description" : "description",
  "taskId" : 0
} ]

Produces

This API call produces the following media types according to the Accept request header; the media type will be conveyed by the Content-Type response header.

Responses

200

Successfully fetched the list of tasks available

401

JWT is missing or invalid

Up
put /task
(updateTask)
Updates an existing task

Consumes

This API call consumes the following media types via the Content-Type request header:

Request body

TaskUpdateRequest TaskUpdateRequest (required)
Body Parameter

Query parameters

taskId (required)
Query Parameter — The id of the task to update default: null format: int64

Return type

DefaultUpdateResponse

Example data

Content-Type: application/json
{
  "id" : 12345,
  "status" : "The data was updated successfully"
}

Example data

Content-Type: text/plain
Custom MIME type example not yet supported: text/plain

Produces

This API call produces the following media types according to the Accept request header; the media type will be conveyed by the Content-Type response header.

Responses

200

Successfully updated the task DefaultUpdateResponse

400

Request contains invalid data. The task was not updated String

401

JWT is missing or invalid

403

Insufficient permission to invoke endpoint

404

The specified task was not found String

UserGroup

Up
post /user-group
(createUserGroup)
Create a new user group

Consumes

This API call consumes the following media types via the Content-Type request header:

Request body

UserGroupData UserGroupData (required)
Body Parameter

Return type

DefaultCreateResponse

Example data

Content-Type: application/json
{
  "id" : 12345,
  "status" : "The data was created successfully"
}

Produces

This API call produces the following media types according to the Accept request header; the media type will be conveyed by the Content-Type response header.

Responses

200

User group was successfully created DefaultCreateResponse

401

JWT is missing or invalid

403

Insufficient permission to invoke endpoint

Up
delete /user-group
(deleteUserGroup)
Deletes a user group

Query parameters

userGroupId (required)
Query Parameter — ID of the user group to delete default: null format: int64

Return type

DefaultDeleteResponse

Example data

Content-Type: application/json
{
  "id" : 12345,
  "status" : "The data was deleted successfully"
}

Produces

This API call produces the following media types according to the Accept request header; the media type will be conveyed by the Content-Type response header.

Responses

200

DefaultDeleteResponse

401

JWT is missing or invalid

403

Insufficient permission to invoke endpoint

Up
get /user-group
(getAllUserGroups)
Finds all user groups

Return type

array[UserGroupResponse]

Example data

Content-Type: application/json
[ {
  "userGroupName" : "userGroupName",
  "userGroupDescription" : "userGroupDescription"
}, {
  "userGroupName" : "userGroupName",
  "userGroupDescription" : "userGroupDescription"
} ]

Produces

This API call produces the following media types according to the Accept request header; the media type will be conveyed by the Content-Type response header.

Responses

200

User groups successfully fetched

401

JWT is missing or invalid

403

Insufficient permission to invoke endpoint

Up
put /user-group
(updateUserGroup)
Update an existing user group

Consumes

This API call consumes the following media types via the Content-Type request header:

Request body

UserGroupData UserGroupData (required)
Body Parameter

Query parameters

userGroupId (required)
Query Parameter — ID of the user group to update default: null format: int64

Return type

DefaultUpdateResponse

Example data

Content-Type: application/json
{
  "id" : 12345,
  "status" : "The data was updated successfully"
}

Produces

This API call produces the following media types according to the Accept request header; the media type will be conveyed by the Content-Type response header.

Responses

200

User group was successfully updated DefaultUpdateResponse

401

JWT is missing or invalid

403

Insufficient permission to invoke endpoint

UserGroupRelation

Up
post /user-group/user
(addUserToUserGroup)
Add a user to a user group

Consumes

This API call consumes the following media types via the Content-Type request header:

Request body

UserGroupRelationCreateRequest UserGroupRelationCreateRequest (required)
Body Parameter

Return type

DefaultMessageResponse

Example data

Content-Type: application/json
{
  "message" : "message"
}

Produces

This API call produces the following media types according to the Accept request header; the media type will be conveyed by the Content-Type response header.

Responses

200

User group relation for user was successfully created DefaultMessageResponse

401

JWT is missing or invalid

403

Insufficient permission to invoke endpoint

Up
delete /user-group/user
(deleteUserFromUserGroup)
Remove a user from a user group

Query parameters

userId (required)
Query Parameter — ID of the user to remove from the user group default: null format: int64
userGroupId (required)
Query Parameter — ID of the user group to remove user from default: null format: int64

Return type

DefaultMessageResponse

Example data

Content-Type: application/json
{
  "message" : "message"
}

Produces

This API call produces the following media types according to the Accept request header; the media type will be conveyed by the Content-Type response header.

Responses

200

User group relation for successfully deleted DefaultMessageResponse

401

JWT is missing or invalid

403

Insufficient permission to invoke endpoint

Up
get /user-group/user
(getUsersInGroup)
Gets all users in a user group

Query parameters

userGroupId (required)
Query Parameter — ID of the user group to get users for default: null format: int64

Return type

array[UserGroupRelation]

Example data

Content-Type: application/json
[ {
  "userId" : 0
}, {
  "userId" : 0
} ]

Produces

This API call produces the following media types according to the Accept request header; the media type will be conveyed by the Content-Type response header.

Responses

200

User group relations for the specified user group

401

JWT is missing or invalid

403

Insufficient permission to invoke endpoint

Up
put /user-group/user
(updateUserRelationToUserGroup)
Updates a user relation to a user group

Consumes

This API call consumes the following media types via the Content-Type request header:

Request body

UserGroupRelationCreateRequest UserGroupRelationCreateRequest (required)
Body Parameter

Return type

DefaultMessageResponse

Example data

Content-Type: application/json
{
  "message" : "message"
}

Produces

This API call produces the following media types according to the Accept request header; the media type will be conveyed by the Content-Type response header.

Responses

200

User group relation for user was successfully updated DefaultMessageResponse

401

JWT is missing or invalid

403

Insufficient permission to invoke endpoint

UserPermission

Up
post /user/permission
(addUserPermission)
Grants the specified permission to a user

Query parameters

userId (required)
Query Parameter — ID of the user to add permissions for default: null format: int64
permission (required)
Query Parameter — The permission to add default: null

Return type

DefaultMessageResponse

Example data

Content-Type: application/json
{
  "message" : "message"
}

Produces

This API call produces the following media types according to the Accept request header; the media type will be conveyed by the Content-Type response header.

Responses

200

Successfully added user permission DefaultMessageResponse

401

JWT is missing or invalid

403

Insufficient permission to invoke endpoint

Up
get /user/permission
(getUserPermissions)
Gets all permissions granted to a user

Query parameters

userId (required)
Query Parameter — ID of the user to get permissions for default: null format: int64

Return type

array[UserPermissionType]

Example data

Content-Type: application/json
[ null, null ]

Produces

This API call produces the following media types according to the Accept request header; the media type will be conveyed by the Content-Type response header.

Responses

200

Successfully fetched all user permissions

401

JWT is missing or invalid

403

Insufficient permission to invoke endpoint

Up
delete /user/permission
(removeUserPermission)
Removes the specified permissions granted to a user

Query parameters

userId (required)
Query Parameter — ID of the user to delete permissions for default: null format: int64
permission (required)
Query Parameter — The permission to remove default: null

Return type

DefaultMessageResponse

Example data

Content-Type: application/json
{
  "message" : "message"
}

Produces

This API call produces the following media types according to the Accept request header; the media type will be conveyed by the Content-Type response header.

Responses

200

Successfully deleted user permission DefaultMessageResponse

401

JWT is missing or invalid

403

Insufficient permission to invoke endpoint

Models

[ Jump to Methods ]

Table of Contents

  1. DefaultCreateResponse -
  2. DefaultDeleteResponse -
  3. DefaultMessageResponse -
  4. DefaultUpdateResponse -
  5. ExportConfigurationResponse -
  6. ExportSettingResponse -
  7. ExportSettingSaveRequest -
  8. ExportSettingValueType -
  9. TagConfigurationCreateRequest -
  10. TagConfigurationResponse -
  11. TagConfigurationUpdateRequest -
  12. TagConfigurationValueType -
  13. TagTaskConfigurationResponse -
  14. TagTaskMappingCreateRequest -
  15. TagTaskMappingUpdateRequest -
  16. TagTaskRelationType -
  17. TaskCreateRequest -
  18. TaskResponse -
  19. TaskUpdateRequest -
  20. UserGroupData -
  21. UserGroupRelation -
  22. UserGroupRelationCreateRequest -
  23. UserGroupRelationType -
  24. UserGroupResponse -
  25. UserPermissionType -

DefaultCreateResponse - Up

A response to a create operation.
id
Long The id of the created entity. format: int64
status
String A description of the status of the create operation.

DefaultDeleteResponse - Up

A response to a delete operation.
id
Long format: int64
status
String A description of the status of the delete operation.

DefaultMessageResponse - Up

message

DefaultUpdateResponse - Up

A response to an update operation.
id
Long The id of the updated entity. format: int64
status
String A description of the status of the update operation.

ExportConfigurationResponse - Up

An export configuration for an export system. Contains all the individual settings that can be configured, regardless if they are currently set. Also contains a validity state for the entire collection of settings.
exportSystemId
String An identifier for the export system that this configuration belongs to.
settings
isValid
Boolean Whether this configuration is valid.

ExportSettingResponse - Up

A single export setting within an export configuration. This is a key-value pair, where the key is unique within the export system, and the value is represented as a string, but can have requirements on the format.
exportSettingKey
String The key of this export setting. This is unique within the export system.
exportSettingValue (optional)
String The current value for this export setting. Can be null if it has not been set.
exportSettingDescription
String A description of this export setting
exportSettingValueType
isValid
Boolean Whether the current value for this export setting is valid.

ExportSettingSaveRequest - Up

A request to save a single export setting with the key 'exportSettingKey'. If no value has currently been set for the key, this will create a setting. If a value was already set, this will overwrite that value. If 'exportSettingValue' is null, the setting will be deleted.
exportSettingKey
String The key of the export setting to set a value for.
exportSettingValue (optional)
String The value to set for the export setting. If null, the setting with the 'exportSettingKey' will be deleted

ExportSettingValueType - Up

An enumeration of the different types of export settings. Valid values: * INT64 - A 64 bit integer. * STRING - A string. * URI - A Uniform Resource Locator.

TagConfigurationCreateRequest - Up

tagConfigurationName
String The name of the tag configuration
tagConfigurationDescription (optional)
String A description of the tag configuration
tagConfigurationValueType

TagConfigurationResponse - Up

tagConfigurationId
Long format: int64
tagConfigurationName
String The name of the tag configuration
tagConfigurationDescription (optional)
String A description of the tag configuration
tagConfigurationValueType

TagConfigurationUpdateRequest - Up

tagConfigurationName (optional)
String The name of the tag configuration
tagConfigurationDescription (optional)
String A description of the tag configuration
tagConfigurationValueType (optional)

TagConfigurationValueType - Up

Describes the value type of the tag

TagTaskConfigurationResponse - Up

A mapping between a tag configuration and a task, specifying the relation between the two. A tag configuration can be mapped to different tasks with different relation-types. For example, a tag configuration can be mandatory for one task, and optional for another.
tagTaskMappingId
Long An identifier for this mapping format: int64
tagConfigurationId
Long The id for the tag configuration that this mapping is associated to format: int64
taskId
Long The id for the task that this mapping is associated to format: int64
tagConfigurationName
String The name of the tag configuration
tagDescription (optional)
String A description of the tag configuration
tagValueType
String Describes the value type of the tag
tagDefaultValue (optional)
String The default value to use when no other value is specified when adding a tag to a time registration
tagTaskRelation
String Specifies the relation to the task. For example, whether the tag is optional or mandatory

TagTaskMappingCreateRequest - Up

tagConfigurationId
Long format: int64
taskId
Long format: int64
relation
defaultValue (optional)
String The default value to use when adding the tag to the task

TagTaskMappingUpdateRequest - Up

relation
defaultValue (optional)
String The default value to use when adding the tag to a the task

TagTaskRelationType - Up

The type of relation between the task and tag

TaskCreateRequest - Up

taskName
String The name of the task
taskDescription (optional)
String An optional description of the task
taskKmEligible (optional)
Boolean Marks if the task allows for registration of kilometres

TaskResponse - Up

taskId
Long format: int64
name
String The name of the task
description (optional)
String A description of the task
kmEligible
Boolean Marks if the task allows for registration of kilometres

TaskUpdateRequest - Up

taskName (optional)
String The name of the task
taskDescription (optional)
String An optional description of the task
taskKmEligible (optional)
Boolean Marks if the task allows for registration of kilometres

UserGroupData - Up

userGroupName
userGroupDescription (optional)

UserGroupRelation - Up

userId
Long format: int64
relationType

UserGroupRelationCreateRequest - Up

userId
Long format: int64
userGroupId
Long format: int64
userGroupRelation

UserGroupRelationType - Up

Describes a user's relation to a user group Valid values: * MEMBER - Ordinary relation to the user group with no special rights * MEMBER_READER - User is a member of the group and is allowed to read data of other members * MEMBER_WRITER - User is a member of the group and is allowed to read and write data of other members * MEMBER_PROTECTED_READER - User is a member of the group and is allowed to read data of other members while own data cannot be read/written by others in the group * MEMBER_PROTECTED_WRITER - User is a member of the group and is allowed to read and write data of other members while own data cannot be read/written by others in the group

UserGroupResponse - Up

userGroupName
userGroupDescription

UserPermissionType - Up

Describes a user's permission to performing certain operations Valid values: * MODIFY_CONFIGURATIONS - User is allowed to create, edit, update, and delete tag configurations and define the relation to existing tasks * MODIFY_TASKS - User is allowed to create, edit, update, and delete tasks * MODIFY_GROUPS - User is a allowed to modify create, modify, and update user groups * MODIFY_PERMISSIONS - User is allowed to add and remove permissions from a user * MODIFY_EXPORT_SETTINGS - User is allowed to to create, edit, update, and delete settings for exporting data * READ_ALL - User can read data registered by all users * WRITE_ALL - User can read and write data registered by all users