TriReg2 User API
An OpenAPI specification for time registrations to be used by a user
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
(exportTimeRegistrationsForUser)
Exports time registrations for a specific time period for the user logged in
Query parameters
start (required)
Query Parameter — The start date of the export time interval (inclusive) default: null format: date
end (required)
Query Parameter — The end date of the export time interval (inclusive) default: null format: date
Return type
String
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
OK
String
401
JWT is missing or invalid
502
While acting as a gateway or proxy, this service received an invalid response from the upstream server.
(importTimeRegistrations)
Imports the given time registrations into the system
Consumes
This API call consumes the following media types via the request header:
Request body
Return type
Example data
Content-Type: application/json
[ {
"timeRegistrationId" : 0,
"message" : "message"
}, {
"timeRegistrationId" : 0,
"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
OK
401
JWT is missing or invalid
502
While acting as a gateway or proxy, this service received an invalid response from the upstream server.
(createKmRegistration)
Registers a new kilometre registration with to/from details and how many kilometres were travelled
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
201
Successfully created the kilometre registration
DefaultCreateResponse
400
Bad create request
String
401
JWT is missing or invalid
Up
delete /km-registration
(deleteKmRegistration)
Deletes or rejects a kilometre registration.
Query parameters
kmRegistrationId (required)
Query Parameter — The id of the kilometre registrations to update default: null format: int64
Return type
Example data
Content-Type: application/json
{
"id" : 12345,
"status" : "The data was deleted 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 deleted or rejected a kilometre registration
DefaultDeleteResponse
400
Bad delete request
String
401
JWT is missing or invalid
404
Kilometre registration not found
String
(getKmRegistrationsForUser)
Gets all kilometre registrations made by the specified user
Query parameters
userId (optional)
Query Parameter — The id of the user to get kilometre registrations data for default: null format: int64
Return type
Example data
Content-Type: application/json
[ {
"date" : "2000-01-23",
"kmRegistrationId" : 0,
"km" : 1,
"from" : "from",
"to" : "to",
"taskId" : 6
}, {
"date" : "2000-01-23",
"kmRegistrationId" : 0,
"km" : 1,
"from" : "from",
"to" : "to",
"taskId" : 6
} ]
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 fetched the kilometre registrations
401
JWT is missing or invalid
404
User not found
String
(updateKmRegistration)
Updates an existing kilometre registration with to/from details and how many kilometres were travelled
Consumes
This API call consumes the following media types via the request header:
Request body
Query parameters
kmRegistrationId (required)
Query Parameter — The id of the kilometre registrations 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 kilometre registration
DefaultUpdateResponse
400
Bad update request
String
401
JWT is missing or invalid
404
Kilometre registration not found
String
(login)
Redirects to OpenId login flow. Only to be used when logging into the service through a web browser
Responses
302
Redirection to a login flow for the OpenId login provider. After completing the flow, the user will be redirected back to the application with a valid session token.
(deleteTagRegistration)
Deletes a tag that was added to a time registration
Query parameters
tagId (required)
Query Parameter — The ID of the tag 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
Tag was successfully deleted
DefaultDeleteResponse
401
JWT is missing or invalid
404
The requested tag was not found and could not be deleted
(getTimeRegistrationTags)
Gets the tags associated with the specified time registration. This includes both the tags that have already been
added, and the ones that can be added.
Query parameters
timeRegistrationId (required)
Query Parameter — The ID of the time registration to get tags for default: null format: int64
Return type
Example data
Content-Type: application/json
[ {
"tagConfigurationMetadata" : {
"tagConfigurationDescription" : "tagConfigurationDescription",
"tagConfigurationId" : 5,
"tagConfigurationName" : "tagConfigurationName",
"valueType" : "STRING",
"cardinality" : "OPTIONAL"
},
"tagValue" : {
"tagId" : 2,
"tagValue" : "tagValue"
}
}, {
"tagConfigurationMetadata" : {
"tagConfigurationDescription" : "tagConfigurationDescription",
"tagConfigurationId" : 5,
"tagConfigurationName" : "tagConfigurationName",
"valueType" : "STRING",
"cardinality" : "OPTIONAL"
},
"tagValue" : {
"tagId" : 2,
"tagValue" : "tagValue"
}
} ]
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 tags for the requested time registration, both existing and available to add
401
JWT is missing or invalid
404
Unable to find a time registration with the specified timeRegistrationId
502
While acting as a gateway or proxy, this service received an invalid response from the upstream server.
(tagTimeRegistration)
Tags a time registration with a specified tag and tag value
Consumes
This API call consumes the following media types via the request header:
Request body
Query parameters
timeRegistrationId (required)
Query Parameter — The ID of the time registration to add a tag to default: null format: int64
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
Tag was successfully added to the time registration. The response contains the id of the new tag
DefaultCreateResponse
401
JWT is missing or invalid
400
Tag was not added to the time registration due to an error with the request
404
No time registration was found to tag
502
While acting as a gateway or proxy, this service received an invalid response from the upstream server.
(updateTagRegistration)
Updates a tag that was added to a time registration
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 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
Tag was successfully updated
DefaultUpdateResponse
400
The updated tag information yields an invalid tag
401
JWT is missing or invalid
404
The specified tag was not found
Up
post /time-registration/bulk
(addBulkTimeRegistrationForUser)
Add several time registrations for a user
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"
}, {
"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.
application/json
text/plain
Responses
201
Time registrations added successfully
400
Failed creating one or more time registrations - if one time registration failed, no time registration is saved
String
401
JWT is missing or invalid
Up
post /time-registration
(addTimeRegistrationForUser)
Adds a time registration for a user
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
201
Time registration added successfully
DefaultCreateResponse
401
JWT is missing or invalid
Up
post /time-registration/associate-task
(associateTimeRegistrationWithTask)
Associates a time registration - that currently does not have any task associated - to the specified task.
Also accepts tags that may be required to make a valid time registration for the specified 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 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
associated
DefaultUpdateResponse
400
Bad associate request
String
401
JWT is missing or invalid
404
Time registration not found
String
Up
delete /time-registration
(deleteTimeRegistration)
Deletes the specified time registration
Query parameters
timeRegistrationId (required)
Query Parameter — The id of the time registration to delete default: null format: int64
Return type
Example data
Content-Type: application/json
{
"id" : 12345,
"status" : "The data was deleted 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
deleted
DefaultDeleteResponse
400
Bad delete request
String
401
JWT is missing or invalid
404
Time registration not found
String
Up
get /time-registration/active-task
(getTaskTimeRegistrationsOverview)
Returns time registrations for a user grouped by task
Query parameters
date (required)
Query Parameter — The date to consider when fetching active tasks and time registrations default: null format: date
period (optional)
Query Parameter — The time period to use when deciding in which time period tasks are considered active default: null
Return type
Example data
Content-Type: application/json
[ {
"taskDescription" : "taskDescription",
"taskName" : "taskName",
"timeRegistrations" : [ {
"date" : "2000-01-23",
"duration" : "PT1H30M",
"timeRegistrationId" : 6,
"registered" : 1,
"description" : "description"
}, {
"date" : "2000-01-23",
"duration" : "PT1H30M",
"timeRegistrationId" : 6,
"registered" : 1,
"description" : "description"
} ],
"taskId" : 0
}, {
"taskDescription" : "taskDescription",
"taskName" : "taskName",
"timeRegistrations" : [ {
"date" : "2000-01-23",
"duration" : "PT1H30M",
"timeRegistrationId" : 6,
"registered" : 1,
"description" : "description"
}, {
"date" : "2000-01-23",
"duration" : "PT1H30M",
"timeRegistrationId" : 6,
"registered" : 1,
"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.
application/json
text/plain
Responses
200
List of time registrations for the user grouped by task
400
Request contains an invalid time period value
String
401
JWT is missing or invalid
Up
get /time-registration
(getTimeRegistrationsForUser)
Returns time registrations that belongs to a user
Return type
Example data
Content-Type: application/json
[ {
"date" : "2000-01-23",
"duration" : "PT1H30M",
"timeRegistrationId" : 0,
"registered" : 6,
"description" : "description",
"userId" : 1,
"taskId" : 5,
"tags" : [ {
"tagConfigurationMetadata" : {
"tagConfigurationDescription" : "tagConfigurationDescription",
"tagConfigurationId" : 5,
"tagConfigurationName" : "tagConfigurationName",
"valueType" : "STRING",
"cardinality" : "OPTIONAL"
},
"tagValue" : {
"tagId" : 2,
"tagValue" : "tagValue"
}
}, {
"tagConfigurationMetadata" : {
"tagConfigurationDescription" : "tagConfigurationDescription",
"tagConfigurationId" : 5,
"tagConfigurationName" : "tagConfigurationName",
"valueType" : "STRING",
"cardinality" : "OPTIONAL"
},
"tagValue" : {
"tagId" : 2,
"tagValue" : "tagValue"
}
} ]
}, {
"date" : "2000-01-23",
"duration" : "PT1H30M",
"timeRegistrationId" : 0,
"registered" : 6,
"description" : "description",
"userId" : 1,
"taskId" : 5,
"tags" : [ {
"tagConfigurationMetadata" : {
"tagConfigurationDescription" : "tagConfigurationDescription",
"tagConfigurationId" : 5,
"tagConfigurationName" : "tagConfigurationName",
"valueType" : "STRING",
"cardinality" : "OPTIONAL"
},
"tagValue" : {
"tagId" : 2,
"tagValue" : "tagValue"
}
}, {
"tagConfigurationMetadata" : {
"tagConfigurationDescription" : "tagConfigurationDescription",
"tagConfigurationId" : 5,
"tagConfigurationName" : "tagConfigurationName",
"valueType" : "STRING",
"cardinality" : "OPTIONAL"
},
"tagValue" : {
"tagId" : 2,
"tagValue" : "tagValue"
}
} ]
} ]
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 time registrations for the user
401
JWT is missing or invalid
Up
put /time-registration
(updateTimeRegistrationForUser)
Updates the specified time registration
Consumes
This API call consumes the following media types via the request header:
Request body
Query parameters
timeRegistrationId (required)
Query Parameter — The id of the time registration to update default: null format: int64
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
Updated
DefaultCreateResponse
400
Bad update request
String
401
JWT is missing or invalid
404
Time registration not found
String
[ Jump to Methods ]
Table of Contents
DefaultCreateResponse
-
DefaultDeleteResponse
-
DefaultUpdateResponse
-
ImportTimeRegistrationRequest_inner
-
ImportTimeRegistrationResponse_inner
-
ImportTimeRegistrationStatus
-
KmRegistration
-
KmRegistrationRequest
-
KmRegistrationStatus
-
KmRegistrationUpdateRequest
-
Tag
-
TagConfigurationMetadata
-
TagTimeRegistrationRequest
-
TimeRegistrationAssociateTaskRequest
-
TimeRegistrationRequest
-
TimeRegistrationResponse
-
TimeRegistrationStatus
-
TimeRegistrationTag
-
TimeRegistrationUpdateRequest
-
TimeRegistrationsByTaskResponse_inner
-
TimeRegistrationsByTaskResponse_inner_timeRegistrations_inner
-
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.
userId
taskId (optional)
Long Associates the time registration with a task.
If not specified, then the
description
field must be a non-null value format: int64
date
duration
String ISO 8601 formatted duration component <PnDTnHnMn.nS>. Each unit is optional, but at least one must be specified format: duration
tags
description (optional)
timeRegistrationId
status
message (optional)
String Provides a description of the import status
The status of importing a time registration Valid values: * VALID
- The time registration is valid and has been imported successfully * PENDING
- The time registration is valid, but is awaiting the approval of the user. Used when a user imports data for another user. * FAILED
- Something is wrong with the time registration, it has not been imported.
kmRegistrationId
taskId
date
from
to
km
status
Describes the status of the kilometre registration
date (optional)
from (optional)
to (optional)
km (optional)
status (optional)
APPROVE
REJECT
PENDING
An existing tag with some value
tagId
Long The id of this tag format: int64
tagValue
String The value of this tag. This is a valid value corresponding to the tag configuration. For example, if the tag
configuration specifies that the tag is an integer, then the value is a valid integer.
Metadata for a tag configuration in the context of a specific time registration. This can differ based on the task the
time registration is associated to, so a tag that is optional for one time registration can be mandatory for another.
tagConfigurationId
Long An identifier for this tag configuration format: int64
tagConfigurationName
String The name of the tag configuration
tagConfigurationDescription (optional)
String An optional description of the tag configuration
cardinality
String The status of a time registration Valid values: *
OPTIONAL
- The tag can be added to this time registration, but it is not required. *
MANDATORY
- The tag must be added to this time registration. *
MANAGED
- The tag is managed by administrator configuration. It is read-only and can't be changed.
OPTIONAL
MANDATORY
MANAGED
valueType
String The value type of this configuration Valid values: *
STRING
- The tag value can be any string *
BOOL
- The tag value must be a boolean on the form 'true' or 'false' (case insensitive) *
INT
- The tag value must be a valid 32-bit integer
STRING
BOOL
INT
A request to set a tag value for a tag configuration for a time registration. Administrators configure the rules for
tags for time registrations. This includes the format of the tag value, and whether tags are mandatory or optional.
When setting a tag value for a time registration, the request must follow these rules.
tagConfigurationId
Long The id of the tag configuration to set a value for. This must be a valid tag configuration for the time
registration. format: int64
value
String The value to set for the tag configuration. This is a string, but the format of the string is dependent on the tag
configuration. For example, if the configuration specifies that the tag is an integer, then the string value must
be a valid integer.
timeRegistrationId
taskId
tags
taskId (optional)
Long Associates the time registration with a task.
If not specified, then the
description
field must be a non-null value format: int64
date
duration
String ISO 8601 formatted duration component <PnDTnHnMn.nS>. Each unit is optional, but at least one must be specified format: duration
tags (optional)
description (optional)
timeRegistrationId
registered
Long The registration time as Unix milliseconds timestamp format: int64
userId
taskId (optional)
date
duration
String ISO 8601 formatted duration component <PnDTnHnMn.nS>. Each unit is optional, but at least one must be specified format: duration
status
tags
description (optional)
The status of a time registration Valid values: * VALID
- The time registration is valid * PENDING
- The time registration is valid as such, but is awaiting the approval of the user. If this happens, it will become 'valid'. If it is rejected, it will become 'rejected'. * INVALID
- Something is wrong with the time registration, it will need correction before it can become valid * DELETED
- The time registration has existed at some point, but has now been deleted * REJECTED
- The time registration has been rejected by the user
Composite object with information about a potential tag for a time registration. This consists both of tags that has
been set, and tags that can potentially be set. Contains metadata describing the tag and the current tag value (if
any). The 'tagValue' is null if no tag value has been set for the specific configuration.
tagConfigurationMetadata
tagValue (optional)
date (optional)
duration (optional)
String ISO 8601 formatted duration component <PnDTnHnMn.nS>. Each unit is optional, but at least one must be specified format: duration
status (optional)
description (optional)
taskId (optional)
taskName (optional)
taskDescription (optional)
timeRegistrations (optional)
timeRegistrationId
registered
Long The registered time value as Unix milliseconds timestamp format: int64
date
duration
String ISO 8601 formatted duration component <PnDTnHnMn.nS>. Each unit is optional, but at least one must be specified format: duration
status
description (optional)