REST - Document

REST-Interface

Get document by instance-name and cas-id

Special method to get document from instance without any permission checks. This does only work on localhost. This logs in as ‘system’ and performs the query on the given instance. This method should only be used for pdf-conversion! URL GET <application-url>/api/document/pdfconversion/<instanceName>/<documentLanguageVersionCasId>

Path parameter

  • instanceName AKA dataSourceName
  • documentLanguageVersionCasId

Produces

application/json
application/xml

com.matterial.mtr.api.object.Document

  • 200 OK
  • 403 FORBIDDEN
  • 500 INTERNAL_SERVER_ERROR

Permission localhost only

Sample GET http://localhost:8080/mtr-backend/api/document/pdfconversion/MtrDS/XXX


Get duplicate of document by id

Get duplicate of a stored document by id. This copies the main-file and all attachments of the current version (the user is allowed to see) of all languages as temp-files. All attachment-links within the main-file will be updated with their new temp-file equivalents. Finally this returns all duplicated documents (one for each language) and the generated TempFileDescriptors. You have to use the documents and the context-token of the TempFileDescriptors to store a new document. Be aware to POST the first language and PUT the following languages with the first document-id. URL GET <application-url>/api/document/<documentId>/duplicate

Path parameter

  • documentId

Query parameter

  • templateToDocument possible: true, false default: false Activate special mode to create document out of a template
  • documentToTemplate possible: true, false default: false Activate special mode to create template out of a document

Produces

application/json
application/xml

com.matterial.mtr.api.object.DocumentDuplicate

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

Permission EDIT_DOCUMENT

Sample GET http://localhost:8080/mtr-backend/api/document/2/duplicate


Get duplicates

Get all session-stored duplicates. URL GET <application-url>/api/document/duplicate

Produces

application/json
application/xml

com.matterial.mtr.api.object.DocumentDuplicates> - key of internal map: contextToken

  • 200 OK
  • 500 INTERNAL_SERVER_ERROR

Permission EDIT_DOCUMENT

Sample GET http://localhost:8080/mtr-backend/api/document/duplicate


Remove duplicate from session by context-token

Remove duplicate from session including all temp-files. URL DELETE <application-url>/api/document/<contextToken>/duplicate

Path parameter

  • contextToken The contextToken, that represents one duplicated document in session.

Produces

text/plain

Integer - count

  • 202 ACCEPTED
  • 500 INTERNAL_SERVER_ERROR

Permission EDIT_DOCUMENT

Sample DELETE http://localhost:8080/mtr-backend/api/document/ebd9dece-d065-4733-995d-6a8f22c5ba54/duplicate


Get document by id

URL GET <application-url>/api/document/<documentId>

Path parameter

  • documentId

Query parameter

  • languagePrefer possible: true, false default: false return doc in preffered language, otherwise any language. does only work with “disable rights”!
  • languageExclude possible: true, false default: false exclude given language-key. does only work with “disable rights”!
  • languageKey possible: de, en, fr, it, … default: de language key
  • updateReadTime possible: de, en, fr, …, all which docs should be updated as read
  • loadRoleRights possible: true, false default: false
  • loadCategoryIds possible: true, false default: false
  • loadResponsibles possible: true, false default: false
  • loadAuthors possible: true, false default: false
  • loadLastAuthorOnly possible: true, false default: false
  • loadFollowers possible: true, false default: false
  • loadMarkedAsHelpfulBy possible: true, false default: false
  • loadAttachments possible: true, false default: false
  • loadLanguageAttachments possible: true, false default: false
  • loadDocumentAttachments possible: true, false default: false
  • loadRelatedDocumentIds possible: true, false default: false
  • loadAdditionalProperties possible: true, false default: false
  • loadExtensionValues possible: true, false default: false

Produces

application/json
application/xml

com.matterial.mtr.api.object.Document

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

Permission Login

Sample GET http://localhost:8080/mtr-backend/api/document/2


Get documents

URL GET <application-url>/api/document

