Operations (sample payloads)

Main operations

Apply created template

Add property groups to a Dropbox file. Template property groups can be created using the "Create template" operation. Sample Input

{
    "access_token": "sl.AbCdEfGhIjKlMnOpQrStUvWxYz1234567890",
    "path": "/Documents/Project_Report.docx",
    "property_groups": [
        {
            "template_id": "ptid:1a2b3c4d5e6f7g8h9i0j",
            "fields": [
                \{
                    "name": "Project",
                    "value": "Annual Report 2023"
                \},
                \{
                    "name": "Department",
                    "value": "Finance"
                \},
                \{
                    "name": "Status",
                    "value": "In Progress"
                \}
            ]
        },
        {
            "template_id": "ptid:0a1b2c3d4e5f6g7h8i9j",
            "fields": [
                \{
                    "name": "Confidentiality",
                    "value": "Internal Use Only"
                \},
                \{
                    "name": "ReviewDate",
                    "value": "2023-12-31"
                \}
            ]
        }
    ]
}

Sample Output

{
    "success": true
}

Continue list (pagination)

Retrieve further pages of results with a cursor. Sample Input

\{
    "access_token": "sl.A1B2C3D4E5F6G7H8I9J0K1L2M3N4O5P6",
    "list_url": "/files/list_folder",
    "cursor": "AAH_7wFUTPDZVPOmfDUwNjM2ODc3NDM4OTI5OmY5YzM4YTI4ZjI5MmM2Mzk5NDE5NDhjOGJiNzZhNGY5"
\}

Sample Output

\{
    "cursor": "AAH_7wFUTPDZVPOmfDUwNjM2ODc3NDM4OTI5OmY5YzM4YTI4ZjI5MmM2Mzk5NDE5NDhjOGJiNzZhNGY5",
    "has_more": true
\}

Copy file/folder

Copy a file/folder from a specified path to target location. Sample Input

\{
    "access_token": "sl.AbCdEfGhIjKlMnOpQrStUvWxYz1234567890",
    "from_path": "/Documents/Project_X/report.pdf",
    "to_path": "/Backup/Project_X_2023/report_copy.pdf",
    "allow_shared_folder": false,
    "autorename": true,
    "allow_ownership_transfer": false
\}

Sample Output

{
    "metadata": \{
        "name": "report_copy.pdf",
        "path_lower": "/backup/project_x_2023/report_copy.pdf",
        "path_display": "/Backup/Project_X_2023/report_copy.pdf",
        "id": "id:a1b2c3d4e5f6g7h8i9j0",
        "tag": "file"
    \}
}

Create file request

Create a file request. Sample Input

\{
    "access_token": "sl.AbCdEfGhIjKlMnOpQrStUvWxYz1234567890",
    "title": "Project Proposal Submissions",
    "destination": "/Project Proposals/2023",
    "open": true
\}

Sample Output

\{
    "id": "abcdef1234567890",
    "url": "https://www.dropbox.com/request/abcdef1234567890",
    "title": "Project Proposal Submissions",
    "destination": "/Project Proposals/2023",
    "created": "2023-05-15T14:30:00Z",
    "is_open": true,
    "file_count": 0
\}

Create folder

Crate a folder at a given path. Sample Input

\{
    "access_token": "sl.AbCdEfGhIjKlMnOpQrStUvWxYz1234567890",
    "path": "/Documents/Project X",
    "autorename": true
\}

Sample Output

{
    "metadata": \{
        "name": "Project X",
        "path_lower": "/documents/project x",
        "path_display": "/Documents/Project X",
        "id": "id:a1b2c3d4e5f6g7h8i9j0"
    \}
}

Create template

Add a template to be associated with the current authenticated user account. Sample Input

{
    "access_token": "sl.AbCdEfGhIjKlMnOpQrStUvWxYz1234567890",
    "name": "Project Proposal Template",
    "description": "A template for creating project proposals",
    "fields": [
        \{
            "name": "project_name",
            "description": "The name of the proposed project",
            "type": "string"
        \},
        \{
            "name": "start_date",
            "description": "The proposed start date of the project",
            "type": "string"
        \},
        \{
            "name": "budget",
            "description": "The estimated budget for the project",
            "type": "string"
        \},
        \{
            "name": "team_size",
            "description": "The number of team members required for the project",
            "type": "string"
        \}
    ]
}

Sample Output

{
    "template_id": "tmpl_AbCdEfGhIjKlMnOpQrStUvWx"
}

Get account info

Retrieve information about the current user's account. Sample Input

{
    "access_token": "sl.AbCdEfGhIjKlMnOpQrStUvWxYz1234567890-_"
}

Sample Output

