REST - Category
REST-Interface
Get category by id
URL
GET <application-url>/api/category/<categoryId>
Path parameter
- categoryId
Query parameter
-
languageKey
possible: de, en, fr, it, …
default: de
The requested language -
loadUsage
load usage-count of categories. -
loadFollowingLanguageKey
possible: de, en, fr, it, …
Requesting a language key will fillCategory.following
for current account.
Produces
application/json
application/xml
com.matterial.mtr.api.object.Category
- 200 OK
- 400 BAD_REQUEST
- 404 NOT_FOUND
- 500 INTERNAL_SERVER_ERROR
Permission
Login
Sample
GET http://localhost:8080/mtr-backend/api/category/7?languageKey=de
Get categories by categorytypeid
URL
GET <application-url>/api/category/bytype/<categoryTypeId>
Path parameter
- categoryTypeId
Query parameter
-
languageKey
possible: de, en, fr, it, …
default: de
The requested language -
quick
possible: true, false
default: “all”
true: only “quick”
false: only “no quick” -
loadUsage
load usage-count of categories.
Important: Only if loadUsage:true, orderby “usage” will be possible. -
loadFollowingLanguageKey
possible: de, en, fr, it, …
Requesting a language key will fillCategory.following
for current account. -
orderBy
possible:
id
name
categorytypeid
usage (only if loadUsage:true)
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.Category>
- 200 OK
- 500 INTERNAL_SERVER_ERROR
Permission
Login
Sample
GET http://localhost:8080/mtr-backend/api/category/bytype/1
Get categories
URL
GET <application-url>/api/category
Query parameter
-
languageKey
possible: de, en, fr, it, …
default: de
The requested language - categoryId
- categoryTypeId
-
quick
possible: true, false
default: “all”
true: only “quick”
false: only “no quick” -
personal
possible: true, false
default: “all”
true: only my personal
false: only “public” -
loadUsage
load usage-count of categories.
Important: Only if loadUsage:true, orderby “usage” will be possible. -
loadFollowingLanguageKey
possible: de, en, fr, it, …
Requesting a language key will fillCategory.following
for current account. -
orderBy
possible:
id
name
categorytypeid
usage (only if loadUsage:true)
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.Category>
- 200 OK
- 500 INTERNAL_SERVER_ERROR
Permission
Login
Sample
GET http://localhost:8080/mtr-backend/api/category?categoryTypeId=1
Create category
URL
POST <application-url>/api/category
Query parameter
-
languageKey
possible: de, en, fr, it, …
default: de
The requested language
Consumes
application/json
application/xml
com.matterial.mtr.api.object.Category
Produces
application/json
application/xml
com.matterial.mtr.api.object.Category (id only)
- 201 CREATED
- 400 BAD_REQUEST
- 500 INTERNAL_SERVER_ERROR
Permission
EDIT_CATEGORY
Sample
POST http://localhost:8080/mtr-backend/api/category
Update category
URL
PUT <application-url>/api/category/<categoryId>
Path parameter
- categoryId
Query parameter
-
languageKey
possible: de, en, fr, it, …
default: de
The requested language
Consumes
application/json
application/xml
com.matterial.mtr.api.object.Category
Produces
application/json
application/xml
com.matterial.mtr.api.object.Category (id only)
- 201 CREATED
- 400 BAD_REQUEST
- 500 INTERNAL_SERVER_ERROR
Permission
EDIT_CATEGORY
Sample
PUT http://localhost:8080/mtr-backend/api/category/8
Remove category
URL
DELETE <application-url>/api/category/<categoryId>
Path parameter
- categoryId
Produces
text/plain
Integer - count of removed
- 200 OK
- 400 BAD_REQUEST
- 404 NOT_FOUND
- 500 INTERNAL_SERVER_ERROR
Permission
EDIT_CATEGORY
Sample
DELETE http://localhost:8080/mtr-backend/api/category/9
Remove categories by categorytypeid
URL
DELETE <application-url>/api/category/bytype/<categoryTypeId>
Path parameter
- categoryTypeId
Produces
text/plain
Integer - count of removed
- 200 OK
- 400 BAD_REQUEST
- 404 NOT_FOUND
- 500 INTERNAL_SERVER_ERROR
Permission
EDIT_CATEGORY
Sample
DELETE http://localhost:8080/mtr-backend/api/category/bytype/1
Is following (logged-in account follows a category)
URL
GET <application-url>/api/category/<categoryId>/follow
Path parameter
- categoryId
Query parameter
-
languageKey
possible: de, en, fr, it, …
default: de
mandatory: yes
The requested language
Produces
text/plain
Boolean - true, if following this category in language
- 200 OK
- 400 BAD_REQUEST
- 500 INTERNAL_SERVER_ERROR
Permission
Login
Sample
GET http://localhost:8080/mtr-backend/api/category/2/follow?languageKey=de
Follow category (logged-in account)
URL
PUT <application-url>/api/category/<categoryId>/follow
Path parameter
- categoryId
Query parameter
-
languageKey
possible: de, en, fr, it, …
default: de
mandatory: yes
The requested language
Produces
text/plain
Integer - count of updates
- 200 OK
- 400 BAD_REQUEST
- 500 INTERNAL_SERVER_ERROR
Permission
Login
Sample
PUT http://localhost:8080/mtr-backend/api/category/2/follow?languageKey=de
Follow category (other account)
URL
PUT <application-url>/api/category/<categoryId>/follow/byaccount/<accountId>
Path parameter
- categoryId
- accountId
Query parameter
-
languageKey
possible: de, en, fr, it, …
default: de
mandatory: yes
The requested language
Produces
text/plain
Integer - count of updates
- 200 OK
- 400 BAD_REQUEST
- 500 INTERNAL_SERVER_ERROR
Permission
Login
Sample
PUT http://localhost:8080/mtr-backend/api/category/2/follow/byaccount/3?languageKey=de
Unfollow category (logged-in account)
URL
PUT <application-url>/api/category/<categoryId>/unfollow
Path parameter
- categoryId
Query parameter
-
languageKey
possible: de, en, fr, it, …
default: de
mandatory: yes
The requested language
Produces
text/plain
Integer - count of updates
- 200 OK
- 400 BAD_REQUEST
- 500 INTERNAL_SERVER_ERROR
Permission
Login
Sample
PUT http://localhost:8080/mtr-backend/api/category/2/unfollow?languageKey=de
Unfollow category (other account)
URL
PUT <application-url>/api/category/<categoryId>/unfollow/byaccount/<accountId>
Path parameter
- categoryId
- accountId
Query parameter
-
languageKey
possible: de, en, fr, it, …
default: de
mandatory: yes
The requested language
Produces
text/plain
Integer - count of updates
- 200 OK
- 400 BAD_REQUEST
- 500 INTERNAL_SERVER_ERROR
Permission
Login
Sample
PUT http://localhost:8080/mtr-backend/api/category/2/unfollow/byaccount/3?languageKey=de
Add category to document(s)
URL
PUT <application-url>/api/category/<categoryId>/assign
Path parameter
- categoryId
Query parameter
-
documentId
mandatory: yes
document-id
Produces
text/plain
Integer - count of updates
- 200 OK
- 400 BAD_REQUEST
- 500 INTERNAL_SERVER_ERROR
Permission
Login
Sample
PUT http://localhost:8080/mtr-backend/api/category/2/assign?documentId=1
Add quick-category to document(s)
URL
PUT <application-url>/api/category/quick/assign
Query parameter
-
documentId
mandatory: yes
document-id
Produces
text/plain
Integer - count of updates
- 200 OK
- 400 BAD_REQUEST
- 500 INTERNAL_SERVER_ERROR
Permission
Login
Sample
PUT http://localhost:8080/mtr-backend/api/category/quick/assign?documentId=1
Remove category from document(s)
URL
DELETE/PUT <application-url>/api/category/<categoryId>/unassign
Path parameter
- categoryId
Query parameter
-
documentId
mandatory: yes
document-id
Produces
text/plain
Integer - count of updates
- 200 OK
- 400 BAD_REQUEST
- 500 INTERNAL_SERVER_ERROR
Permission
Login
Sample
PUT http://localhost:8080/mtr-backend/api/category/2/unassign?documentId=1
Remove my quick-category from document(s)
URL
DELETE/PUT <application-url>/api/category/quick/unassign
Query parameter
-
documentId
mandatory: yes
document-id
Produces
text/plain
Integer - count of updates
- 200 OK
- 400 BAD_REQUEST
- 500 INTERNAL_SERVER_ERROR
Permission
Login
Sample
PUT http://localhost:8080/mtr-backend/api/category/quick/unassign?documentId=1