Query parameter

  • documentId document-id(s) (multiple), i.e.: “&documentId=4&documentId=5”
  • documentLanguageVersionId document-language-version-id(s) (multiple), i.e.: “&documentLanguageVersionId=4&documentLanguageVersionId=5”
  • allLanguages possible: true, false default: false return all docs in all languages
  • allVersions possible: true, false default: false return all docs in all versions
  • languagePrefer possible: true, false default: false return doc in preffered language, otherwise any language. does only work with “disable rights”!
  • languageExclude possible: true, false default: false exclude given language-key. does only work with “disable rights”!
  • languageKey possible: de, en, fr, it, … default: de language key
  • categoryIdsAnd category-filter (and-related) (multiple), i.e.: “&categoryIdsAnd=1&categoryIdsAnd=2&categoryIdsAnd=3”
  • categoryIdsOr category-filter (or-related) (multiple), i.e.: “&categoryIdsOr=1&categoryIdsOr=2&categoryIdsOr=3”
  • roleRightRoleId Id of a related role (workgroup or personal role).
  • roleRightType Type of a related roleRight (1 - READ, 2 EDIT). Should normally be used with roleRightRoleId.
  • read true - only read documents false - only unread documents unreadSinceAccountCreation - only unread docs since first login unreadSinceLastLogin - only unread docs since last login
  • updateReadTime possible: de, en, fr, …, all which docs should be updated as read
  • relatedDocumentId docs related to this document-id
  • documentValid true - only valid docs false - only invalid docs default - all docs
  • showBios true - get also bio-documents
  • showTemplates true - get also templates
  • showArchived true - get also archived docs
  • showRemoved true - get also removed docs
  • showBiosOnly true - get only bio-documents
  • showTemplatesOnly true - get only templates
  • showArchivedOnly true - get only archived docs
  • showRemovedOnly true - get only removed docs
  • followerAccountId documents, the given account id follow. this will be OR-related with following by category and following by additional property, if more than one are given.
  • following if true, currently logged-in account follows documents
  • categoryFollowerAccountId documents, the given account id follows by category. this will be OR-related with direct following and following by additional property, if more than one are given.
  • categoryFollowing if true, currently logged-in account follows categories
  • additionalPropertyFollowerAccountId documents, the given account id follows by additional property. this will be OR-related with direct following and following by category, if more than one are given.
  • additionalPropertyFollowing if true, currently logged-in account follows additional property
  • markedHelpfulByContactId id of a contact that marked the document-language-version as helpful
  • lastChangedSinceDays possible: 0, 1, 2, … last changed within the last count of days
  • lastChangedSince last changed since “timestamp” in seconds, i.e. 1451904693
  • responsibleContactId contact-id of a responsible
  • responsible if true, currently logged-in account is responsible of documents
  • authorshipAccountId account-id of an “author” (stored in WriteRelation-Table)
  • authorship if true, currently logged-in account is author of documents
  • documentExpiresInDays documents valid end is reached within the next count of days
  • documentExpiresOn documents valid end “timestamp” in seconds
  • documentExpires possible: true, false document has a “valid end” set
  • documentHasArchivedBegin possible: true, false document has a “archived begin” set
  • showLanguageVersionReviewedOnly possible: true, false default: false show only reviewed documents. document is “reviewed” (status-bit REVIEWED (4) is set)
  • hideLanguageVersionReviewed possible: true, false default: false hide reviewed documents document is not “reviewed” (status-bit REVIEWED (4) is not set)
  • showLanguageVersionReadyOnly possible: true, false default: false show only published documents. document is “ready” (status-bit READY (1) is set)
  • hideLanguageVersionReady possible: true, false default: false hide published documents document is not “ready” (status-bit READY (1) is not set)
  • showLanguageVersionCurrentlyInProcessingOnly possible: true, false default: false show only documents that are currently in processing. document is “currently in processing” (status-bit CURRENTLY_IN_PROCESSING (2) is set)
  • hideLanguageVersionCurrentlyInProcessing possible: true, false default: false hide documents, that are currently in processing. document is not “currently in processing” (status-bit CURRENTLY_IN_PROCESSING (2) is not set)
  • showLanguageVersionReviewRequestedOnly possible: true, false default: false show only review requested documents
  • hideLanguageVersionReviewRequested possible: true, false default: false review for document is not requested
  • additionalPropertyId possible: 1, 2, 3, 4, 5, … id of an additional-property
  • additionalPropertyType possible: 1, 2, 3, 4 type of an additional-property 1 - NEWS 2 - URGENT 3 - HELP_SECTION_DASHBOARD 4 - HELP_SECTION_DOCUMENT_EDITOR
  • showSnapOnly possible: true, false default: false show only documents with related open snap-task.
  • hideSnap possible: true, false default: false hide documents with related open snap-task.
  • mentionedAccountIdInComment account-id of a mentioned account within a document-related comment
  • clipBoard possible: true, false default: false true to get documents from session-clipboard.
  • loadRoleRights possible: true, false default: false
  • loadCategoryIds possible: true, false default: false
  • loadResponsibles possible: true, false default: false
  • loadAuthors possible: true, false default: false
  • loadLastAuthorOnly possible: true, false default: false
  • loadFollowers possible: true, false default: false
  • loadMarkedAsHelpfulBy possible: true, false default: false
  • loadAttachments possible: true, false default: false
  • loadLanguageAttachments possible: true, false default: false
  • loadDocumentAttachments possible: true, false default: false
  • loadRelatedDocumentIds possible: true, false default: false
  • loadAdditionalProperties possible: true, false default: false
  • loadExtensionValues possible: true, false default: false
  • loadSnapFlag possible: true, false default: false
  • count possible: true, false default: false additionally loading count of documents
  • orderBy possible: id - document-id valid - document-valid archived - document-archived archivedBeginInSeconds - document-archivedbegin removed - document-removed clickCount- document-clickcount validEndInSeconds - document-validend createTimeInSeconds - document-createtime validBeginOrCreateTime - document-validbegin firstReadTimeAndValidBegin - version-firstreadtime languageVersionTitle - version-title languageVersionLanguagePrio - language-prio, version-version languageVersionVersion - version-version lastReadTime - version-lastreadtime languageVersionLastChangeInSeconds - version-lastchange languageVersionCreateTimeInSeconds - version-createtime languageVersionStatus - version-status sumRating - version-rating firstReadTimeAndLastChange - versionfirstread mentionedInComment - “documents with unread comment” first/last, Only works with filter mentionedAccountIdInComment default: title the order by
  • orderDir possible: asc, desc default: asc the ordering direction
  • offset
  • limit

