TriReg2 Admin API
An OpenAPI specification for time registrations to be used by an administrator
Version: 0.2.0
BasePath:
MIT License
https://github.com/trifork/trireg2-api/LICENSE.md
Access
- HTTP Basic Authentication
[ Jump to Models ]
Table of Contents
(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
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 request header;
the media type will be conveyed by the 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)
(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 request header:
Request body
Query parameters
exportSystemId (required)
Query Parameter — The id of the export system to save configurations for. default: null
Return type
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 request header;
the media type will be conveyed by the response header.
application/json
text/plain
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)
(createTagConfiguration)
Creates a new tag configuration
Consumes
This API call consumes the following media types via the request header:
Request body
Return type
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 request header;
the media type will be conveyed by the response header.
application/json
text/plain
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
(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
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 request header;
the media type will be conveyed by the 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)
(updateTagConfiguration)
Updates an existing tag configuration
Consumes
This API call consumes the following media types via the request header:
Request body
Query parameters
tagConfigurationId (required)
Query Parameter — The id of the tag configuration to update default: null format: int64
Return type
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 request header;
the media type will be conveyed by the response header.
application/json
text/plain
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
(createNewTagTaskMapping)
Creates a new relation between a task and a tag configuration
Consumes
This API call consumes the following media types via the request header:
Request body
Return type
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 request header;
the media type will be conveyed by the response header.
application/json
text/plain
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
(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
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 request header;
the media type will be conveyed by the 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)
(updateTagTaskMapping)
Updates a relation between a task and a tag configuration
Consumes
This API call consumes the following media types via the request header:
Request body
Query parameters
tagTaskMappingId (required)
Query Parameter — The id of the relation to update default: null format: int64
Return type
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 request header;
the media type will be conveyed by the response header.
application/json
text/plain
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
(createNewTask)
Create a new task
Consumes
This API call consumes the following media types via the request header:
Request body
Return type
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 request header;
the media type will be conveyed by the response header.
application/json
text/plain
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
(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
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 request header;
the media type will be conveyed by the response header.
Responses
200
Successfully fetched the list of tasks available
401
JWT is missing or invalid
(updateTask)
Updates an existing task
Consumes
This API call consumes the following media types via the request header:
Request body
Query parameters
taskId (required)
Query Parameter — The id of the task to update default: null format: int64
Return type
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 request header;
the media type will be conveyed by the response header.
application/json
text/plain
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
(createUserGroup)
Create a new user group
Consumes
This API call consumes the following media types via the request header:
Request body
Return type
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 request header;
the media type will be conveyed by the response header.
Responses
200
User group was successfully created
DefaultCreateResponse
401
JWT is missing or invalid
403
Insufficient permission to invoke endpoint
(deleteUserGroup)
Deletes a user group
Query parameters
userGroupId (required)
Query Parameter — ID of the user group to delete default: null format: int64
Return type
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 request header;
the media type will be conveyed by the response header.
Responses
200
DefaultDeleteResponse
401
JWT is missing or invalid
403
Insufficient permission to invoke endpoint
(getAllUserGroups)
Finds all user groups
Return type
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 request header;
the media type will be conveyed by the response header.
Responses
200
User groups successfully fetched
401
JWT is missing or invalid
403
Insufficient permission to invoke endpoint
(updateUserGroup)
Update an existing user group
Consumes
This API call consumes the following media types via the request header:
Request body
Query parameters
userGroupId (required)
Query Parameter — ID of the user group to update default: null format: int64
Return type
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 request header;
the media type will be conveyed by the response header.
Responses
200
User group was successfully updated
DefaultUpdateResponse
401
JWT is missing or invalid
403
Insufficient permission to invoke endpoint
(addUserToUserGroup)
Add a user to a user group
Consumes
This API call consumes the following media types via the request header:
Request body
Return type
Example data
Content-Type: application/json
{
"message" : "message"
}
Produces
This API call produces the following media types according to the request header;
the media type will be conveyed by the 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
Example data
Content-Type: application/json
{
"message" : "message"
}
Produces
This API call produces the following media types according to the request header;
the media type will be conveyed by the response header.
Responses
200
User group relation for successfully deleted
DefaultMessageResponse
401
JWT is missing or invalid
403
Insufficient permission to invoke endpoint
(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
Example data
Content-Type: application/json
[ {
"userId" : 0
}, {
"userId" : 0
} ]
Produces
This API call produces the following media types according to the request header;
the media type will be conveyed by the response header.
Responses
200
User group relations for the specified user group
401
JWT is missing or invalid
403
Insufficient permission to invoke endpoint
(updateUserRelationToUserGroup)
Updates a user relation to a user group
Consumes
This API call consumes the following media types via the request header:
Request body
Return type
Example data
Content-Type: application/json
{
"message" : "message"
}
Produces
This API call produces the following media types according to the request header;
the media type will be conveyed by the 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
(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
Example data
Content-Type: application/json
{
"message" : "message"
}
Produces
This API call produces the following media types according to the request header;
the media type will be conveyed by the response header.
Responses
200
Successfully added user permission
DefaultMessageResponse
401
JWT is missing or invalid
403
Insufficient permission to invoke endpoint
(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
Example data
Content-Type: application/json
[ null, null ]
Produces
This API call produces the following media types according to the request header;
the media type will be conveyed by the 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
Example data
Content-Type: application/json
{
"message" : "message"
}
Produces
This API call produces the following media types according to the request header;
the media type will be conveyed by the response header.
Responses
200
Successfully deleted user permission
DefaultMessageResponse
401
JWT is missing or invalid
403
Insufficient permission to invoke endpoint
[ Jump to Methods ]
Table of Contents
DefaultCreateResponse
-
DefaultDeleteResponse
-
DefaultMessageResponse
-
DefaultUpdateResponse
-
ExportConfigurationResponse
-
ExportSettingResponse
-
ExportSettingSaveRequest
-
ExportSettingValueType
-
TagConfigurationCreateRequest
-
TagConfigurationResponse
-
TagConfigurationUpdateRequest
-
TagConfigurationValueType
-
TagTaskConfigurationResponse
-
TagTaskMappingCreateRequest
-
TagTaskMappingUpdateRequest
-
TagTaskRelationType
-
TaskCreateRequest
-
TaskResponse
-
TaskUpdateRequest
-
UserGroupData
-
UserGroupRelation
-
UserGroupRelationCreateRequest
-
UserGroupRelationType
-
UserGroupResponse
-
UserPermissionType
-
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.
A response to a delete operation.
id
status
String A description of the status of the delete operation.
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.
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.
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.
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
An enumeration of the different types of export settings. Valid values: * INT64
- A 64 bit integer. * STRING
- A string. * URI
- A Uniform Resource Locator.
tagConfigurationName
String The name of the tag configuration
tagConfigurationDescription (optional)
String A description of the tag configuration
tagConfigurationValueType
tagConfigurationId
tagConfigurationName
String The name of the tag configuration
tagConfigurationDescription (optional)
String A description of the tag configuration
tagConfigurationValueType
tagConfigurationName (optional)
String The name of the tag configuration
tagConfigurationDescription (optional)
String A description of the tag configuration
tagConfigurationValueType (optional)
Describes the value type of the tag
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
tagConfigurationId
taskId
relation
defaultValue (optional)
String The default value to use when adding the tag to the task
relation
defaultValue (optional)
String The default value to use when adding the tag to a the task
The type of relation between the task and tag
taskName
taskDescription (optional)
String An optional description of the task
taskKmEligible (optional)
Boolean Marks if the task allows for registration of kilometres
taskId
name
description (optional)
String A description of the task
kmEligible
Boolean Marks if the task allows for registration of kilometres
taskName (optional)
taskDescription (optional)
String An optional description of the task
taskKmEligible (optional)
Boolean Marks if the task allows for registration of kilometres
userGroupName
userGroupDescription (optional)
userId
userGroupId
userGroupRelation
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
userGroupName
userGroupDescription
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