---
title: "Retrieve the user's selection from the CDE"
method: GET
path: "/server-provided-path-selected-documents-url"
tags: ["Download"]
---

# Retrieve the user's selection from the CDE

`GET /server-provided-path-selected-documents-url`

This endpoint returns the document selection. The client retrieves its URL via the callback URL from the CDE after the selection has finished from a query parameter named `selected_documents_url`. In case when the user cancels the selection on the CDE UI, this callback will still be called, but the `selected_documents_url` query parameter will not be present, instead the server will provide a query parameter called `user_cancelled_selection=true`.

## Response `200`

- SelectedDocuments
  - `server_context` string, nullable — A CDE controlled identifier recording the user's context on the CDE. For example which project and folder the user was on. If the client provides the `server_context` in subsequent calls then the CDE will attemp to load the UI at the same place.
  - `documents` DocumentVersion[], required — An array containing all the documents selected by the user
    - `links` DocumentVersionLinks, required — * __document_version__ is a self-URL that can be used for future retrieval of the document version information * __document_version_metadata__ is a URL for retrieving the metadata associated with this document version * __document_version_download__ is a URL for downloading the file backing this document version * __document_versions__ is a URL for retrieving all the versions of the document * __document_details__ is a URL that should be opened in the system browser. It leads to a page on the CDE where users can view or edit document details
      - `document_version` LinkData, required
        - `url` string, required
      - `document_version_metadata` LinkData, required
        - `url` string, required
      - `document_version_download` LinkData, required
        - `url` string, required
      - `document_versions` LinkData, required
        - `url` string, required
      - `document_details` LinkData
        - `url` string, required
    - `version_number` string, required — A human readable version number. This is not expected to be in any specific format across CDEs and may hold any value
    - `version_index` integer, required — A machine readable sequence number of the version of the document. The sequence must be ordered, so that newer versions have higher values than previous ones. Each version index must be unique for that document, but there may be gaps in the sequence
    - `creation_date` string, date-time, required — The creation date of the document revision
    - `title` string, required — A human readable code or identifier
    - `file_description` FileDescription, required — Basic file information
      - `name` string, required
      - `size_in_bytes` integer, required
    - `document_id` string, required — A machine readable identifier that can be used to uniquely identify this version it future calls - see `Query` section

## Changes

- **2022-08-11** `2d09dcd8ade2` — 1 info
  - api operation id `/server-provided-path-selected-documents-url` was added
- **2022-03-21** `504148fb6f8f` — 1 warning, 1 info
  - removed the optional property `selection_context` from the response with the `200` status
  - added the optional property `server_context` to the response with the `200` status
- **2022-02-16** `30259031e29d` — 1 info
  - api tag `Download` added
- **2022-02-14** `3eaa30d597fd` — 1 warning, 3 info
  - removed the optional property `server_context` from the response with the `200` status
  - api operation id `/server-provided-path-selected-documents-url` removed and replaced with ``
  - api tag `Download` removed
  - added the optional property `selection_context` to the response with the `200` status

[Change history](https://skmtc.dev/buildingsmart/apis/opencde-documents-api/changes/server-provided-path-selected-documents-url/get.md)

---

[API](https://skmtc.dev/buildingsmart/apis/opencde-documents-api.md) · [All operations](https://skmtc.dev/buildingsmart/apis/opencde-documents-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/buildingsmart/opencde-documents-api/revisions/b6d5b5ee5da6/schema)