Produces

application/json
application/xml

List<[com.matterial.mtr.api.object.Document](91)>

  • 200 OK
  • 500 INTERNAL_SERVER_ERROR

Permission Login

Sample GET http://localhost:8080/mtr-backend/api/document?limit=1&count=true


Clipboard - Add

Add documents to session clipboard. URL PUT <application-url>/api/document/clipboard/add

Consumes

application/json
application/xml

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

Produces

text/plain

Integer - number of documents added to clipboard

  • 200 OK
  • 400 BAD_REQUEST
  • 500 INTERNAL_SERVER_ERROR

Permission Login

Sample PUT http://localhost:8080/mtr-backend/api/document/clipboard/add


Clipboard - Remove

Remove documents from session clipboard. URL PUT <application-url>/api/document/clipboard/remove

Consumes

application/json
application/xml

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

Produces

text/plain

Integer - number of documents removed from clipboard

  • 200 OK
  • 400 BAD_REQUEST
  • 500 INTERNAL_SERVER_ERROR

Permission Login

Sample PUT http://localhost:8080/mtr-backend/api/document/clipboard/remove


Clipboard - Clear

clear all documents from session clipboard. URL DELETE <application-url>/api/document/clipboard

Produces

text/plain

Integer - number of documents removed from clipboard

  • 200 OK
  • 400 BAD_REQUEST
  • 500 INTERNAL_SERVER_ERROR

Permission Login

Sample DELETE http://localhost:8080/mtr-backend/api/document/clipboard


Create snap

