Zurück zur Übersicht » REST - Person

REST - Person

REST-Interface

Get person by accountid

URL
GET <application-url>/api/person/byaccount/<accountId>

Path parameter

Query parameter

Produces

application/json
application/xml

com.matterial.mtr.api.object.Person

Permission
Login

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


Get person by contactid

URL
GET <application-url>/api/person/bycontact/<contactId>

Path parameter

Query parameter

Produces

application/json
application/xml

com.matterial.mtr.api.object.Person

Permission
Login

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


Get persons

URL
GET <application-url>/api/person

Query parameter

Produces

application/json
application/xml

com.matterial.mtr.api.object.ListResult<Person>

Permission
Login

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


Get CSV

Get csv-export of filtered persons. This will be UTF-8 encoded.
URL
GET <application-url>/api/person/csv

Query parameter

Produces
CSV-file (.csv)

Permission
instanceOwnerRequired + ADMINISTRATE_ALL

Sample
GET http://localhost:8080/mtr-backend/api/person/csv


Get VCards

Export of filtered persons as vcards (v4.0).
According to rfc6350 “UTF-8 is now the only possible character set.”
URL
GET <application-url>/api/person/vcard

Query parameter

Produces
VCARD-file (.vcf)

Permission
instanceOwnerRequired + ADMINISTRATE_ALL

Sample
GET http://localhost:8080/mtr-backend/api/person/vcard


Get VCard by contact

Export of person by contactId as vcard (v4.0).
According to rfc6350 “UTF-8 is now the only possible character set.”
URL
GET <application-url>/api/person/bycontact/<contactId>/vcard

Path parameter

parameter mandatory possible values default description
contactId yes - - contact-id

Produces
VCARD-file (.vcf)

Permission
Login

Sample
GET http://localhost:8080/mtr-backend/api/person/bycontact/2/vcard


Create person

URL
POST <application-url>/api/person

Query parameter

parameter possible values default description
contextToken context-token for temp-file-upload (ContactImages)

Consumes

application/json
application/xml

com.matterial.mtr.api.object.Person

Produces

application/json
application/xml

com.matterial.mtr.api.object.Person

Permission
EDIT_PERSON

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


Update person

URL
PUT <application-url>/api/person/byaccount/<accountId>

Path parameter

Query parameter

Consumes

application/json
application/xml

com.matterial.mtr.api.object.Person

Produces

application/json
application/xml

com.matterial.mtr.api.object.Person

Permission
EDIT_PERSON

Sample
PUT http://localhost:8080/mtr-backend/api/person/byaccount/8


Set instance-owner-flag

URL
PUT <application-url>/api/person/byaccount/<accountId>/instanceowner

Path parameter

parameter mandatory possible values default description
accountId yes - - account-id

Produces

text/plain

Integer - updated

Permission
instanceOwnerRequired, EDIT_PERSON

Sample
PUT http://localhost:8080/mtr-backend/api/person/byaccount/8/instanceowner


Unset instance-owner-flag

URL
DELETE <application-url>/api/person/byaccount/<accountId>/instanceowner

Path parameter

parameter mandatory possible values default description
accountId yes - - account-id

Produces

text/plain

Integer - updated

Permission
instanceOwnerRequired, EDIT_PERSON

Sample
DELETE http://localhost:8080/mtr-backend/api/person/byaccount/8/instanceowner


Set demo-flag

URL
PUT <application-url>/api/person/byaccount/<accountId>/demo

Path parameter

Produces

text/plain

Integer - updated

Permission
instanceOwnerRequired, EDIT_PERSON

Sample
PUT http://localhost:8080/mtr-backend/api/person/byaccount/8/demo


Unset demo-flag

URL
DELETE <application-url>/api/person/byaccount/<accountId>/demo

Path parameter

Produces

text/plain

Integer - updated

Permission
instanceOwnerRequired, EDIT_PERSON

Sample
DELETE http://localhost:8080/mtr-backend/api/person/byaccount/8/demo


Set limited-flag

Downgrading an account as limited. Such accounts have limited permissions. Related roles have no effect. Limited accounts currently only get the permission comment.

URL
PUT <application-url>/api/person/byaccount/<accountId>/limited

Path parameter

Produces

text/plain

Integer - updated

Permission
instanceOwnerRequired, EDIT_PERSON

Sample
PUT http://localhost:8080/mtr-backend/api/person/byaccount/8/limited


Unset limited-flag

Upgrading an account as unlimited. Such accounts have permissions according to their related roles.

URL
DELETE <application-url>/api/person/byaccount/<accountId>/limited

Path parameter

Produces

text/plain

Integer - updated

Permission
instanceOwnerRequired, EDIT_PERSON

Sample
DELETE http://localhost:8080/mtr-backend/api/person/byaccount/8/limited


Update personal-data

Updates data of a person for current logged-in account. Personal-data includes Addresses, CommunicationData, and ContactImages.
URL
PUT <application-url>/api/person/personaldata

Query parameter

Consumes

application/json
application/xml

com.matterial.mtr.api.object.Person

Produces

application/json
application/xml

com.matterial.mtr.api.object.LoginData

Permission
Login

Sample
PUT http://localhost:8080/mtr-backend/api/person/personaldata


Remove person

Remove a person (account) from current client.
Special behaviour for multipleInstanceInstallation:
Additionally only instance-admins are allowed to remove persons!
This removes a person (account) also from current client (because there should only be one per instance) and removes the person (credential) from current instance.
URL
DELETE <application-url>/api/person/byaccount/<accountId>

Path parameter

parameter mandatory possible values default description
accountId yes - - account-id

Produces

text/plain

Integer - count of removed

Permission
EDIT_PERSON + instanceOwnerRequired (on multipleInstanceInstallation)

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


Reconvert contact-images of a person

Reconverts the contact-images of a person. This regenerates all thumbnails even if they already exists.
URL
PUT <application-url>/api/person/bycontact/<contactId>/convert

Path parameter

parameter mandatory possible values default description
contactId yes - - contact-id

Produces

text/plain

Integer - count of contacts

Permission
EDIT_PERSON

Sample
PUT http://localhost:8080/mtr-backend/api/person/bycontact/2/convert


Convert contact-images of all persons

(Re)converts the contact-images of all persons. If “regenerate=true” this regenerates all thumbnails even if they already exists.

URL
PUT <application-url>/api/person/convert

Query parameter

parameter possible values default description
regenerate true, false false if true, this regenerates all thumbnails even if they already exists

Produces

text/plain

Integer - count of contacts

Permission
ADMINISTRATE_ALL

Sample
PUT http://localhost:8080/mtr-backend/api/person/convert


Get contact-image by contact-id and contact-image-id

URL
GET <application-url>/api/person/bycontact/<contactId>/contactimage/<contactImageId>

Path parameter

parameter possible values default description
contactId - - contact-id
contactImageId - - contact-image-id

Query parameter

parameter possible values default description
loadPdf true, false false get pdf
loadThumbnail true, false false get thumbnail

Produces
ContactImage as stream

Permission
Login

Sample
GET http://localhost:8080/mtr-backend/api/person/bycontact/2/contactimage/3