### Initiate Document Selection (OpenCDE API) Source: https://context7.com/buildingsmart/opencde-api/llms.txt Starts a browser-based document selection interface for single or multiple documents. It returns selected document references via a specified callback URL. Requires an Authorization header with a Bearer token. ```bash # Start single document selection curl -X GET "https://bim.aconex.com/cde/0.1/documents/select-documents?select_mode=single&callback_url=http://localhost:3000/callback" \ -H "Authorization: Bearer YOUR_ACCESS_TOKEN" # Response: HTML page (302 redirect to CDE selection UI) # After user selects document, browser redirects to: # http://localhost:3000/callback?document_url=https://bim.aconex.com/documents-api/documents/1879048400.cbf75754784c428da6c3043021585860/versions/793f227a9c2847969b7a845b95eb8a0f # Start multi-document selection curl -X GET "https://bim.aconex.com/cde/0.1/documents/select-documents?select_mode=multi&callback_url=http://localhost:3000/callback" \ -H "Authorization: Bearer YOUR_ACCESS_TOKEN" # Response: HTML page for multi-select # After selection, callback receives multiple document_url parameters ``` -------------------------------- ### GET /documents-api/documents/{documentId}/versions/{documentVersion} Source: https://github.com/buildingsmart/opencde-api/blob/master/cde_file_handling/sequence_document_download.txt Fetches a document reference, which includes URLs for content, metadata, and versions. This is typically called after a document has been selected. ```APIDOC ## GET /documents-api/documents/{documentId}/versions/{documentVersion} ### Description Retrieves a reference to a specific document version, containing URLs for accessing its content, metadata, and other versions. ### Method GET ### Endpoint /documents-api/documents/{documentId}/versions/{documentVersion} ### Parameters #### Path Parameters - **documentId** (string) - Required - The unique identifier of the document. - **documentVersion** (string) - Required - The specific version of the document to retrieve. ### Response #### Success Response (200) - **contentUrl** (string) - URL to download the file content. - **metadataUrl** (string) - URL to access document metadata. - **versionsUrl** (string) - URL to access other versions of the document. ``` -------------------------------- ### Start Document Upload Session - Bash Source: https://context7.com/buildingsmart/opencde-api/llms.txt Initiates a new document upload session. This POST request returns links for subsequent steps like registering files and uploading metadata. It requires an authorization token and sets the content type to JSON. ```bash # Start upload session curl -X POST "https://bim.aconex.com/cde/0.1/documents/upload-documents" \ -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \ -H "Content-Type: application/json" \ -H "Accept: application/hal+json" ``` -------------------------------- ### GET {contentUrl} Source: https://github.com/buildingsmart/opencde-api/blob/master/cde_file_handling/sequence_document_download.txt Downloads the actual file content of a document using the content URL obtained from the document reference. ```APIDOC ## GET {contentUrl} ### Description Downloads the file content of a document. The `{contentUrl}` is provided in the response of the document reference endpoint. ### Method GET ### Endpoint {contentUrl} ### Parameters #### Query Parameters - **contentUrl** (string) - Required - The URL pointing to the document's content, obtained from the document reference. ### Response #### Success Response (200) - **File content** (binary) - The actual content of the document file. ``` -------------------------------- ### Get Document Versions - Bash Source: https://context7.com/buildingsmart/opencde-api/llms.txt Fetches a list of all available versions for a specific document. This is useful for accessing the version history of a document. It requires an authorization token and specifies the 'application/hal+json' accept header. ```bash # Fetch all document versions curl -X GET "https://bim.aconex.com/documents-api/documents/1879048400.cbf75754784c428da6c3043021585860/versions" \ -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \ -H "Accept: application/hal+json" ``` -------------------------------- ### Get Document Reference Source: https://context7.com/buildingsmart/opencde-api/llms.txt Retrieves the metadata and HAL links for a specific document version. These links provide access to download content, associated metadata, and version history. ```APIDOC ## GET /documents-api/documents/{document_id}/versions/{version_id} ### Description Retrieves the metadata and hypermedia links (HAL) for a specific document version. This includes links to download content, access metadata, and view version history. ### Method GET ### Endpoint `/documents-api/documents/{document_id}/versions/{version_id}` ### Path Parameters - **document_id** (string) - Required - The unique identifier of the document. - **version_id** (string) - Required - The unique identifier of the document version. ### Headers - **Accept**: `application/hal+json` - Specifies that the client expects a HAL+JSON response. ### Request Example ```bash curl -X GET "https://bim.aconex.com/documents-api/documents/1879048400.cbf75754784c428da6c3043021585860/versions/793f227a9c2847969b7a845b95eb8a0f" \ -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \ -H "Accept: application/hal+json" ``` ### Response #### Success Response (200 OK) Returns a HAL+JSON object containing document version details and links to related resources. #### Response Example ```json { "_links": { "self": { "href": "https://bim.aconex.com/documents-api/documents/1879048400.cbf75754784c428da6c3043021585860/versions/793f227a9c2847969b7a845b95eb8a0f" }, "metadata": { "href": "https://bim.aconex.com/documents-api/documents/1879048400.cbf75754784c428da6c3043021585860/versions/793f227a9c2847969b7a845b95eb8a0f/metadata" }, "versions": { "href": "https://bim.aconex.com/documents-api/documents/1879048400.cbf75754784c428da6c3043021585860/versions" }, "content": { "href": "https://bim.aconex.com/bim/api/projects/1879048400/models/cbf75754784c428da6c3043021585860/revisions/793f227a9c2847969b7a845b95eb8a0f/contents" } }, "version": "1.0", "version_date": "2019-11-04T04:46:55.880Z", "title": "Office Architecture Model", "file_description": { "size_in_bytes": 4099307, "name": "Office Arch.ifc" } } ``` ``` -------------------------------- ### GET /documents/{documentId}/versions Source: https://context7.com/buildingsmart/opencde-api/llms.txt Retrieves a list of all available versions for a specified document, ordered chronologically. This endpoint allows clients to access the version history of a document. ```APIDOC ## GET /documents/{documentId}/versions ### Description Lists all available versions of a document in ascending order, allowing clients to access version history. ### Method GET ### Endpoint `/documents/{documentId}/versions` ### Parameters #### Path Parameters - **documentId** (string) - Required - The unique identifier of the document. ### Request Example ```bash curl -X GET "https://bim.aconex.com/documents-api/documents/1879048400.cbf75754784c428da6c3043021585860/versions" \ -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \ -H "Accept: application/hal+json" ``` ### Response #### Success Response (200) - **_links** (object) - Links to related resources, including self and document reference. - **_embedded** (object) - Contains the list of document versions. - **documentReferenceList** (array) - A list of document version objects. - **_links** (object) - Links specific to each document version. - **version** (string) - The version number of the document. - **version_date** (string) - The date and time the version was created. - **title** (string) - The title of the document version. - **file_description** (object) - Details about the file. - **size_in_bytes** (integer) - The size of the file in bytes. - **name** (string) - The name of the file. #### Response Example ```json { "_links": { "self": { "href": "https://bim.aconex.com/documents-api/documents/1879048400.cbf75754784c428da6c3043021585860/versions" } }, "_embedded": { "documentReferenceList": [ { "_links": { "self": { "href": "https://bim.aconex.com/documents-api/documents/1879048400.cbf75754784c428da6c3043021585860/versions/abc123" }, "content": { "href": "https://bim.aconex.com/bim/api/projects/1879048400/models/cbf75754784c428da6c3043021585860/revisions/abc123/contents" } }, "version": "0.9", "version_date": "2019-10-15T10:30:00.000Z", "title": "Office Architecture Model - Draft", "file_description": { "size_in_bytes": 3850000, "name": "Office Arch.ifc" } }, { "_links": { "self": { "href": "https://bim.aconex.com/documents-api/documents/1879048400.cbf75754784c428da6c3043021585860/versions/793f227a9c2847969b7a845b95eb8a0f" }, "content": { "href": "https://bim.aconex.com/bim/api/projects/1879048400/models/cbf75754784c428da6c3043021585860/revisions/793f227a9c2847969b7a845b95eb8a0f/contents" } }, "version": "1.0", "version_date": "2019-11-04T04:46:55.880Z", "title": "Office Architecture Model", "file_description": { "size_in_bytes": 4099307, "name": "Office Arch.ifc" } } ] } } ``` ``` -------------------------------- ### Get Document Metadata Source: https://context7.com/buildingsmart/opencde-api/llms.txt Retrieves extended metadata fields for a specific document version, including custom attributes and their data types. ```APIDOC ## GET /documents-api/documents/{document_id}/versions/{version_id}/metadata ### Description Retrieves extended metadata fields for a document version. This endpoint provides access to custom attributes and their associated data types beyond the basic information returned by `Get Document Reference`. ### Method GET ### Endpoint `/documents-api/documents/{document_id}/versions/{version_id}/metadata` ### Path Parameters - **document_id** (string) - Required - The unique identifier of the document. - **version_id** (string) - Required - The unique identifier of the document version. ### Headers - **Accept**: `application/hal+json` - Specifies that the client expects a HAL+JSON response. ### Request Example ```bash curl -X GET "https://bim.aconex.com/documents-api/documents/1879048400.cbf75754784c428da6c3043021585860/versions/793f227a9c2847969b7a845b95eb8a0f/metadata" \ -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \ -H "Accept: application/hal+json" ``` ### Response #### Success Response (200 OK) Returns a HAL+JSON object containing detailed metadata for the document version. #### Response Example ```json { "_links": { "self": { "href": "https://bim.aconex.com/documents-api/documents/1879048400.cbf75754784c428da6c3043021585860/versions/793f227a9c2847969b7a845b95eb8a0f/metadata" } }, "custom_attributes": [ { "name": "Project Phase", "value": "Concept", "type": "string" }, { "name": "BIM Execution Plan Version", "value": "BEP_v1.2.pdf", "type": "file" } ] } ``` ``` -------------------------------- ### Get Document Metadata (OpenCDE API) Source: https://context7.com/buildingsmart/opencde-api/llms.txt Retrieves detailed metadata fields for a specific document version, including custom attributes and their data types. Requires an Authorization header and 'Accept: application/hal+json'. ```bash # Fetch document metadata curl -X GET "https://bim.aconex.com/documents-api/documents/1879048400.cbf75754784c428da6c3043021585860/versions/793f227a9c2847969b7a845b95eb8a0f/metadata" \ -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \ -H "Accept: application/hal+json" ``` -------------------------------- ### OpenCDE API Complete Upload Workflow (Bash) Source: https://context7.com/buildingsmart/opencde-api/llms.txt This bash script demonstrates a complete file upload workflow using the OpenCDE API. It covers creating a session, extracting registration and upload links using `jq`, registering the file with its metadata, and finally uploading the file binary. ```bash # 1. Create session SESSION=$(curl -s -X POST "https://bim.aconex.com/cde/0.1/documents/upload-documents" \ -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \ -H "Accept: application/hal+json") # 2. Extract register link REGISTER_LINK=$(echo $SESSION | jq -r '._links["register-file-upload"].href') # 3. Register file REGISTER_RESPONSE=$(curl -s -X POST "$REGISTER_LINK" \ -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \ -H "Content-Type: application/json" \ -d '{"filename":"Office Arch.ifc","size":"4099307","last_modified":"2019-11-04T04:46:55.880Z"}') # 4. Extract upload link UPLOAD_LINK=$(echo $REGISTER_RESPONSE | jq -r '._links["upload-file"].href') # 5. User enters metadata in browser (using upload-metadata link) # 6. Upload file binary curl -X POST "$UPLOAD_LINK" \ -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \ -F "file=@/path/to/Office_Arch.ifc" ``` -------------------------------- ### Document Upload Workflow Source: https://context7.com/buildingsmart/opencde-api/llms.txt This section outlines the steps required to upload a document to an OpenCDE-compliant platform, including session creation, file registration, and the actual file upload. ```APIDOC ## Document Upload Workflow This workflow demonstrates how to upload a document programmatically using the OpenCDE API. ### Steps: 1. **Create Session**: Initiate an upload session. 2. **Extract Register Link**: Obtain the link to register the file from the session response. 3. **Register File**: Provide file details (filename, size, last modified date) to register the upload. 4. **Extract Upload Link**: Get the specific upload URL from the registration response. 5. **User Enters Metadata**: (Browser-based step) Users can optionally add metadata via a provided link. 6. **Upload File Binary**: Transfer the actual file content to the CDE. ### Example Workflow (using curl): ```bash # 1. Create session SESSION=$(curl -s -X POST "https://bim.aconex.com/cde/0.1/documents/upload-documents" \ -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \ -H "Accept: application/hal+json") # 2. Extract register link REGISTER_LINK=$(echo $SESSION | jq -r '._links["register-file-upload"].href') # 3. Register file REGISTER_RESPONSE=$(curl -s -X POST "$REGISTER_LINK" \ -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \ -H "Content-Type: application/json" \ -d '{"filename":"Office Arch.ifc","size":"4099307","last_modified":"2019-11-04T04:46:55.880Z"}') # 4. Extract upload link UPLOAD_LINK=$(echo $REGISTER_RESPONSE | jq -r '._links["upload-file"].href') # 5. User enters metadata in browser (using upload-metadata link - not shown in curl example) # 6. Upload file binary curl -X POST "$UPLOAD_LINK" \ -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \ -F "file=@/path/to/Office_Arch.ifc" ``` ### Notes: * Replace `YOUR_ACCESS_TOKEN` with a valid authentication token. * Ensure `jq` is installed for parsing JSON responses if using the bash example. * The file path `/path/to/Office_Arch.ifc` should point to the actual local file. * The `last_modified` timestamp should match the file's last modification time. ``` -------------------------------- ### POST /cde/0.1/documents/upload-documents Source: https://github.com/buildingsmart/opencde-api/blob/master/cde_file_handling/sequence_document_upload.txt Initiates the document upload flow by creating a new upload session. This endpoint returns links for registering individual files and uploading metadata. ```APIDOC ## POST /cde/0.1/documents/upload-documents ### Description Initiates the document upload flow by creating a new upload session. This endpoint returns links for registering individual files and uploading metadata. ### Method POST ### Endpoint /cde/0.1/documents/upload-documents ### Parameters #### Query Parameters None #### Request Body None ### Request Example ```json {} ``` ### Response #### Success Response (200) - **register_file_upload_link** (string) - Link to register individual files for upload. - **upload_metadata_link** (string) - Link to upload metadata for the documents. #### Response Example ```json { "register_file_upload_link": "/cde/0.1/files/register-upload", "upload_metadata_link": "/cde/0.1/documents/upload-metadata" } ``` ``` -------------------------------- ### Retrieve Document Reference (OpenCDE API) Source: https://context7.com/buildingsmart/opencde-api/llms.txt Fetches metadata and HAL links for a specific document version. It includes links for downloading content, accessing full metadata, and viewing version history. Requires an Authorization header and 'Accept: application/hal+json'. ```bash # Fetch document reference curl -X GET "https://bim.aconex.com/documents-api/documents/1879048400.cbf75754784c428da6c3043021585860/versions/793f227a9c2847969b7a845b95eb8a0f" \ -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \ -H "Accept: application/hal+json" # Response { "_links": { "self": { "href": "https://bim.aconex.com/documents-api/documents/1879048400.cbf75754784c428da6c3043021585860/versions/793f227a9c2847969b7a845b95eb8a0f" }, "metadata": { "href": "https://bim.aconex.com/documents-api/documents/1879048400.cbf75754784c428da6c3043021585860/versions/793f227a9c2847969b7a845b95eb8a0f/metadata" }, "versions": { "href": "https://bim.aconex.com/documents-api/documents/1879048400.cbf75754784c428da6c3043021585860/versions" }, "content": { "href": "https://bim.aconex.com/bim/api/projects/1879048400/models/cbf75754784c428da6c3043021585860/revisions/793f227a9c2847969b7a845b95eb8a0f/contents" } }, "version": "1.0", "version_date": "2019-11-04T04:46:55.880Z", "title": "Office Architecture Model", "file_description": { "size_in_bytes": 4099307, "name": "Office Arch.ifc" } } ``` -------------------------------- ### Download Document Content (OpenCDE API) Source: https://context7.com/buildingsmart/opencde-api/llms.txt Downloads the binary file content for a specific document version using the 'content' URL obtained from the document reference. Supports saving directly to a file and streaming with progress indication. Requires an Authorization header. ```bash # Download file content curl -X GET "https://bim.aconex.com/bim/api/projects/1879048400/models/cbf75754784c428da6c3043021585860/revisions/793f227a9c2847969b7a845b95eb8a0f/contents" \ -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \ -o "Office_Arch.ifc" # Response: Binary file content # File saved to Office_Arch.ifc (4,099,307 bytes) # Alternative: Stream large files with progress curl -X GET "https://bim.aconex.com/bim/api/projects/1879048400/models/cbf75754784c428da6c3043021585860/revisions/793f227a9c2847969b7a845b95eb8a0f/contents" \ -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \ --progress-bar \ -o "Office_Arch.ifc" ``` -------------------------------- ### POST /documents/upload-documents Source: https://context7.com/buildingsmart/opencde-api/llms.txt Initiates a new document upload session. This endpoint returns links necessary for subsequent file registration and metadata submission. ```APIDOC ## POST /documents/upload-documents ### Description Initiates an upload session and returns links for registering files and entering metadata through a browser interface. ### Method POST ### Endpoint `/documents/upload-documents` ### Parameters #### Query Parameters - **upload_session_id** (string) - Required - The unique identifier for the upload session. ### Request Example ```bash curl -X POST "https://bim.aconex.com/cde/0.1/documents/upload-documents" \ -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \ -H "Content-Type: application/json" \ -H "Accept: application/hal+json" ``` ### Response #### Success Response (201) - **_links** (object) - Contains links for further actions. - **register-file-upload** (object) - Link to register a file for upload. - **upload-metadata** (object) - Link to upload metadata. #### Response Example ```json { "_links": { "register-file-upload": { "href": "https://bim.aconex.com/documents-api/upload-session/ecb02b2e-a050-41e9-80a8-f247ab1f317e/files" }, "upload-metadata": { "href": "https://bim.aconex.com/cde/0.1/documents/upload-metadata/?upload_session_id=ecb02b2e-a050-41e9-80a8-f247ab1f317e" } } } ``` ``` -------------------------------- ### BROWSER /&callback_url= Source: https://github.com/buildingsmart/opencde-api/blob/master/cde_file_handling/sequence_document_upload.txt Redirects the user's browser to a page where they can enter and submit metadata for all registered documents. A callback URL is provided for notification upon completion. ```APIDOC ## BROWSER /&callback_url= ### Description Redirects the user's browser to a page where they can enter and submit metadata for all registered documents. A callback URL is provided for notification upon completion. ### Method GET (via browser redirection) ### Endpoint /&callback_url= ### Parameters #### Path Parameters - **upload_metadata_link** (string) - The link to the metadata upload page. - **callback_url** (string) - The URL to redirect to after metadata submission. #### Query Parameters None #### Request Body None ### Request Example (Browser redirection - example not applicable in JSON format) ### Response #### Success Response (200) User is presented with a form to enter metadata. Upon submission, the browser is redirected to the specified callback URL. #### Response Example (Browser redirection - example not applicable in JSON format) ``` -------------------------------- ### POST / Source: https://github.com/buildingsmart/opencde-api/blob/master/cde_file_handling/sequence_document_upload.txt Uploads the binary content of a registered file. This is the final step for uploading individual document files. ```APIDOC ## POST / ### Description Uploads the binary content of a registered file. This is the final step for uploading individual document files. ### Method POST ### Endpoint / ### Parameters #### Path Parameters - **upload_file_link** (string) - The link obtained from registering a file. #### Query Parameters None #### Request Body - **file** (binary) - Required - The binary content of the file to upload. ### Request Example (Binary file upload - example not applicable in JSON format) ### Response #### Success Response (200) - **document_reference** (string) - A reference identifier for the successfully uploaded document. #### Response Example ```json { "document_reference": "doc-ref-987654" } ``` ``` -------------------------------- ### Download Document Content Source: https://context7.com/buildingsmart/opencde-api/llms.txt Downloads the binary file content for a specific document version using the content URL obtained from the document reference. ```APIDOC ## GET /bim/api/projects/{project_id}/models/{model_id}/revisions/{revision_id}/contents ### Description Downloads the binary file content for a specific document version. The content URL is typically discovered from the document reference obtained via the `Get Document Reference` endpoint. ### Method GET ### Endpoint `/bim/api/projects/{project_id}/models/{model_id}/revisions/{revision_id}/contents` ### Path Parameters - **project_id** (string) - Required - The ID of the project. - **model_id** (string) - Required - The ID of the model. - **revision_id** (string) - Required - The ID of the model revision (corresponding to a document version). ### Headers - **Authorization**: `Bearer YOUR_ACCESS_TOKEN` - Authentication token. ### Request Example ```bash # Download file content curl -X GET "https://bim.aconex.com/bim/api/projects/1879048400/models/cbf75754784c428da6c3043021585860/revisions/793f227a9c2847969b7a845b95eb8a0f/contents" \ -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \ -o "Office_Arch.ifc" # Stream large files with progress curl -X GET "https://bim.aconex.com/bim/api/projects/1879048400/models/cbf75754784c428da6c3043021585860/revisions/793f227a9c2847969b7a845b95eb8a0f/contents" \ -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \ --progress-bar \ -o "Office_Arch.ifc" ``` ### Response #### Success Response (200 OK) Returns the binary file content of the specified document version. #### Response Example Binary file content (e.g., IFC file). The response will be saved to the specified output file (e.g., `Office_Arch.ifc`). *File saved to Office_Arch.ifc (4,099,307 bytes)* ``` -------------------------------- ### POST / Source: https://github.com/buildingsmart/opencde-api/blob/master/cde_file_handling/sequence_document_upload.txt Registers a single file for upload within an existing upload session. This endpoint returns a link for uploading the actual file binary. ```APIDOC ## POST / ### Description Registers a single file for upload within an existing upload session. This endpoint returns a link for uploading the actual file binary. ### Method POST ### Endpoint / ### Parameters #### Path Parameters - **register_file_upload_link** (string) - The link obtained from the initial upload session creation. #### Query Parameters None #### Request Body - **filename** (string) - Required - The name of the file to be uploaded. - **file_type** (string) - Required - The MIME type of the file. ### Request Example ```json { "filename": "example.pdf", "file_type": "application/pdf" } ``` ### Response #### Success Response (200) - **upload_file_link** (string) - Link to upload the binary content of the file. #### Response Example ```json { "upload_file_link": "/cde/0.1/files/upload-binary/abc123xyz" } ``` ``` -------------------------------- ### Upload File Binary - Bash Source: https://context7.com/buildingsmart/opencde-api/llms.txt Uploads the actual binary content of a file. This is the final step in the file upload process and requires the file to be registered first. It uses multipart/form-data to send the file. ```bash # Upload file binary curl -X POST "https://bim.aconex.com/documents-api/upload-session/57a5f29d-3b72-4c38-b0cd-ba843ee45d52/files/7bb1f522-fd85-488f-b005-e407cc1a78a6" \ -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \ -H "Content-Type: multipart/form-data" \ -F "file=@/path/to/Office_Arch.ifc" ``` -------------------------------- ### Register File for Upload - Bash Source: https://context7.com/buildingsmart/opencde-api/llms.txt Registers a specific file within an initiated upload session. This step involves providing file metadata such as filename, size, modification date, and version. It is a prerequisite for uploading the file's binary content. ```bash # Register file for upload curl -X POST "https://bim.aconex.com/documents-api/upload-session/ecb02b2e-a050-41e9-80a8-f247ab1f317e/files" \ -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \ -H "Content-Type: application/json" \ -H "Accept: application/hal+json" \ -d '{ "filename": "Office Arch.ifc", "size": "4099307", "last_modified": "2019-11-04T04:46:55.880Z", "version": "793f227a9c2847969b7a845b95eb8a0f" }' ``` -------------------------------- ### Select Documents Flow Source: https://context7.com/buildingsmart/opencde-api/llms.txt Initiates a browser-based document selection interface for users to choose documents from the CDE. It supports single or multi-document selection and returns selected document references via a callback URL. ```APIDOC ## GET /cde/0.1/documents/select-documents ### Description Initiates a browser-based document selection interface to allow users to choose one or multiple documents from the CDE. Returns the selected document references to the calling application via a callback URL. ### Method GET ### Endpoint `/cde/0.1/documents/select-documents` ### Query Parameters - **select_mode** (string) - Required - Specifies whether to select a single document (`single`) or multiple documents (`multi`). - **callback_url** (string) - Required - The URL to which the browser will redirect after the user makes their selection, appending document references. ### Request Example ```bash # Start single document selection curl -X GET "https://bim.aconex.com/cde/0.1/documents/select-documents?select_mode=single&callback_url=http://localhost:3000/callback" \ -H "Authorization: Bearer YOUR_ACCESS_TOKEN" # Start multi-document selection curl -X GET "https://bim.aconex.com/cde/0.1/documents/select-documents?select_mode=multi&callback_url=http://localhost:3000/callback" \ -H "Authorization: Bearer YOUR_ACCESS_TOKEN" ``` ### Response #### Success Response (302 Redirect) Returns an HTML page that redirects the user to the CDE selection UI. #### Callback URL Response Upon user selection, the browser redirects to the `callback_url` with query parameters: - **document_url** (string) - The URL to the selected document version. ### Response Example (Callback) ``` http://localhost:3000/callback?document_url=https://bim.aconex.com/documents-api/documents/1879048400.cbf75754784c428da6c3043021585860/versions/793f227a9c2847969b7a845b95eb8a0f ``` ``` -------------------------------- ### OpenCDE API Document Reference Response (JSON) Source: https://context7.com/buildingsmart/opencde-api/llms.txt This JSON object represents a typical response from the OpenCDE API when requesting document reference information. It includes links to related resources such as metadata, versions, and content, along with version details and file information. ```json { "_links": { "self": { "href": "https://bim.aconex.com/documents-api/documents/1879048400.cbf75754784c428da6c3043021585860/versions/793f227a9c2847969b7a845b95eb8a0f" }, "metadata": { "href": "https://bim.aconex.com/documents-api/documents/1879048400.cbf75754784c428da6c3043021585860/versions/793f227a9c2847969b7a845b95eb8a0f/metadata" }, "versions": { "href": "https://bim.aconex.com/documents-api/documents/1879048400.cbf75754784c428da6c3043021585860/versions" }, "content": { "href": "https://bim.aconex.com/bim/api/projects/1879048400/models/cbf75754784c428da6c3043021585860/revisions/793f227a9c2847969b7a845b95eb8a0f/contents" } }, "version": "1.0", "version_date": "2019-11-04T04:46:55.880Z", "title": "Office Architecture Model", "file_description": { "size_in_bytes": 4099307, "name": "Office Arch.ifc" } } ``` -------------------------------- ### POST /upload-session/{uploadSessionId}/files/{fileId} Source: https://context7.com/buildingsmart/opencde-api/llms.txt Uploads the actual binary content of a registered file. This endpoint is used after a file has been successfully registered and its metadata provided. ```APIDOC ## POST /upload-session/{uploadSessionId}/files/{fileId} ### Description Uploads the actual file content as multipart form data after registration and metadata entry. ### Method POST ### Endpoint `/upload-session/{uploadSessionId}/files/{fileId}` ### Parameters #### Path Parameters - **uploadSessionId** (string) - Required - The unique identifier of the upload session. - **fileId** (string) - Required - The unique identifier of the file within the session. #### Request Body - **file** (file) - Required - The file content to be uploaded (multipart/form-data). ### Request Example ```bash curl -X POST "https://bim.aconex.com/documents-api/upload-session/57a5f29d-3b72-4c38-b0cd-ba843ee45d52/files/7bb1f522-fd85-488f-b005-e407cc1a78a6" \ -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \ -H "Content-Type: multipart/form-data" \ -F "file=@/path/to/Office_Arch.ifc" ``` ### Response #### Success Response (200) - The response typically indicates successful upload, possibly with a confirmation message or status. #### Response Example (Response structure for this endpoint is not provided in the input text.) ``` -------------------------------- ### POST /upload-session/{uploadSessionId}/files Source: https://context7.com/buildingsmart/opencde-api/llms.txt Registers a file within an active upload session, including its name, size, last modified date, and version. This prepares the system to receive the file's binary data. ```APIDOC ## POST /upload-session/{uploadSessionId}/files ### Description Registers a file for upload with its metadata, preparing the CDE to receive the file binary data. ### Method POST ### Endpoint `/upload-session/{uploadSessionId}/files` ### Parameters #### Path Parameters - **uploadSessionId** (string) - Required - The unique identifier of the upload session. #### Request Body - **filename** (string) - Required - The name of the file to be uploaded. - **size** (string) - Required - The size of the file in bytes. - **last_modified** (string) - Required - The last modified timestamp of the file (ISO 8601 format). - **version** (string) - Required - The version identifier for the file. ### Request Example ```bash curl -X POST "https://bim.aconex.com/documents-api/upload-session/ecb02b2e-a050-41e9-80a8-f247ab1f317e/files" \ -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \ -H "Content-Type: application/json" \ -H "Accept: application/hal+json" \ -d '{ "filename": "Office Arch.ifc", "size": "4099307", "last_modified": "2019-11-04T04:46:55.880Z", "version": "793f227a9c2847969b7a845b95eb8a0f" }' ``` ### Response #### Success Response (201) - **_links** (object) - Contains links for further actions. - **upload-file** (object) - Link to upload the file binary data. #### Response Example ```json { "_links": { "upload-file": { "href": "https://bim.aconex.com/documents-api/upload-session/57a5f29d-3b72-4c38-b0cd-ba843ee45d52/files/7bb1f522-fd85-488f-b005-e407cc1a78a6" } } } ``` ``` -------------------------------- ### Document Reference Response Structure Source: https://context7.com/buildingsmart/opencde-api/llms.txt This details the structure of the response received when requesting a document reference, including links to related resources and document metadata. ```APIDOC ## Document Reference Response This describes the structure of a successful response when retrieving information about a document reference. ### Response Body Example ```json { "_links": { "self": { "href": "https://bim.aconex.com/documents-api/documents/1879048400.cbf75754784c428da6c3043021585860/versions/793f227a9c2847969b7a845b95eb8a0f" }, "metadata": { "href": "https://bim.aconex.com/documents-api/documents/1879048400.cbf75754784c428da6c3043021585860/versions/793f227a9c2847969b7a845b95eb8a0f/metadata" }, "versions": { "href": "https://bim.aconex.com/documents-api/documents/1879048400.cbf75754784c428da6c3043021585860/versions" }, "content": { "href": "https://bim.aconex.com/bim/api/projects/1879048400/models/cbf75754784c428da6c3043021585860/revisions/793f227a9c2847969b7a845b95eb8a0f/contents" } }, "version": "1.0", "version_date": "2019-11-04T04:46:55.880Z", "title": "Office Architecture Model", "file_description": { "size_in_bytes": 4099307, "name": "Office Arch.ifc" } } ``` ### Fields: * **_links** (object): Contains hypermedia links to related resources. * **self** (object): Link to the document reference itself. * **metadata** (object): Link to the metadata of the document version. * **versions** (object): Link to a list of all versions of the document. * **content** (object): Link to the actual content of the document version. * **version** (string): The version identifier of the document. * **version_date** (string): The date and time when this version was created (ISO 8601 format). * **title** (string): The title of the document. * **file_description** (object): Contains details about the file. * **size_in_bytes** (integer): The size of the file in bytes. * **name** (string): The name of the file. ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.