This interface creates a document, but compared to normal Create document this one adds:

  • checks permission CREATE_SNAP instead of EDIT_DOCUMENT
  • always adds all groups marked as initiallyAssigned
  • always adds add-prop snap
  • always adds a task, with
    • task.description = doc.title
    • task.assignee = doc.lastManuallyAssignedEditContentRole
  • try to publish the snap

URL POST <application-url>/api/document/snap

Query parameter

  • contextToken This token is used to identify all temporarily uploaded files (main-file, attachments)

Consumes

application/json
application/xml

com.matterial.mtr.api.object.Document

Produces

application/json
application/xml

com.matterial.mtr.api.object.Document

  • 201 CREATED
  • 400 BAD_REQUEST
  • 500 INTERNAL_SERVER_ERROR

Permission CREATE_SNAP

Sample POST http://localhost:8080/mtr-backend/api/document/snap


Create template

This creates a normal document, but:

  • Always sets the template-flag
  • Checks for EDIT_DOCUMENT_TEMPLATE-permission (instead of EDIT_DOCUMENT)
  • Does not check further document-rights
  • Does not add the current user into roleRights

URL POST <application-url>/api/document/template

Query parameter

  • contextToken This token is used to identify all temporarily uploaded files (main-file, attachments)
  • publishRequest possible values: unreviewed,reviewed,reviewRequested request for publishing

Consumes

application/json
application/xml

com.matterial.mtr.api.object.Document

Produces

application/json
application/xml

com.matterial.mtr.api.object.Document

  • 201 CREATED
  • 400 BAD_REQUEST
  • 500 INTERNAL_SERVER_ERROR

Permission EDIT_DOCUMENT_TEMPLATE

Sample POST http://localhost:8080/mtr-backend/api/document/template


Update template

This updates a template like a normal document, but:

  • Always sets the template-flag
  • Checks for EDIT_DOCUMENT_TEMPLATE-permission (instead of EDIT_DOCUMENT)
  • Does not check further document-rights
  • Does not add the current user into roleRights

URL PUT <application-url>/api/document/template/<documentId>

Path parameter

  • documentId The id of a specific document

Query parameter

  • contextToken This token is used to identify all temporarily uploaded files (main-file, attachments)
  • publishRequest possible values: unreviewed,reviewed,reviewRequested request for publishing

Consumes

application/json
application/xml

com.matterial.mtr.api.object.Document

Produces

application/json
application/xml

com.matterial.mtr.api.object.Document

  • 201 CREATED
  • 400 BAD_REQUEST
  • 500 INTERNAL_SERVER_ERROR

Permission EDIT_DOCUMENT_TEMPLATE

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


Update bio

This updates a template like a normal document, but:

  • Always sets the bio-flag
  • Checks for no permission (instead of EDIT_DOCUMENT)
  • Does not check further document-rights
  • Does only set the current user into roleRights and do not allow to update

URL PUT <application-url>/api/document/bio/<documentId>

Path parameter

  • documentId The id of a specific document

Query parameter

  • contextToken This token is used to identify all temporarily uploaded files (main-file, attachments)

Consumes

application/json
application/xml

com.matterial.mtr.api.object.Document

Produces

application/json
application/xml

com.matterial.mtr.api.object.Document

  • 201 CREATED
  • 400 BAD_REQUEST
  • 500 INTERNAL_SERVER_ERROR

Permission Login

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


Create document

URL POST <application-url>/api/document

Query parameter

  • contextToken This token is used to identify all temporarily uploaded files (main-file, attachments)
  • publishRequest possible values: unreviewed,reviewed,reviewRequested request for publishing
  • validBeginInSecondsRequest default: now request for valid-begin (only used while publishing)

Consumes

application/json
application/xml

com.matterial.mtr.api.object.Document

Produces

application/json
application/xml

com.matterial.mtr.api.object.Document

  • 201 CREATED
  • 400 BAD_REQUEST
  • 500 INTERNAL_SERVER_ERROR

Permission EDIT_DOCUMENT

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


Update document

URL PUT <application-url>/api/document/<documentId>

Path parameter

  • documentId The id of a specific document

