Skip to main content

Quickstart

Follow the Agave Link Quickstart to authenticate as a test user and get your Account-Token.

Once you have an Account Token, you can use that to create a temporary, limited-in-scope Link Session:

Request

curl --request POST 'https://api.agaveapi.com/link/sessions' \
--header 'API-Version: 2021-11-21' \
--header 'Content-Type: application/json' \
--header 'Client-Id: your_client_id' \
--header 'Client-Secret: your_client_secret' \
--header 'Account-Token: your_account_token' \
--data-raw '{
"name": "file picker session",
"ttl": "1800",
"mode": "construction-file-picker"
}'

This creates a session (valid for 1800 seconds, or 30 minutes) limited to read-only operations on construction documents, drawings, and specifications. To learn more about these options, see Link Session.

Response

{
"id": "9c2f9482-210f-43a6-b39b-40ddd5f21676",
"name": "file picker session",
"session": "iJMLvBa5Tuyd0i2ur9FcPlE1NCM1iKzIDjX8HLwl",
"scopes": [
"link:read",
"construction.projects:read",
"construction.documents:read",
"construction.drawings:read",
"construction.specifications:read"
],
"expires_at": "2022-04-11T04:06:26Z"
}

Step 3: Serve Agave File Picker

You can initialize Agave File Picker using the session returned in Step 2. Agave File Picker allows your users to select files from a linked Source Systems to share with you for download, upload, or other operations.

Step 4: Access Selected Files

As shown in the above example, you can access the selected files in the onSubmit callback.

The submission argument passed to the callback can include documents, drawings, and specifications from more than one construction project. You can use the project_id property to know which project they belong to.

You can also use the id property of each returned object to make further API calls: drawings, documents, and specifications.

Example Submission

