REST - Task

REST-Interface

Zurück zur Übersicht

Get task by id

URL
GET <application-url>/api/task/<taskId>

Path parameter

  • taskId

Produces

application/json
application/xml

com.matterial.mtr.api.object.Task

  • 200 OK
  • 400 BAD_REQUEST
  • 404 NOT_FOUND
  • 500 INTERNAL_SERVER_ERROR

Permission
Login

Sample
GET http://localhost:8080/mtr-backend/api/task/1


Get tasks

URL
GET <application-url>/api/task

Query parameter

  • documentId
    task related to this document
  • documentLanguageVersionId
    task related to this version
  • languageKey
    task realted to this document-language
  • authorAccountId
    task was created by this account
  • accountId
    task was accepted by this account
  • roleId
    task was assigned to this role
  • assignedOnly
    possible: true, false
    default: false
    if true, get only tasks assigned to one of my roles
  • showSnapOnly
    possible: true, false
    default: false
    if true, get only snap-tasks
  • hideSnap
    possible: true, false
    default: false
    if true, hide snap-tasks
  • showResubmissionOnly
    possible: true, false
    default: false
    if true, get only tasks with resubmissionTimePeriodInDays set
    Since v2.5.0
  • hideResubmission
    possible: true, false
    default: false
    if true, hides tasks with resubmissionTimePeriodInDays set
    Since v2.5.0
  • showValidOnly
    possible: true, false
    default: false
    if true, get only tasks with resubmissionDateInSeconds not set or resubmissionDateInSeconds < now
    Since v2.5.0
  • hideValid
    possible: true, false
    default: false
    if true, get only tasks with resubmissionDateInSeconds set and resubmissionDateInSeconds > now
    Since v2.5.0
  • hideTasksOfRemovedDocuments
    possible: true, false
    default: false
    if true, hide tasks of removed documents
  • statusId
    multiple: true
    possible: statusId(s) as number
    Id(s) of a TaskStatus
  • statusIdExclude
    multiple: true
    possible: statusId(s) as number
    Id(s) of a TaskStatus to exclude
  • orderBy
    possible:
    id
    date
    dueDate
    status
    documentId
    documentName
    default: date
    the order by
  • orderDir
    possible: asc, desc
    default: desc
    the ordering direction
  • count
    possible: true, false
    default: false
    fetch totalHits (overallCount)
  • offset
  • limit

Produces

application/json
application/xml

List<com.matterial.mtr.api.object.Task>

  • 200 OK
  • 500 INTERNAL_SERVER_ERROR

Permission
Login

Sample
GET http://localhost:8080/mtr-backend/api/task


Create task

Creating a task will automatically set (overwrite) these fields:

  • creationDateInSeconds - now
  • authorAccount - current user
  • taskStatusId - OPEN

URL
POST <application-url>/api/task

Consumes

application/json
application/xml

com.matterial.mtr.api.object.Task

Produces

application/json
application/xml

com.matterial.mtr.api.object.Task

  • 201 CREATED
  • 400 BAD_REQUEST
  • 500 INTERNAL_SERVER_ERROR

Permission
EDIT_TASK

Sample
POST http://localhost:8080/mtr-backend/api/task


Update task

You can only update these fields:

  • description
  • dueDateInSeconds
  • resubmissionTimePeriodInDays
  • documentLanguageVersionId
  • assignedRole

URL
PUT <application-url>/api/task/<taskId>

Path parameter

  • taskId
    The id of a specific task

Consumes

application/json
application/xml

com.matterial.mtr.api.object.Task

Produces

application/json
application/xml

com.matterial.mtr.api.object.Task

  • 200 OK
  • 400 BAD_REQUEST
  • 500 INTERNAL_SERVER_ERROR

Permission
EDIT_TASK

Sample
PUT http://localhost:8080/mtr-backend/api/task/2


Accept

Since v2.5.0

Accepts the task. This sets these values:

  • taskStatusId - ACCEPTED
  • acceptedAccount - current user

The task can only be accepted if:

  • the task exists
  • TaskStatus is OPEN
  • There is no accepted account
  • One of the roles of the current user is assigned to the task