Query parameter

  • contextToken This token is used to identify all temporarily uploaded files (main-file, attachments)
  • publishRequest possible values: unreviewed,reviewed,reviewRequested request for publishing
  • validBeginInSecondsRequest default: now request for valid-begin (only used while publishing)

Consumes

application/json
application/xml

com.matterial.mtr.api.object.Document

Produces

application/json
application/xml

com.matterial.mtr.api.object.Document

  • 201 CREATED
  • 400 BAD_REQUEST
  • 500 INTERNAL_SERVER_ERROR

Permission EDIT_DOCUMENT

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


Unsnap

Unsnap document: Closing related snap-task. URL DELETE <application-url>/api/document/<documentId>/language/<languageKey>/snap

Path parameter

  • documentId The id of a specific document
  • languageKey possible: de, en, fr, it, …

Produces

text/plain

Integer - count

  • 200 OK
  • 400 BAD_REQUEST
  • 500 INTERNAL_SERVER_ERROR

Permission EDIT_TASK

Sample DELETE http://localhost:8080/mtr-backend/api/document/8/language/fr/snap


Mark document language version as reviewed

URL PUT <application-url>/api/document/<documentId>/version/<documentLanguageVersionId>/review

Path parameter

  • documentId The id of a specific document
  • documentLanguageVersionId Id of the language-version

Produces

text/plain

Integer - count

  • 201 CREATED
  • 400 BAD_REQUEST
  • 403 FORBIDDEN
  • 500 INTERNAL_SERVER_ERROR

Permission Login

Sample PUT http://localhost:8080/mtr-backend/api/document/2/version/3/review


Decline review of language-version

URL PUT <application-url>/api/document/<documentId>/version/<documentLanguageVersionId>/reviewdecline

Path parameter

  • documentId The id of a specific document
  • documentLanguageVersionId Id of the language-version

Produces

text/plain

Integer - count

  • 200 OK
  • 400 BAD_REQUEST
  • 403 FORBIDDEN
  • 500 INTERNAL_SERVER_ERROR

Permission Login

Sample PUT http://localhost:8080/mtr-backend/api/document/2/version/3/reviewdecline


Decline review of language-version with task

The optional task should get at least the description and the assignedRoleId. URL PUT <application-url>/api/document/<documentId>/version/<documentLanguageVersionId>/reviewdecline

Path parameter

  • documentId The id of a specific document
  • documentLanguageVersionId Id of the language-version

Consumes

application/json
application/xml

com.matterial.mtr.api.object.Task

Produces

text/plain

Integer - count

  • 200 OK
  • 400 BAD_REQUEST
  • 403 FORBIDDEN
  • 500 INTERNAL_SERVER_ERROR

Permission Login

Sample PUT http://localhost:8080/mtr-backend/api/document/2/version/3/reviewdecline


Set additional properties

URL PUT <application-url>/api/document/<documentId>/additionalproperty

Path parameter

  • documentId The id of a specific document

Consumes

application/json
application/xml

List<[com.matterial.mtr.api.object.AdditionalProperty](152)>

Produces

text/plain

Integer - updated

  • 200 OK
  • 400 BAD_REQUEST
  • 500 INTERNAL_SERVER_ERROR

Permission EDIT_DOCUMENT

Sample PUT http://localhost:8080/mtr-backend/api/document/42/additionalproperty


Is following (logged-in account follows a document)

URL GET <application-url>/api/document/<documentId>/follow

Path parameter

  • documentId The id of a specific document

Query parameter

  • languageKey possible values: de, en, fr, it, … The language key

Produces

text/plain

Boolean - true / false

  • 200 OK
  • 400 BAD_REQUEST
  • 500 INTERNAL_SERVER_ERROR

Permission Login

Sample GET http://localhost:8080/mtr-backend/api/document/667/follow?languageKey=de


Follow document

If Query-Param accountId is not set at all, the currently logged-in account will be used. Multiple accountIds can be given to set them as followers, but to assign other accounts as follower the caller has to have edit-permission on this document. URL PUT <application-url>/api/document/<documentId>/follow