{
"drawings": [
{
"id": "f2683af2-c783-5314-92f5-31b24150f3c3",
"source_id": "570073",
"creator_id": null,
"discipline": "Architectural",
"drawing_version_id": "50fcd2e5-cf92-5a7c-8afd-41235623be07",
"filename": null,
"name": "LIFE SAFETY PLANS",
"number": "A003",
"preview_url": "https://storage.agaveapi.com/preview/file.pdf?signature=xxx&expires_at=20220530T031901Z",
"source_create_time": null,
"source_update_time": "2018-02-15",
"version": "0",
"project_id": "39aaea67-0509-5d18-a304-edd540fcf0de",
"url": "https://storage.agaveapi.com/download/file.pdf?signature=xxx&expires_at=20220530T031901Z"
},
{
"id": "103aa9da-efb3-5679-85da-390e1502a48b",
"source_id": "570075",
"creator_id": null,
"discipline": "Architectural",
"drawing_version_id": "10190c8a-5c6b-57d2-b852-17b2df794f60",
"filename": null,
"name": "ARCHITECTURAL SITE PLAN",
"number": "A100",
"preview_url": "https://storage.agaveapi.com/preview/file.pdf?signature=xxx&expires_at=20220530T031901Z",
"source_create_time": null,
"source_update_time": "2018-02-15",
"version": "0",
"project_id": "39aaea67-0509-5d18-a304-edd540fcf0de",
"url": "https://storage.agaveapi.com/download/file.pdf?signature=xxx&expires_at=20220530T031901Z"
},
{
"id": "2261b69f-1d04-53fb-a5be-de7e4027f4da",
"source_id": "1031555",
"creator_id": null,
"discipline": "Equipment",
"drawing_version_id": "a951d3b8-419f-5be1-ade6-4053be3f456e",
"filename": null,
"name": "Architectural 2nd Floor New Revision",
"number": "A113",
"preview_url": "https://storage.agaveapi.com/preview/file.pdf?signature=xxx&expires_at=20220530T031901Z",
"source_create_time": null,
"source_update_time": "2021-10-31",
"version": "0",
"project_id": "616f525d-40dd-5527-9381-7a6ac12d1f89",
"url": "https://storage.agaveapi.com/download/file.pdf?signature=xxx&expires_at=20220530T031901Z"
}
],
"documents": [
{
"id": "8a77ea7d-1556-5dfc-8c8e-9fa7db0c2fd1",
"source_id": "9387453",
"name": "A113_ FIRST FLOOR - REFLECTED CEILING PLAN Rev.0 markup.pdf",
"project_id": "39aaea67-0509-5d18-a304-edd540fcf0de",
"creator_id": "314aa464-1cd9-5f72-95f8-eb046e09ada8",
"folder_id": "f16aae42-ae5e-5977-89ec-6a6e89749366",
"preview_url": "https://storage.agaveapi.com/preview/file.pdf?signature=xxx&expires_at=20220530T031901Z",
"size": "916029",
"type": "Adobe Acrobat PDF",
"source_create_time": "2021-10-29",
"source_update_time": "2021-10-29",
"url": "https://storage.agaveapi.com/download/file.pdf?signature=xxx&expires_at=20220530T031901Z"
},
{
"id": "70a5fae3-dc7c-5d6c-8bfc-9ce8619cfe1d",
"source_id": "9790493",
"name": "example.pdf",
"project_id": "616f525d-40dd-5527-9381-7a6ac12d1f89",
"creator_id": "314aa464-1cd9-5f72-95f8-eb046e09ada8",
"folder_id": "02305cc5-c7f8-5814-a970-246cdc4ea45d",
"preview_url": "https://storage.agaveapi.com/preview/file.pdf?signature=xxx&expires_at=20220530T031901Z",
"size": "1006735",
"type": "Adobe Acrobat PDF",
"source_create_time": "2022-03-31",
"source_update_time": "2022-03-31",
"url": "https://storage.agaveapi.com/download/file.pdf?signature=xxx&expires_at=20220530T031901Z"
},
{
"id": "fee24b87-bd60-5b7b-b794-f6dc2d657075",
"source_id": "9610160",
"name": "team.jpg",
"project_id": "616f525d-40dd-5527-9381-7a6ac12d1f89",
"creator_id": "314aa464-1cd9-5f72-95f8-eb046e09ada8",
"folder_id": "02305cc5-c7f8-5814-a970-246cdc4ea45d",
"preview_url": "https://storage.agaveapi.com/preview/file.pdf?signature=xxx&expires_at=20220530T031901Z",
"size": "625663",
"type": "JPEG Image",
"source_create_time": "2022-01-26",
"source_update_time": "2022-01-26",
"url": "https://storage.agaveapi.com/download/file.pdf?signature=xxx&expires_at=20220530T031901Z"
}
],
"specifications": [
{
"id": "a2823275-8b18-50f0-a1bf-0fa713ad1067",
"source_id": "3424",
"name": "Cover",
"number": "0.1",
"preview_url": "https://storage.agaveapi.com/preview/file.pdf?signature=xxx&expires_at=20220530T031901Z",
"section_version_id": "6aa01e3a-2ecd-5024-b603-dbe557ef2812",
"project_id": "616f525d-40dd-5527-9381-7a6ac12d1f89",
"url": "https://storage.agaveapi.com/download/file.pdf?signature=xxx&expires_at=20220530T031901Z"
},
{
"id": "4611daf1-e80a-5ec6-be8a-945e212601b5",
"source_id": "3425",
"name": "About",
"number": "0.2",
"preview_url": "https://storage.agaveapi.com/preview/file.pdf?signature=xxx&expires_at=20220530T031901Z",
"section_version_id": "ca517eb4-4980-523c-8fb7-172bbb15d49d",
"project_id": "616f525d-40dd-5527-9381-7a6ac12d1f89",
"url": "https://storage.agaveapi.com/download/file.pdf?signature=xxx&expires_at=20220530T031901Z"
},
{
"id": "c3ac4ca9-48fd-5b6c-89ce-7fd7d36315f7",
"source_id": "3426",
"name": "Reference",
"number": "0.3",
"preview_url": "https://storage.agaveapi.com/preview/file.pdf?signature=xxx&expires_at=20220530T031901Z",
"section_version_id": "7f38d391-b6cc-55a6-aef5-730db7317a5f",
"project_id": "616f525d-40dd-5527-9381-7a6ac12d1f89",
"url": "https://storage.agaveapi.com/download/file.pdf?signature=xxx&expires_at=20220530T031901Z"
}
]
}