Download Multipart or Large Files

If the BP has large drawing and 3d Model files as attachments and downloading all the attachments in the BP is not possible, you can "Fetch" a list of attachments (in the BP) first, determine which files you need, and proceed to download those needed attachments.

This service will enable third-party applications to fetch just a list of the BP attachments (and any updates because of subsequent changes to the list) to determine which attachments to download.

Fetch all Attachments in a Record as Multipart

GET /ws/rest/service/v1/bp/record/multipart/file

Purpose

To provide the attachments as a multipart file in the response along with the BP details and get all the attachments in a record as a zip file as a multipart octet-stream response.

After you save the response, it will be saved as a zip file with name as <<model name>>_<<record number>>_<<random number>>_attachments.zip, for example: Purchase Orders_PO-0115_0_attachments.zip.

The zip file maintains folder structure inside as "Attachments" folder for the upper form level attachments. Inside the folder the " lineitems_0_1" folder for the line items level attachments.

A folder will be created for the comment level attachments under the zip file: "gc_attachments."

The response content type will be application/octet-stream (sent with the header file), and the response cannot be parsed as JSON data (the response will not contain the record information).

The new multipart endpoint is implemented to handle large file download, similar to the downloading of large files in Document Manager.

Request Parameters

All parameters should be URL encoded.

Mandatory

  • "projectNumber"
  • "bpname"
  • "record_no"

Optional

"lineitem"

If the "lineitem" is set as "no", the lineitem-related attachments will not be pulled.

filter_condition

input= {

"projectNumber":"P-0001",

"bpname":"Action Items",

"record_no":"AI-000017",

"lineitem":"yes"

}

Add the filter condition with the above request parameters.

Response Format

An octet-stream of the attachments zip along with a JSON object is returned in the following format.

{

"data": [],

"message": [],

"status": <REST status code value>

}

A successful response displays a status code 200.

A failed response displays a message with a status code.

Note:

The output is in octet-stream format, which only has arbitrary binary data.

Response Header

The following table contains the response header details.

Header (5)

Status Code: 200 OK

Key Value
Connection close
Date Wed, 12 Oct 2022 06:12:27 GMT
Transfer-Encoding chunked
Content-Type The “Content-Type” header parameter would be the application/Octet-stream.
Content-Disposition The “Content-Disposition” header parameter would be the attachment details, such as the file name, in standard and UTF8 formats. For example: attachment; filename="Action Items_AI-000017_0_attachments.zip";filename*=utf-8''Action%20Items_AI-000017_0_attachments.zip