Path parameter

  • documentId The id of a specific document

Query parameter

  • languageKey mandatory: yes! possible values: de, en, fr, it, … The language key
  • accountId optional account ids (multiple allowed)

Produces

text/plain

Integer - count

  • 200 OK
  • 400 BAD_REQUEST
  • 500 INTERNAL_SERVER_ERROR

Permission Login

Sample PUT http://localhost:8080/mtr-backend/api/document/2/follow?languageKey=de


Follow document (other account)

URL PUT <application-url>/api/document/<documentId>/follow/byaccount/<accountId>

Path parameter

  • documentId The id of a specific document
  • accountId account id

Query parameter

  • languageKey mandatory: yes! possible values: de, en, fr, it, … The language key

Produces

text/plain

Integer - count

  • 200 OK
  • 400 BAD_REQUEST
  • 500 INTERNAL_SERVER_ERROR

Permission Login

Sample PUT http://localhost:8080/mtr-backend/api/document/2/follow/byaccount/3?languageKey=de


Unfollow document

If Query-Param accountId is not set at all, the currently logged-in account will be used. Multiple accountIds can be given to unset them as followers, but to unassign other accounts as follower the caller has to have edit-permission on this document. URL PUT <application-url>/api/document/<documentId>/unfollow

Path parameter

  • documentId The id of a specific document

Query parameter

  • languageKey mandatory: yes! possible values: de, en, fr, it, … The language key
  • accountId optional account ids (multiple allowed)

Produces

text/plain

Integer - count

  • 200 OK
  • 400 BAD_REQUEST
  • 500 INTERNAL_SERVER_ERROR

Permission Login

Sample PUT http://localhost:8080/mtr-backend/api/document/2/unfollow?languageKey=de


Unfollow document (other account)

URL PUT <application-url>/api/document/<documentId>/unfollow/byaccount/<accountId>

Path parameter

  • documentId The id of a specific document
  • accountId account id

Query parameter

  • languageKey mandatory: yes! possible values: de, en, fr, it, … The language key

Produces

text/plain

Integer - count

  • 200 OK
  • 400 BAD_REQUEST
  • 500 INTERNAL_SERVER_ERROR

Permission Login

Sample PUT http://localhost:8080/mtr-backend/api/document/2/unfollow/byaccount/3?languageKey=de


Archive document

URL PUT <application-url>/api/document/<documentId>/archive

Path parameter

  • documentId The id of a specific document

Query parameter

  • archivedBeginInSecondsRequest default: now archive begin

Produces

text/plain

Integer - count

  • 200 OK
  • 400 BAD_REQUEST
  • 500 INTERNAL_SERVER_ERROR

Permission EDIT_DOCUMENT

Sample PUT http://localhost:8080/mtr-backend/api/document/2/archive?archivedBeginInSecondsRequest=1502284958


Unarchive document

URL PUT <application-url>/api/document/<documentId>/unarchive

Path parameter

  • documentId The id of a specific document

Produces

text/plain

Integer - count

  • 200 OK
  • 400 BAD_REQUEST
  • 500 INTERNAL_SERVER_ERROR

Permission EDIT_DOCUMENT

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


Trash document

URL PUT <application-url>/api/document/<documentId>/trash

Path parameter

  • documentId The id of a specific document

Produces

text/plain

Integer - count

  • 200 OK
  • 400 BAD_REQUEST
  • 500 INTERNAL_SERVER_ERROR

Permission EDIT_DOCUMENT

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


Untrash document

URL PUT <application-url>/api/document/<documentId>/untrash

Path parameter

  • documentId The id of a specific document

Produces

text/plain

Integer - count

  • 200 OK
  • 400 BAD_REQUEST
  • 500 INTERNAL_SERVER_ERROR

Permission EDIT_DOCUMENT

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


Finally remove document

URL DELETE <application-url>/api/document/<documentId>

Path parameter

  • documentId The id of a specific document

Produces

text/plain

Integer - count

  • 200 OK
  • 400 BAD_REQUEST
  • 500 INTERNAL_SERVER_ERROR