{
    "account_id": "dbid:AAH4f99T0taONIb-OurWxbNQ6ywGRopQngc",
    "name": \{
        "given_name": "John",
        "surname": "Doe",
        "familiar_name": "Johnny",
        "display_name": "John Doe",
        "abbreviated_name": "JD"
    \},
    "email": "johndoe@example.com",
    "email_verified": true,
    "profile_photo_url": "https://dl-web.dropbox.com/account_photo/get/dbid%3AAAH4f99T0taONIb-OurWxbNQ6ywGRopQngc?size=128x128&vers=1634567890",
    "disabled": false,
    "country": "US",
    "locale": "en",
    "referral_link": "https://www.dropbox.com/referrals/r1a2b3c4d5e6f7g8h",
    "is_paired": true,
    "account_type": {
        ".tag": "basic"
    },
    "root_info": \{
        ".tag": "user",
        "root_namespace_id": "1234567890",
        "home_namespace_id": "1234567890"
    \}
}

Get file by path

Get a file from your dropbox account using its path. Sample Input

\{
    "access_token": "sl.AbCdEfGhIjKlMnOpQrStUvWxYz1234567890",
    "path": "/Documents/Project_Report.pdf"
\}

Sample Output

{
    "file": \{
        "name": "Project_Report.pdf",
        "url": "https://dl.dropboxusercontent.com/apitl/1/AbCdEfGhIjKlMnOpQrStUvWxYz",
        "mime_type": "application/pdf",
        "expires": 1623456789
    \}
}

Get file request

Retrieve the specified file request. Sample Input

\{
    "access_token": "sl.AbCdEfGhIjKlMnOpQrStUvWxYz1234567890",
    "file_request_id": "abcdef123456"
\}

Sample Output

\{
    "id": "abcdef123456",
    "url": "https://www.dropbox.com/request/abcdef123456",
    "title": "Project Submission",
    "destination": "/Project Submissions/",
    "created": "2023-05-15T10:30:00Z",
    "is_open": true,
    "file_count": 5
\}

Get file/folder metadata

Retrieve the metadata for a file or folder. Sample Input

\{
    "access_token": "sl.AbCdEfGhIjKlMnOpQrStUvWxYz1234567890",
    "path": "/Documents/Project_Report.docx",
    "include_media_info": true,
    "include_deleted": false,
    "include_has_explicit_shared_members": true
\}

Sample Output

\{
    "name": "Project_Report.docx",
    "path_lower": "/documents/project_report.docx",
    "path_display": "/Documents/Project_Report.docx",
    "id": "id:a1b2c3d4e5f6g7h8i9j0",
    "tag": "file"
\}

Get latest folder content cursor

Retrieve a "latest" cursor for "List folder content". Sample Input

\{
    "access_token": "sl.AbCdEfGhIjKlMnOpQrStUvWxYz1234567890",
    "path": "/Documents",
    "recursive": true,
    "include_deleted": false,
    "include_has_explicit_shared_members": true,
    "include_mounted_folders": true,
    "include_non_downloadable_files": true,
    "limit": 500
\}

Sample Output

{
    "cursor": "AAH_3wGxWWOQh9Rj3ZvkLcXKyYzNkL5OpQrStUvWxYz1234567890"
}

Get template

Get the schema for a specified template. Sample Input

\{
    "access_token": "sl.AbCdEfGhIjKlMnOpQrStUvWxYz1234567890",
    "template_id": "ptid:abcdefghijklmnopqrstuvwxyz123456"
\}

Sample Output

{
    "name": "Customer Feedback Form",
    "description": "A template for collecting customer feedback on our products and services",
    "fields": [
        {
            "name": "customer_name",
            "description": "Full name of the customer",
            "type": {
                ".tag": "string"
            }
        },
        {
            "name": "product_rating",
            "description": "Rating of the product (1-5)",
            "type": {
                ".tag": "number"
            }
        },
        {
            "name": "feedback_text",
            "description": "Detailed feedback from the customer",
            "type": {
                ".tag": "string"
            }
        }
    ]
}

List file requests

List your file requests. Sample Input

\{
    "access_token": "sl.AbCdEfGhIjKlMnOpQrStUvWxYz1234567890",
    "limit": 2
\}

Sample Output

{
    "file_requests": [
        \{
            "id": "abcdef123456",
            "url": "https://www.dropbox.com/request/abcdef123456",
            "title": "Project Submissions",
            "destination": "/Project Submissions",
            "created": "2023-05-15T10:30:00Z",
            "is_open": true,
            "file_count": 5
        \},
        \{
            "id": "ghijkl789012",
            "url": "https://www.dropbox.com/request/ghijkl789012",
            "title": "Vacation Photos",
            "destination": "/Shared Albums/Summer Vacation 2023",
            "created": "2023-06-01T14:45:00Z",
            "is_open": true,
            "file_count": 12
        \}
    ],
    "cursor": "AAFu-_dcrLzpzQqyZnSb8eMUbTBpDO1234567890",
    "has_more": true
}

