Upload file to an attachment entry
PATCH {{baseUrl}}/.api2/api/v1/communities/:communityKey/attachments/uploads/:attachmentKey
This endpoint can do one of three things, depending on the Content Range provided.
Upload a File
If a content range is specified, the binary file in the body of the call will be appended on any existing data in the attachment entry. This can be used to upload a file from start to finish, or resume an incomplete upload.
To perform a complete file upload, the content range must start at 0, and must match the size of the file in the body of the request.
Resume an incomplete upload
To resume an incomplete upload, the content range needs to start at the end of the data that is already uploaded to the server. For example, if there are already 1024 bytes of data in this attachment entry, then the content range must start at byte 1024, since bytes are 0-indexed.
Query the status of an upload
HEADERS
| Key | Datatype | Required | Description |
| Content-Range
| string | | (Required) - Content range
The content range for the file being uploaded, in bytes.
(Format)
bytes 0-(Content-Length - 1)/Content-Length
The format is case-sensative with no spaces in between. |
| Content-Length
| string | | (Required) - Integer
The size, in bytes of the file being uploaded/ |
| Content-Type
| string | | (Required) - MIME Type
The file type of the image being uploaded.
Accepts:
- image/jpg
- image/png
- image/gif |
|
Accept
| string | | The type of response data to request. This endpoint will respond with JSON.
The only option is:
- application/json |
RESPONSES
status: OK
"{\n \"key\": \"{{$randomBankAccountBic}}\",\n \"contentLength\": {{$randomInt}},\n \"contentType\": \"image/{type}\",\n \"binaryLocation\": \"/.api2/binaries/5GQFODh5bI/download/profilepic\",\n \"thumbnailLocation\": \"/.api2/binaries/5GQFODh5bI/thumbnails/profilepic\",\n \"name\": \"profilepic\",\n \"isProfilePhoto\": false\n}"