Role application archive file (attachment)

Requests

HTTP verb Endpoint Description

GET

/rest/v1/domain/roleapps/<id>/attachment

Downloading the file

PUT

/rest/v1/domain/roleapps/<id>/attachment

Uploading a new file

DELETE

/rest/v1/domain/roleapps/<id>/attachment

Deleting the file

HEAD

/rest/v1/domain/roleapps/<id>/attachment

Getting file metadata


Downloading the file

Request

Table 1. Request parameters
Name Type Description

attachment

bool

Output type. Default false.

true – returned with the header Content-Disposition: attachment; filename=filename.ext or Content-Disposition: attachment; filename*=UTF-8''%d1%84%d0%b0%d0%b9%d0%bb.ext, where file.ext is the file name in UTF-8 encoding and URL-encoded.

false – returned without the Content-Disposition header.

Example request
GET /rest/v1/domain/roleapps/68f99ca9-016c-d352-e02f-50e54938780c/attachment HTTP/1.1

Response

Example response
HTTP/1.1 200 OK
Content-Type: application/octet-stream; charset=utf-8
Content-Disposition: attachment; filename*=UTF-8''Web%20Application%201.zip

BINARY BODY OF 'Web Application 1.zip'

Uploading a new file

Replaces the file.

A single file is uploaded either with Content-Type: multipart/formdata or with an arbitrary non-multipart Content-Type.

If the upload uses Content-Type: multipart/formdata, only the first file is saved (the first part having a filename field in the Content-Disposition header), and the file name itself is ignored.

Request

Example request (octet-stream)
PUT /rest/v1/domain/roleapps/68f99ca9-016c-d352-e02f-50e54938780c/attachment HTTP/1.1
Content-Type: application/octet-stream

BINARY BODY OF 'app.zip'
Example request (multipart)
PUT /rest/v1/domain/roleapps/68f99ca9-016c-d352-e02f-50e54938780c/attachment HTTP/1.1
Content-Type: multipart/form-data; boundary=-----------boundary_69df8120352a996e

-----------boundary_69df8120352a996e
Content-Type: application/octet-stream
Content-Disposition: form-data; name="abcde"; filename="app.zip"
Content-Transfer-Encoding: binary

BINARY BODY OF 'app.zip'
-----------boundary_69df8120352a996e--

Response

Example response
HTTP/1.1 204 No Content

Deleting the file

Request

Example request
DELETE /rest/v1/domain/roleapps/68f99ca9-016c-d352-e02f-50e54938780c/attachment HTTP/1.1

Response

Example response
HTTP/1.1 204 No Content

Getting file metadata

Returns file metadata, including the size in the Content-Length header.

Specifics

  • The HTTP response contains no body despite the presence of the Content-Length header.

Request

Example request
HEAD /rest/v1/domain/roleapps/4bfe3429-016d-0d12-cade-e0d55e0cd303/attachment?attachment=true HTTP/1.1

Response

Example successful response
HTTP/1.1 200 OK
Content-Type: application/octet-stream
Content-Disposition: attachment; filename=roleapp_4bfe3429-016d-0d12-cade-e0d55e0cd303.zip
Content-Length: 25389
Example failed response
HTTP/1.1 404 Not Found