Permission EDIT_DOCUMENT

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


Remove a specific version

Removes the language-version with all its db-relations and the related cas-file. It is only possible to remove versions, that are not “currentlyInProcessing”. URL DELETE <application-url>/api/document/<documentId>/version/<documentLanguageVersionId>

Path parameter

  • documentId The id of a specific document
  • documentLanguageVersionId The id of a specific document-language-version

Produces

text/plain

Integer - count

  • 200 OK
  • 400 BAD_REQUEST
  • 500 INTERNAL_SERVER_ERROR

Permission EDIT_DOCUMENT

Sample DELETE http://localhost:8080/mtr-backend/api/document/8/version/25


Remove a specific language

Removes all versions of a document by language-key with all its db-relations and the related cas-files. It is not possible to remove the last language. URL DELETE <application-url>/api/document/<documentId>/language/<languageKey>

Path parameter

  • documentId The id of a specific document
  • languageKey possible: de, en, fr, it, …

Produces

text/plain

Integer - count

  • 200 OK
  • 400 BAD_REQUEST
  • 500 INTERNAL_SERVER_ERROR

Permission EDIT_DOCUMENT

Sample DELETE http://localhost:8080/mtr-backend/api/document/8/language/fr


Cleanup trash

URL DELETE <application-url>/api/document

Query parameter

  • ignoreRemoveTime possible values: true, fals default: false if true, removes all documents in trash

Produces

text/plain

Integer - count of documents placed into removal-queue

  • 202 ACCEPTED
  • 500 INTERNAL_SERVER_ERROR

Permission SHOW_TRASH

Sample DELETE http://localhost:8080/mtr-backend/api/document


Get removal-queue-size

Get the current size of the removal-queue. URL GET <application-url>/api/document/removal/queue

Produces

text/plain

Integer - queue-size

  • 200 OK
  • 500 INTERNAL_SERVER_ERROR

Permission Login

Sample GET http://localhost:8080/mtr-backend/api/document/removal/queue


Reconvert document-language-version

Reconverts the main-file of a document-language-version and all of its attachments. This regenerates all pdfs and thumbnails even if they already exists. URL PUT <application-url>/api/document/<documentId>/version/<documentLanguageVersionId>/convert

Path parameter

  • documentId The id of a specific document
  • documentLanguageVersionId Id of the language-version

Produces

text/plain

Integer - count of document-language-versions

  • 200 OK
  • 500 INTERNAL_SERVER_ERROR

Permission EDIT_DOCUMENT

Sample PUT http://localhost:8080/mtr-backend/api/document/2/version/3/convert


Convert all document-language-versions

(Re)converts the main-file of all document-language-version and all of their attachments. If “regenerate=true” this regenerates all pdfs and thumbnails even if they already exists. URL PUT <application-url>/api/document/convert

Query parameter

  • regenerate possible values: true, false default: false if true, this regenerates all pdfs and thumbnails even if they already exists

Produces

text/plain

Integer - count of document-language-versions

  • 200 OK
  • 500 INTERNAL_SERVER_ERROR

Permission ADMINISTRATE_ALL

Sample PUT http://localhost:8080/mtr-backend/api/document/convert?regenerate=true


Get main-file by document-id

URL GET <application-url>/api/document/<documentId>/file

Path parameter

  • documentId The id of a specific document

Query parameter

  • languageKey possible values: de, en, fr, it, … default: de
  • markdownToHtml possible values: true, false default: false convert markdown into html
  • loadPdf possible values: true, false default: false get pdf
  • loadThumbnail possible values: true, false default: false get thumbnail

Produces File as stream

  • 200 OK
  • 500 INTERNAL_SERVER_ERROR

Permission Login

Sample GET http://localhost:8080/mtr-backend/api/document/2/file?languageKey=de


Get main-file by document-id and document-language-version-id

URL GET <application-url>/api/document/<documentId>/version/<documentLanguageVersionId>/file

Path parameter

  • documentId The id of a specific document
  • documentLanguageVersionId document-language-version-id