List folder content

List the content of a folder. Sample Input

\{
    "access_token": "sl.AbCdEfGhIjKlMnOpQrStUvWxYz1234567890",
    "path": "/Documents",
    "recursive": false,
    "include_deleted": false,
    "include_has_explicit_shared_members": false,
    "include_mounted_folders": true,
    "include_non_downloadable_files": true,
    "limit": 100
\}

Sample Output

{
    "entries": [
        \{
            ".tag": "file",
            "name": "Project Proposal.docx",
            "path_lower": "/documents/project proposal.docx",
            "path_display": "/Documents/Project Proposal.docx",
            "id": "id:a1b2c3d4e5f6g7h8i9j0",
            "client_modified": "2023-05-15T14:32:18Z",
            "server_modified": "2023-05-15T14:32:20Z",
            "rev": "015a1b2c3d4e5f6g7h",
            "size": 2564738,
            "is_downloadable": true,
            "content_hash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"
        \},
        \{
            ".tag": "folder",
            "name": "Images",
            "path_lower": "/documents/images",
            "path_display": "/Documents/Images",
            "id": "id:k1l2m3n4o5p6q7r8s9t0"
        \},
        \{
            ".tag": "file",
            "name": "Budget.xlsx",
            "path_lower": "/documents/budget.xlsx",
            "path_display": "/Documents/Budget.xlsx",
            "id": "id:u1v2w3x4y5z6a7b8c9d0",
            "client_modified": "2023-05-10T09:15:30Z",
            "server_modified": "2023-05-10T09:15:32Z",
            "rev": "015b2c3d4e5f6g7h8i",
            "size": 1048576,
            "is_downloadable": true,
            "content_hash": "f3a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6q7r8s9t0u1v2w3x4y5z6a7b8c9d0"
        \}
    ],
    "cursor": "AAH_kWBToR9VpIVq8bGXpJ7Xh1h1234567890",
    "has_more": false
}

List templates

List the Template IDs associated with this user. Sample Input

{
    "access_token": "sl.AbCdEfGhIjKlMnOpQrStUvWxYz1234567890"
}

Sample Output

\{
    "template_ids": [
        "ptid:abcdefghijklmnopqrstuvwxyz123456",
        "ptid:zyxwvutsrqponmlkjihgfedcba654321",
        "ptid:1a2b3c4d5e6f7g8h9i0j1k2l3m4n5o6p"
    ]
\}

Raw HTTP request (advanced)

Perform a raw HTTP request with some pre-configuration and processing by the connector, such as authentication. Sample Input

{
    "access_token": "YOUR_ACCESS_TOKEN",
    "method": "POST",
    "url": {
        "endpoint": "/files/upload"
    },
    "headers": [
        \{
            "key": "Content-Type",
            "value": "application/octet-stream"
        \},
        {
            "key": "Dropbox-API-Arg",
            "value": "\{\"path\": \"/sample_file.txt\", \"mode\": \"add\", \"autorename\": true\}"
        }
    ],
    "body": {
        "raw": "This is the content of the file being uploaded to Dropbox."
    },
    "include_raw_body": true,
    "parse_response": "true"
}

Sample Output

{
    "response": {
        "status_code": 200,
        "headers": {
            "Content-Type": "application/json",
            "Dropbox-API-Result": "\{\"name\": \"sample_file.txt\", \"path_lower\": \"/sample_file.txt\", \"path_display\": \"/sample_file.txt\", \"id\": \"id:a4ayc_80_OEAAAAAAAAAXw\", \"client_modified\": \"2023-06-15T10:30:15Z\", \"server_modified\": \"2023-06-15T10:30:15Z\", \"rev\": \"015a0000000000000000000000000001\", \"size\": 48, \"is_downloadable\": true, \"content_hash\": \"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855\"\}"
        },
        "body": \{
            "name": "sample_file.txt",
            "path_lower": "/sample_file.txt",
            "path_display": "/sample_file.txt",
            "id": "id:a4ayc_80_OEAAAAAAAAAXw",
            "client_modified": "2023-06-15T10:30:15Z",
            "server_modified": "2023-06-15T10:30:15Z",
            "rev": "015a0000000000000000000000000001",
            "size": 48,
            "is_downloadable": true,
            "content_hash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"
        \}
    }
}

Update file request

Update a file request. Sample Input

\{
    "access_token": "sl.AbCdEfGhIjKlMnOpQrStUvWxYz1234567890",
    "file_request_id": "abcdefghijklmnopqrstuvwxyz",
    "title": "Updated Project Submissions",
    "destination": "/Project Files/Submissions",
    "open": false
\}

