REST - TempFile

REST-Interface

Get temp file (stream)

Loads tempfiles.

  • fileType: document will be loaded by contextToken and languageKey
  • fileType: attachment will be loaded by contextToken, fileToken and languageKey
  • fileType: contactimage will be loaded by contextToken and fileToken
  • fileType: logo will be loaded by contextToken and fileToken

URL GET <application-url>/api/tempfile/<fileType>/<contextToken>/<fileToken>

Path parameter

  • fileType possible: document, attachment, contactimage, logo the file type
  • contextToken the context token
  • fileToken the file token

Query parameter

  • languageKey possible: de, en, fr, it, … default: preferred language from account-setting This will be used for fileTypes document, attachment.
  • forceAttachment possible: true, false default: false force ContentDisposition-Header: attachment

Produces

  • 200 OK
  • 400 BAD_REQUEST
  • 500 INTERNAL_SERVER_ERROR

Permission Login

Sample GET http://localhost:8080/mtr-backend/api/tempfile/contactimage/a40d4d77-e006-4d0d-a3b2-e7d5c6e28e5c/d38185e3-22de-42d3-8467-7df06ebf44e0?languageKey=de


Upload temp file (multipart)

URL POST <application-url>/api/tempfile

Query parameter

parameter mandatory possible values default description
contextToken no - - generated token
languageKey no de, en, fr, it, … language-key with lowest “prio” (mostly ‘de’) the language key

Consumes

multipart/form-data

multipart-form

<form action="http://localhost:8080/kmx-backend/api/tempfile?contextToken=&amp;languageKey=de"
      method="post"
      enctype="multipart/form-data">
    <input name="document" type="file" /><br><br>
    <input name="attachment" type="file" multiple="multiple"/><br><br>
    <input name="contactimage" type="file" multiple="multiple"/><br><br>
    <input name="logo" type="file" /><br><br>
    <button name="submit" type="submit">Upload</button>
</form>

Produces

application/json
application/xml

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

  • 202 ACCEPTED
  • 400 BAD_REQUEST
  • 402 PAYMENT REQUIRED
  • 500 INTERNAL_SERVER_ERROR

Permission Login

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


Upload temp file (string)

URL POST <application-url>/api/tempfile

Query parameter

parameter mandatory possible values default description
contextToken no - - generated token
languageKey no de, en, fr, it, … language-key with lowest “prio” (mostly ‘de’) the language key

Consumes

text/plain

String - main-content

Produces

application/json
application/xml

com.matterial.mtr.api.object.TempFileDescriptor

  • 202 ACCEPTED
  • 400 BAD_REQUEST
  • 500 INTERNAL_SERVER_ERROR

Permission Login

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


Remove temp files

Remove temp files by contextToken. URL DELETE <application-url>/api/tempfile/<contextToken>

Path parameter

  • contextToken

Produces

  • 202 ACCEPTED
  • 400 BAD_REQUEST
  • 500 INTERNAL_SERVER_ERROR

Permission Login

Sample DELETE http://localhost:8080/mtr-backend/api/tempfile/d38185e3-22de-42d3-8467-7df06ebf44e0


Remove temp file

URL DELETE <application-url>/api/tempfile/<fileType>/<contextToken>/<fileToken>

Path parameter

parameter mandatory possible values default description
fileType yes - - the file type
contextToken yes - - the context token
fileToken yes - - the file token

Query parameter

parameter mandatory possible values default description
languageKey no de, en, fr, it, … language-key with lowest “prio” (mostly ‘de’) the language key

Produces

  • 202 ACCEPTED
  • 400 BAD_REQUEST
  • 500 INTERNAL_SERVER_ERROR

Permission Login

Sample DELETE http://localhost:8080/mtr-backend/api/tempfile/contactimage/a40d4d77-e006-4d0d-a3b2-e7d5c6e28e5c/d38185e3-22de-42d3-8467-7df06ebf44e0?languageKey=de


Remove temp file

URL DELETE <application-url>/api/tempfile

Consumes

application/json
application/xml

com.matterial.mtr.api.object.TempFileDescriptor

Produces

  • 202 ACCEPTED
  • 400 BAD_REQUEST
  • 500 INTERNAL_SERVER_ERROR

Permission Login

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

×