Query parameter

  • markdownToHtml possible values: true, false default: false convert markdown into html
  • loadPdf possible values: true, false default: false get pdf
  • loadThumbnail possible values: true, false default: false get thumbnail

Produces File as stream

  • 200 OK
  • 204 NO CONTENT
  • 404 NOT FOUND
  • 500 INTERNAL_SERVER_ERROR

Permission Login

Sample GET http://localhost:8080/mtr-backend/api/document/2/version/5/file


Get main-file for pdf-conversion

Load file by cas-id for pdf-conversion. Does only work on localhost. URL GET <application-url>/api/document/pdfconversion/<instanceName>/<documentLanguageVersionCasId>/file

Path parameter

  • instanceName AKA dataSourceName
  • documentLanguageVersionCasId

Produces File as stream

  • 200 OK
  • 403 FORBIDDEN
  • 500 INTERNAL_SERVER_ERROR

Permission localhost only

Sample GET http://localhost:8080/mtr-backend/api/document/pdfconversion/MtrDS/XXX/file


Compare main-files by document-language-version-ids

Compare two version of html-main-files by languageVersionId and results in a html-file which are marked with special classes (added/removed). URL GET <application-url>/api/document/compare/version/<oldDocumentLanguageVersionId>/<newDocumentLanguageVersionId>/file

Path parameter

  • oldDocumentLanguageVersionId The old document-language-version-id
  • newDocumentLanguageVersionId The new document-language-version-id

Produces File as stream

  • 200 OK
  • 404 NOT FOUND
  • 500 INTERNAL_SERVER_ERROR

Permission SHOW_DOCUMENT_VERSIONS_AND_COMPARE

Sample GET http://localhost:8080/mtr-backend/api/document/compare/version/5/6/file


Get attachments

URL GET <application-url>/api/document/<documentId>/attachment

Path parameter

  • documentId The id of a specific document

Query parameter

  • documentLanguageVersionId document-language-version-id
  • languageKey possible: de, en, fr, it, … default: de language key
  • orderBy possible: id - attachment-id name - attachment-name createtime - attachment-createtime default: name the order by
  • orderDir possible: asc, desc default: asc the ordering direction
  • offset
  • limit

Produces

application/json
application/xml

List<[com.matterial.mtr.api.object.Attachment](256)>

  • 200 OK
  • 500 INTERNAL_SERVER_ERROR

Permission Login

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


Get attachment by document-id, document-language-version-id, attachment-id

URL GET <application-url>/api/document/<documentId>/version/<documentLanguageVersionId>/attachment/<attachmentId>

Path parameter

  • documentId The id of a specific document
  • documentLanguageVersionId document-language-version-id
  • attachmentId attachment-id

Query parameter

  • size possible values: s, l, t s - small (400px width) l - large (800px width) t - thumbnail (200px width)
  • loadPdf possible values: true, false default: false get pdf
  • loadThumbnail possible values: true, false default: false get thumbnail
  • forceAttachment possible values: true, false default: false force ContentDisposition-Header: attachment

Produces File as stream

  • 200 OK
  • 204 NO CONTENT
  • 404 NOT FOUND
  • 500 INTERNAL_SERVER_ERROR

Permission Login

Sample GET http://localhost:8080/mtr-backend/api/document/90/version/2208/attachment/251


Get attachment by document-id, attachment-id

Loading attachment without languageVersionId URL GET <application-url>/api/document/<documentId>/attachment/<attachmentId>

Path parameter

  • documentId The id of a specific document
  • attachmentId attachment-id

Query parameter

  • size possible values: s, l, t s - small (400px width) l - large (800px width) t - thumbnail (200px width)
  • loadPdf possible values: true, false default: false get pdf
  • loadThumbnail possible values: true, false default: false get thumbnail
  • forceAttachment possible values: true, false default: false force ContentDisposition-Header: attachment

Produces File as stream

  • 200 OK
  • 204 NO CONTENT
  • 404 NOT FOUND
  • 500 INTERNAL_SERVER_ERROR

Permission Login

Sample GET http://localhost:8080/mtr-backend/api/document/90/version/2208/attachment/251

×
Peter's Problem.