Sample Output

\{
    "id": "abcdefghijklmnopqrstuvwxyz",
    "url": "https://www.dropbox.com/request/abcdefghijklmnopqrstuvwxyz",
    "title": "Updated Project Submissions",
    "destination": "/Project Files/Submissions",
    "created": "2023-05-15T14:30:00Z",
    "is_open": false,
    "file_count": 12
\}

Upload file

Upload a file. Sample Input

{
    "access_token": "sl.AbCdEfGhIjKlMnOpQrStUvWxYz1234567890",
    "file": \{
        "name": "example.txt",
        "content": "This is the content of the file.",
        "content_type": "text/plain"
    \},
    "path": "/Documents/example.txt",
    "autorename": true
}

Sample Output

\{
    "name": "example.txt",
    "path_lower": "/documents/example.txt",
    "path_display": "/Documents/example.txt",
    "id": "id:a1b2c3d4e5f6g7h8i9j0",
    "client_modified": "2023-05-15T14:30:00Z",
    "server_modified": "2023-05-15T14:30:05Z",
    "rev": "015a1b2c3d4e5f6g7h",
    "size": 31,
    "is_downloadable": true,
    "content_hash": "abcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890"
\}

DDL operations

List file requests (DDL)

Sample Input

{
    "access_token": "sl.A1B2C3D4E5F6G7H8I9J0K1L2M3N4O5P6"
}

Sample Output

{
    "file_requests": [
        \{
            "id": "abcdef123456",
            "url": "https://www.dropbox.com/request/abcdef123456",
            "title": "Project Submissions",
            "created": "2023-05-15T10:30:00Z",
            "is_open": true,
            "file_count": 5,
            "destination": "/File Requests/Project Submissions",
            "deadline": "2023-06-15T23:59:59Z"
        \},
        \{
            "id": "ghijkl789012",
            "url": "https://www.dropbox.com/request/ghijkl789012",
            "title": "Vacation Photos",
            "created": "2023-04-01T14:45:00Z",
            "is_open": false,
            "file_count": 20,
            "destination": "/File Requests/Vacation Photos",
            "deadline": null
        \}
    ],
    "has_more": false
}

List folder content (DDL)

Note that DDL operations can only be called directly by Connectors API, or when using CustomJS in the Embedded solution editor for e.g. DDL-dependent data mapping


Sample Input

{
    "access_token": "sl.BfG8hJ2K3L4M5N6O7P8Q9R0S1T2U3V4W5X6Y7Z8a9b0c1d2e3f4g5h6i7j8k"
}

Sample Output

{
    "folders": [
        \{
            "name": "Documents",
            "path": "/Documents",
            "id": "id:abcdefghijklmnopqrst"
        \},
        \{
            "name": "Photos",
            "path": "/Photos",
            "id": "id:uvwxyz1234567890abcd"
        \}
    ],
    "files": [
        \{
            "name": "Project_Report.pdf",
            "path": "/Project_Report.pdf",
            "id": "id:efghijklmnopqrstuvwx",
            "size": 2456789,
            "modified": "2023-06-15T14:32:21Z"
        \},
        \{
            "name": "Meeting_Notes.docx",
            "path": "/Meeting_Notes.docx",
            "id": "id:yz1234567890abcdefghi",
            "size": 145678,
            "modified": "2023-06-14T09:45:30Z"
        \}
    ]
}

List templates (DDL)

Note that DDL operations can only be called directly by Connectors API, or when using CustomJS in the Embedded solution editor for e.g. DDL-dependent data mapping


Sample Input

{
    "access_token": "sl.AbCdEfGhIjKlMnOpQrStUvWxYz1234567890"
}

Sample Output

{
    "templates": [
        \{
            "id": "template_123456",
            "name": "Invoice Template",
            "description": "Standard invoice template for billing",
            "type": "docx",
            "last_modified": "2023-05-15T10:30:45Z"
        \},
        \{
            "id": "template_789012",
            "name": "Project Proposal",
            "description": "Template for creating project proposals",
            "type": "pptx",
            "last_modified": "2023-05-10T14:22:30Z"
        \},
        \{
            "id": "template_345678",
            "name": "Monthly Report",
            "description": "Template for generating monthly performance reports",
            "type": "xlsx",
            "last_modified": "2023-05-01T09:15:00Z"
        \}
    ],
    "cursor": "AAFu-_hGpqOBzPH2k-NEw-fK0EAAAAA6vgbMqRzMtlyDr1XjxCfmNdJJeGxF8bS_YYgFJzqNHFAZv1p4dkvlHQ",
    "has_more": false
}

Was this page helpful?