Export PDF Files from BIM 360 Document Management (new)
This tutorial demonstrates how to export a single-page (sheet) PDF file that was uploaded to BIM 360 Document Management into a new PDF file. The steps include finding the ID of the PDF page you want to export, exporting the page (you can optionally also export markups and hyperlinks), verifying that the asynchronous job is complete, retrieving data you need to download the exported file, and downloading the exported page.
Note that you can only export a page from a PDF file that was uploaded to the Plans folder or to a folder nested under the Plans folder. BIM 360 Document Management splits these files into separate pages (sheets) when they are uploaded, and assigns a separate ID to each page. You can identify exportable PDF files by searching for files with the following combination of properties:
attributes.extension.type: items:autodesk.bim360.Document
(identifies all files that are split into separate pages)attributes.extension.data.sourceFileName: <filename>.pdf
(identifies all PDF files)
For more information about the Plans folder, see the Help documentation.
Before You Begin
- Register an app.
- Provision your app to acquire access to your BIM 360 account.
- Acquire a 3-legged OAuth token or a 2-legged OAuth token with
data:create
data:read
anddata:write
scopes. - Find the account ID and project ID for the PDF page you want to export, by following the first 2 steps of the Download Document tutorial.
Step 1: Find the Folder ID
Find the folder ID by calling GET hubs/:hub_id/projects/:project_id/topFolders using the hub ID (b.cGVyc29uYWw6cGUyOWNjZjMy
) and the project ID (b.cGVyc29uYWw6d2l
).
Request
curl -X GET -H "Authorization: Bearer nFRJxzCD8OOUr7hzBwbr06D76zAT"
"https://developer.api.autodesk.com/project/v1/hubs/b.cGVyc29uYWw6cGUyOWNjZjMy/projects/b.cGVyc29uYWw6d2l/topFolders"
Response
{
"jsonapi": {
"version": "1.0"
},
"data": [
{
"type": "folders",
"id": "urn:adsk.wipprod:fs.folder:co.BJU3PTc4Sd2CmXM492XUiA",
"attributes": {
"name": "Plans",
"displayName": "Plans",
"createTime": "2017-07-17T13:06:56.0000000Z",
"createUserId": "",
"createUserName": "",
"lastModifiedTime": "2017-09-24T07:46:08.0000000Z",
"lastModifiedUserId": "X9WYLGPNCHSL",
"lastModifiedUserName": "John Smith",
"objectCount": 4,
"hidden": false,
"extension": {
"type": "folders:autodesk.bim360:Folder",
"version": "1.0",
"schema": {
"href": "https://developer.api.autodesk.com/schema/v1/versions/folders:autodesk.bim360:Folder-1.0"
},
"data": {
"visibleTypes": [
"items:autodesk.bim360:Document"
],
"actions": [
"CONVERT"
"SPLIT",
"OCR"
],
"allowedTypes": [
"items:autodesk.bim360:File",
"folders:autodesk.bim360:Folder"
"items:autodesk.bim360:Document",
"items:autodesk.bim360:TitleBlock",
"items:autodesk.bim360:ReviewDocument"
]
}
}
}
}
]
}
Find the Plans folder and note the folder ID (data.id
) - urn:adsk.wipprod:fs.folder:co.BJU3PTc4Sd2CmXM492XUiA
. Note that the Plans folder (and folders nested under the Plans folder) have the following property:attributes.extension.data.actions: SPLIT
.
If you want to export a PDF file from a folder nested under the Plans folder, you need to call GET projects/:project_id/folders/:folder_id/contents repeatedly through the hierarchy of folders until you find the folder ID of the folder that contains the PDF file you want to export. To get contents of first level of the Plans folder, use the Plans folder ID (urn:adsk.wipprod:fs.folder:co.BJU3PTc4Sd2CmXM492XUiA
).
Step 2: Find the Version ID of the File to Export
Find the latest version ID of the PDF page you want to export using the hub ID (b.cGVyc29uYWw6cGUyOWNjZjMy
), the project ID (b.cGVyc29uYWw6d2l
), and the URL-encoded folder ID (urn%3Aadsk.wipprod%3Afs.folder%3Aco.BJU3PTc4Sd2CmXM492XUiA
) to call GET projects/:project_id/folders/:folder_id/contents.
(If you want to export a different version of the page, use GET projects/:project_id/items/:item_id/versions.)
Request
curl -X GET https://developer.api.autodesk.com/data/v1/projects/b.cGVyc29uYWw6d2l/folders/urn%3Aadsk.wipprod%3Afs.folder%3Aco.BJU3PTc4Sd2CmXM492XUiA/contents
-H 'authorization: Bearer nFRJxzCD8OOUr7hzBwbr06D76zAT'
Response
{
"jsonapi": {
"version": "1.0"
},
"links": {
"self": {
"href": "https://developer.api.autodesk.com/data/v1/projects/b.94d60d03-1e8c-4f32-b146-dd3173e655d8/folders/urn:adsk.wipprod:fs.folder:co.hTcJTDRzTQCnxySVOg6avQ/contents"
}
},
"data": [
{
"type": "items",
"id": "urn:adsk.wipprod:dm.lineage:Ww95QMRfTSCJfbSdVat6FQ",
"attributes": {
"displayName": "A-101 FLOOR PLANS",
"lastModifiedTime": "2017-09-24T07:46:08.0000000Z",
"lastModifiedUserId": "X9WYLGPNCHSL",
"lastModifiedUserName": "John Smith",
"lastModifiedTime": "2017-08-25T08:59:04.0000000Z",
"lastModifiedUserId": "200906020304322",
"lastModifiedUserName": "John Smith",
"hidden": false,
"extension": {
"type": "items:autodesk.bim360:Document",
"version": "1.0",
"schema": {
"href": "https://developer.api.autodesk.com/schema/v1/versions/items:autodesk.bim360:Document-1.0"
},
"data": {
"sourceFileName": "floors.pdf"
}
}
},
"relationships": {
"tip": {
"data": {
"type": "versions",
"id": "urn:adsk.wipprod:fs.file:vf.Ww95QMRfTSCJfbSdVat6FQ?version=1"
}
}
}
},
{
"type": "items",
"id": "urn:adsk.wipprod:dm.lineage:15Rg8B38Qp-SEu6HzXlTNg",
"attributes": {
"displayName": "A-102 FLOOR PLANS",
"createTime": "2017-08-25T08:58:57.0000000Z",
"createUserId": "200906020304322",
"createUserName": "John Smith",
"lastModifiedTime": "2017-08-25T08:59:04.0000000Z",
"lastModifiedUserId": "200906020304322",
"lastModifiedUserName": "John Smith",
"hidden": false,
"extension": {
"type": "items:autodesk.bim360:Document",
"version": "1.0",
"schema": {
"href": "https://developer.api.autodesk.com/schema/v1/versions/items:autodesk.bim360:Document-1.0"
},
"data": {
"sourceFileName": "floors.pdf"
}
}
},
"relationships": {
"tip": {
"data": {
"type": "versions",
"id": "urn:adsk.wipprod:fs.file:vf.15Rg8B38Qp-SEu6HzXlTNg?version=1"
}
}
}
}
],
"included": [
{
"type": "versions",
"id": "urn:adsk.wipprod:fs.file:vf.Ww95QMRfTSCJfbSdVat6FQ?version=1",
"attributes": {
"name": "A-101 FLOOR PLANS",
"displayName": "A-101 FLOOR PLANS",
"createTime": "2017-08-25T08:58:57.0000000Z",
"createUserId": "200906020304322",
"createUserName": "John Smith",
"lastModifiedTime": "2017-08-25T08:59:05.0000000Z",
"lastModifiedUserId": "200906020304322",
"lastModifiedUserName": "John Smith",
"versionNumber": 1,
"extension": {
"type": "versions:autodesk.bim360:Document",
"version": "1.0",
"schema": {
"href": "https://developer.api.autodesk.com/schema/v1/versions/versions:autodesk.bim360:Document-1.0"
},
"data": {
"processState": "PROCESSING_COMPLETE",
"viewableId": "1",
"viewableGuid": "d45af981-3086-4145-a952-cbee9a7e7e78",
"viewableName": "1",
"viewableOrder": 1,
"sourceFileName": "floors.pdf"
}
}
}
},
{
"type": "versions",
"id": "urn:adsk.wipprod:fs.file:vf.15Rg8B38Qp-SEu6HzXlTNg?version=1",
"attributes": {
"name": "A-102 FLOOR PLANS",
"displayName": "A-102 FLOOR PLANS",
"createTime": "2017-08-25T08:58:57.0000000Z",
"createUserId": "200906020304322",
"createUserName": "John Smith",
"lastModifiedTime": "2017-08-25T08:59:05.0000000Z",
"lastModifiedUserId": "200906020304322",
"lastModifiedUserName": "John Smith",
"versionNumber": 1,
"extension": {
"type": "versions:autodesk.bim360:Document",
"version": "1.0",
"schema": {
"href": "https://developer.api.autodesk.com/schema/v1/versions/versions:autodesk.bim360:Document-1.0"
},
"data": {
"processState": "PROCESSING_COMPLETE",
"viewableId": "2",
"viewableGuid": "faf6ab96-6cf0-4b3b-9da5-fd5bb3bde9e3",
"viewableName": "2",
"viewableOrder": 2,
"sourceFileName": "floors.pdf"
}
}
}
}
]
}
Find the name of page you want to export i.e., included[i].type.attributes.displayName
, which is the name that appears in the Document Management UI. For example, A-101 FLOOR PLANS
. Note that included[i].type.attributes.name
refers to the name BIM 360 assigns to the file. This is sometimes different from the name of the file in the UI. For example, if the filename contains reserved characters. Note the version ID (data.relationships.tip.data.id
) - urn:adsk.wipprod:fs.file:vf.15Rg8B38Qp-SEu6HzXlTNg?version=1
.
Step 3: Export the BIM 360 PDF File
To export the BIM 360 PDF file into a new PDF file, call POST projects/:project_id/versions/:version_id/exports using the version ID (urn:adsk.wipprod:fs.file:vf.15Rg8B38Qp-SEu6HzXlTNg?version=1
) you retrieved in step 2.
Note that the project ID in the BIM 360 API corresponds to the project ID in the Data Management API. To convert a project ID in the Data Management API into a project ID in the BIM 360 API you need to remove the “b." prefix. For example, a project ID of b.a4be0c34a-4ab7 translates to a project ID of a4be0c34a-4ab7.
Note that this endpoint is asynchronous and initiates a job that runs in the background rather than halting execution of your program. You still need to check whether the asynchronous job is complete by calling GET projects/:project_id/versions/:version_id/exports/:export_id.
When exporting the PDF page, you can also export the page’s markups and hyperlinks. You can export hyperlinks that point to external pages, as well as hyperlinks that point to pages within BIM 360 Document Management.
This tutorial explains the following typical workflows:
- 3.1: Export files without markups or hyperlinks
- 3.2: Export files with markups
- 3.3: Export files with hyperlinks
3.1: Export files without markups or hyperlinks
You can export files without any markups or hyperlinks.
Request
curl -X POST \
https://developer.api.autodesk.com/bim360/docs/v1/projects/c0337487-5b66-422b-a284-c273b424af54/versions/urn%3Aadsk.wipprod%3Afs.file%3Avf.15Rg8B38Qp-SEu6HzXlTNg%3Fversion%3D1/exports \
-H 'authorization: Bearer eyJhbGciOiJIUzI1NiIsImtpZCI6Imp3dF9zeW1tZXRyaWNfa2V5In0' \
-H 'content-type: application/json'
Response
{
"id":"225eb2fb-d5b0-44c9-a50a-2c792d833f2e",
"status":"committed"
}
3.2: Export files with markups
You can export files with markups.
Request
curl -X POST \
https://developer.api.autodesk.com/bim360/docs/v1/projects/c0337487-5b66-422b-a284-c273b424af54/versions/urn%3Aadsk.wipprod%3Afs.file%3Avf.15Rg8B38Qp-SEu6HzXlTNg%3Fversion%3D1/exports \
-H 'authorization: Bearer eyJhbGciOiJIUzI1NiIsImtpZCI6Imp3dF9zeW1tZXRyaWNfa2V5In0' \
-H 'content-type: application/json'
-d '{"includeMarkups": true}'
Response
{
"id":"345eb2fb-d5b0-44c9-a50a-2c792d833f3f",
"status":"committed"
}
3.3: Export files with hyperlinks
You can export files with hyperlinks.
Request
curl -X POST \
https://developer.api.autodesk.com/bim360/docs/v1/projects/c0337487-5b66-422b-a284-c273b424af54/versions/urn%3Aadsk.wipprod%3Afs.file%3Avf.15Rg8B38Qp-SEu6HzXlTNg%3Fversion%3D1/exports \
-H 'authorization: Bearer eyJhbGciOiJIUzI1NiIsImtpZCI6Imp3dF9zeW1tZXRyaWNfa2V5In0' \
-H 'content-type: application/json' \
-d '{"includeHyperlinks": true}'
Response
{
"id":"455eb2fb-d5b0-44c9-a50a-2c792d833f4g",
"status":"committed"
}
Step 4: Verify the Job is Complete
To verify the status of the export job, and to retrieve the data you need to download the exported file when the export is complete, call GET projects/:project_id/versions/:version_id/exports/:export_id and check the status
of the job. When the status is completed
, the download data appears in the response.
Request
curl -X GET \
https://developer.api.autodesk.com/bim360/docs/v1/projects/c0337487-5b66-422b-a284-c273b424af54/versions/urn%3Aadsk.wipprod%3Afs.file%3Avf.15Rg8B38Qp-SEu6HzXlTNg%3Fversion%3D1/exports/225eb2fb-d5b0-44c9-a50a-2c792d833f2e \
-H 'authorization: Bearer eyJhbGciOiJIUzI1NiIsImtpZCI6Imp3dF9zeW1tZXRyaWNfa2V5In0' \
-H 'content-type: application/json'
Response
{
"id":"433d07ec-32a2-44eb-a5eb-b41090bfe932",
"status":"completed",
"data":{
"versionUrn":"dXJuOmFkc2sud2lwcHJvZDpmcy5maWxlOnZmLnBmM2ZyVTBnVFphT290S1hnMmgxRnc_dmVyc2lvbj0x",
"resourceId":"urn:adsk.viewing:fs.file:dXJuOmFkc2sud2lwcHJvZDpmcy5maWxlOnZmLnBmM2ZyVTBnVFphT290S1hnMmgxRnc_dmVyc2lvbj0x/output/qXP_ZA5_3EqJoq5zqvnLHA/h8YAl4KMcEe9-L5SaEXY6A.pdf",
"signedUrl":"https://autodesk-360-translation-storage.s3.amazonaws.com/dXJuOmFkc2sud2lwcWE6ZnMuZmlsZTp2Zi5wZjNmclUwZ1RaYU9vdEtYZzJoMUZ3P3ZlcnNpb249MQ/output/qXP_ZA5_3EqJoq5zqvnLHA/h8YAl4KMcEe9-L5SaEXY6A.pdf?X-Amz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EHUH1UMQOQCwXPhJq8VQcI6Wyz7ywNuiWwUiC7%2B2ekEAnKrUwfVyLtI0u1ntG4inL9eYVmM%2BO6w7Es2XjCz%2FHms3q1HEHK26rWukyk18TO118virTD7%2BAwU4otL8D5tlV0OLH8t6D%2B%2FwZN3q0Baxj1zbsFlo&X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Date=20220805T023429Z&X-Amz-SignedHeaders=host&X-Amz-Expires=300&X-Amz-Credential=ASIATOYXB4XYG76TKVPE%2F20220805%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Signature=b7cdd11b4ad70051d652bf9f0fa7e49e24b08c800f71211c495d53db2c0509d8"
}
}
Note the signedUrl (data.signedUrl
) that you can use for downloading the exported file.
Step 5: Download the PDF File
Download the exported file using the data.signedUrl
attribute you retrieved from the the previous step. You can request the signedUrl directly without adding any headers.
Request
curl -X 'GET' -v 'https://autodesk-360-translation-storage.s3.amazonaws.com/dXJuOmFkc2sud2lwcWE6ZnMuZmlsZTp2Zi5wZjNmclUwZ1RaYU9vdEtYZzJoMUZ3P3ZlcnNpb249MQ/output/qXP_ZA5_3EqJoq5zqvnLHA/h8YAl4KMcEe9-L5SaEXY6A.pdf?X-Amz-Security-Token=IQoJb3JpZ2luX2VjEFkaCXVzLWVhc3QtMSJIMEYCIQDNNbuZoazvwW76c8hUdKythQhpfmixh2AviJuykqwbxAIhAIM1ciB8MQj5FXAQMEnP2lVdraat6%2BU5XcH3rBAdLqUhKtsECLL%2F%2F%2F%2F%2F%2F%2F%2F%2F%2FwEQABoMMjM3ODgyMTcyOTEyIgwzc1S4pCpcQPPqfQkqrwQOC9D39XsK8QpayEEZz5jLC69LO6qdMbs7mUJru5F%2Bx0VV0TXxy1vYjqdfH1SHCwW05FA8czaT40oYKmDcVDRV9iVBrxDNbYxuqS0rBK5CeOfzUQAlsl%2FHgFS%2BQ6p4ca5r2dOgG7fOics1ZLz5goqB7eRP7h27KGnGgcFmsZ4mcHlCBSrDz56hppqJfe%2BLoobZbcxkNvlTvMHH2XeXe5TsyMQWkpIT1qwEJnyMV2IlhBy6Inr%2FXCic5ID3H5NJKw9sI9W3ZhLL2nC9w791jjmxNnQAF624G38jC7pE9fN4vdHeytG27ajW291g9Z28ph%2BwK711ZAxXXM5jyApN6IcRI7ZT%2FmeqNwK3tf0JYjaWMY9flsi%2BgOc9Age7U%2FYl9gpPWokv94A4RTpZgaIoDcnPZRjOFhaKlqc%2FPRhfhU82fIchm2ajDUpJxU2R2NLpMcYQrdQwIpvdKskwr%2Bdv0ueQVOCCYy4OSmUSUN1uLvo9xuaevrakvtEw93jHAsrxBeBsiBFIrWYRSYRRxbp%2FWu%2FykQun1%2B35ny5m0aaDjMxSf3MFekcZlycFRTQ10rlsuWM1s9%2BhLpXylNngzG3vHdGkW2bz9OP517BlnXWhY2P34BY%2BoAYR1osK8FBKK4odoSzaysmsi8akSHooHCTHCE2cW%2BBOVpP%2BO2INmJeS9tVkBqVweYfABSDq0SPcS19wIOoErm2S05pJEFWxJsyh%2B4m2YcmKgrq4883NBU4R6eNKMOfYsZcGOqgBZ59tHFFtRgH8HKVbbDAqkt8RxlyxhjhY6d1rixsLsUtJcPcZP%2FZZmV51SH3rGTfg0cMCEHUH1UMQOQCwXPhJq8VQcI6Wyz7ywNuiWwUiC7%2B2ekEAnKrUwfVyLtI0u1ntG4inL9eYVmM%2BO6w7Es2XjCz%2FHms3q1HEHK26rWukyk18TO118virTD7%2BAwU4otL8D5tlV0OLH8t6D%2B%2FwZN3q0Baxj1zbsFlo&X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Date=20220805T023429Z&X-Amz-SignedHeaders=host&X-Amz-Expires=300&X-Amz-Credential=ASIATOYXB4XYG76TKVPE%2F20220805%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Signature=b7cdd11b4ad70051d652bf9f0fa7e49e24b08c800f71211c495d53db2c0509d8'
Response:
Status Code: 200 OK
Content-Type:application/pdf
Content-Length:90616
Etag:8370fe54955cb4d7ab9967c7933c8210
with chunked content body