URL
PUT <application-url>/api/task/<taskId>/accept

Path parameter

  • taskId
    The id of a specific task

Produces

application/json
application/xml

com.matterial.mtr.api.object.Task

  • 200 OK
  • 400 BAD_REQUEST
  • 500 INTERNAL_SERVER_ERROR

Permission
Login

Sample
PUT http://localhost:8080/mtr-backend/api/task/2/accept


Return

Since v2.5.0

Returns the task to group. This sets these values:

  • taskStatusId - OPEN
  • acceptedAccount - null

The task can only be returned if:

  • the task exists
  • TaskStatus is ACCEPTED
  • I am the account, that accepted the task

URL
PUT <application-url>/api/task/<taskId>/return

Path parameter

  • taskId
    The id of a specific task

Produces

application/json
application/xml

com.matterial.mtr.api.object.Task

  • 200 OK
  • 400 BAD_REQUEST
  • 500 INTERNAL_SERVER_ERROR

Permission
Login

Sample
PUT http://localhost:8080/mtr-backend/api/task/2/return


Close

Since v2.5.0

Closes the task. This sets these values:

  • taskStatusId - CLOSED

The task can only be closed if:

  • the task exists
  • TaskStatus is ACCEPTED
  • I am the account, that accepted the task

URL
PUT <application-url>/api/task/<taskId>/close

Path parameter

  • taskId
    The id of a specific task

Produces

application/json
application/xml

com.matterial.mtr.api.object.Task

  • 200 OK
  • 400 BAD_REQUEST
  • 500 INTERNAL_SERVER_ERROR

Permission
Login

Sample
PUT http://localhost:8080/mtr-backend/api/task/2/close


Reject

Since v2.5.0

Rejects the task. This sets these values:

  • taskStatusId - REJECTED

The task can only be rejected if:

  • the task exists
  • TaskStatus is ACCEPTED
  • I am the account, that accepted the task

URL
PUT <application-url>/api/task/<taskId>/reject

Path parameter

  • taskId
    The id of a specific task

Produces

application/json
application/xml

com.matterial.mtr.api.object.Task

  • 200 OK
  • 400 BAD_REQUEST
  • 500 INTERNAL_SERVER_ERROR

Permission
Login

Sample
PUT http://localhost:8080/mtr-backend/api/task/2/reject


Resubmit

Since v2.5.0

Resubmits the task. This sets these values:

  • resubmissionDateInSeconds - now + resubmissionTimePeriodInDays

The task can only be resubmitted if:

  • the task exists
  • TaskStatus is ACCEPTED
  • I am the account, that accepted the task
  • If resubmissionTimePeriodInDays was set ( > 0 )

URL
PUT <application-url>/api/task/<taskId>/resubmit

Path parameter

  • taskId
    The id of a specific task

Produces

application/json
application/xml

com.matterial.mtr.api.object.Task

  • 200 OK
  • 400 BAD_REQUEST
  • 500 INTERNAL_SERVER_ERROR

Permission
Login

Sample
PUT http://localhost:8080/mtr-backend/api/task/2/resubmit


Reopen

Since v2.5.0

Reopens the task. This sets these values:

  • taskStatusId - ACCEPTED

The task can only be reopened if:

  • the task exists
  • TaskStatus is CLOSED or REJECTED
  • I am the account, that accepted the task or I am the author

URL
PUT <application-url>/api/task/<taskId>/reopen

Path parameter

  • taskId
    The id of a specific task

Produces

application/json
application/xml

com.matterial.mtr.api.object.Task

  • 200 OK
  • 400 BAD_REQUEST
  • 500 INTERNAL_SERVER_ERROR

Permission
Login

Sample
PUT http://localhost:8080/mtr-backend/api/task/2/reopen


Remove task

URL
DELETE <application-url>/api/task/<taskId>

Path parameter

  • taskId
    The id of a specific task

Produces

text/plain

Integer - count of removed

  • 200 OK
  • 400 BAD_REQUEST
  • 500 INTERNAL_SERVER_ERROR

Permission
EDIT_TASK

Sample
DELETE http://localhost:8080/mtr-backend/api/task/8

×