Common dataset

List common dataset a user can access

GET api/v2.1/dtable/common-datasets/

Sample request

curl -H 'Authorization: Token e39d9392d02a770e3edccdc5116da293a7773533' -H 'Accept: application/json; charset=utf-8; indent=4' "https://cloud.seatable.io/api/v2.1/dtable/common-datasets/"

Sample response

{
    "dataset_list": [
        {
            "id": 26,
            "org_id": -1,
            "dtable_uuid": "32b1e77a-3a4f-45fa-b420-6c231b20d4d2",
            "table_id": "0000",
            "view_id": "0000",
            "created_at": "2020-07-13T09:01:20+00:00",
            "creator": "f91a9c820b284249b3bb3396dc65bd64@auth.local",
            "dataset_name": "w2",
            "can_manage": true
        }
    ]
}

List common dataset a base can access

GET api/v2.1/dtable/common-datasets/

Request parameters

Sample request

curl -H 'Authorization: Token e39d9392d02a770e3edccdc5116da293a7773533' -H 'Accept: application/json; charset=utf-8; indent=4' "https://cloud.seatable.io/api/v2.1/dtable/common-datasets/?dst_dtable_uuid=32b1e77a3a4f45fab4206c231b20d4d2"

Sample response

{
    "dataset_list": [
        {
            "id": 26,
            "org_id": -1,
            "dtable_uuid": "32b1e77a-3a4f-45fa-b420-6c231b20d4d2",
            "table_id": "0000",
            "view_id": "0000",
            "created_at": "2020-07-13T09:01:20+00:00",
            "creator": "f91a9c820b284249b3bb3396dc65bd64@auth.local",
            "dataset_name": "w2",
            "can_manage": true
        }
    ]
}

List common dataset of all groups

GET api/v2.1/dtable/common-datasets/

Request parameters

Sample request

curl -H 'Authorization: Token e39d9392d02a770e3edccdc5116da293a7773533' -H 'Accept: application/json; charset=utf-8; indent=4' "https://cloud.seatable.cn/api/v2.1/dtable/common-datasets/?by_group=true"

Sample response

{
    "dataset_list":[
        {
            "group_name":"sys-dep-1",
            "group_id":9,
            "datasets":[
                {
                    "id":13,
                    "org_id":-1,
                    "group_id":9,
                    "dtable_uuid":"66b1b83f-bb80-45d3-b684-4e05cb6a1018",
                    "table_id":"0000",
                    "view_id":"0000",
                    "created_at":"2021-04-10T22:52:38+08:00",
                    "creator":"admin",
                    "dataset_name":"demo",
                    "can_manage":true,
                    "dtable_name":"demo",
                    "workspace_id":17,
                    "dtable_icon":"icon-work-log",
                    "dtable_color":"#972CB0"
                }
            ]
        }
    ]
}

Publish a common dataset from a view

POST api/v2.1/dtable/common-datasets/

Request parameters

Sample request

curl -X POST  -H 'Authorization: Token e39d9392d02a770e3edccdc5116da293a7773533' -H 'Accept: application/json; charset=utf-8; indent=4' "https://cloud.seatable.io/api/v2.1/dtable/common-datasets/" -d 'dataset_name=test1&workspace_id=1&dtable_name=t1&table_name=Table1&view'

Sample response

{
    "id": 26,
    "org_id": -1,
    "dtable_uuid": "32b1e77a-3a4f-45fa-b420-6c231b20d4d2",
    "table_id": "0000",
    "view_id": "0000",
    "created_at": "2020-07-13T09:01:20+00:00",
    "creator": "f91a9c820b284249b3bb3396dc65bd64@auth.local",
    "dataset_name": "test1",
}

Get contents of a common dataset

GET api/v2.1/dtable/common-datasets/:dataset_id/

Sample request

curl -H 'Authorization: Token e39d9392d02a770e3edccdc5116da293a7773533' -H 'Accept: application/json; charset=utf-8; indent=4' "https://cloud.seatable.io/api/v2.1/dtable/common-datasets/26/"

Sample response

{
    "rows": [
        {
            "_id": "Sn7svBUYTTmup7WuMsJhGw",
            "Name": "11"
        }
    ],
    "columns": [
        {
            "key": "0000",
            "name": "Name",
            "type": "text",
            "width": 200,
            "editable": true,
            "resizable": true
        }
    ],
    "related_user_list": [
        {
            "email": "f91a9c820b284249b3bb3396dc65bd64@auth.local",
            "name": "admin",
            "contact_email": "foo@foo.com",
            "avatar_url": "http://127.0.0.1:8000/media/avatars/default.png"
        }
    ]
}

Update a common dataset

PUT /api/v2.1/dtable/common-datasets/:dataset_id/

Request parameters

Sample request

curl -L -X PUT 'https://cloud.seatable.io/api/v2.1/dtable/common-datasets/14/' \
-H 'Authorization: Token 5c333d6f00fcb280b25703caba6c47b45d8a8d62' \
-H 'Cookie: dtable_csrftoken=F2TF8caiukNTCPEkssuqs2fOpuESsozCWm6zeHWxrGaEto5aZIDxoQWv1fymLuxK' \
-F 'dataset_name="111332"'

Sample response

{
    "dataset": {
        "id": 14,
        "org_id": -1,
        "group_id": 1,
        "dtable_uuid": "64468034-2ab9-4e6a-9ed6-bba46d6d7e8c",
        "table_id": "0000",
        "view_id": "0000",
        "created_at": "2022-02-08T15:27:53+08:00",
        "creator": "admin",
        "dataset_name": "111332",
        "can_manage": true,
        "dtable_name": "test-publish-CDS",
        "workspace_id": 2,
        "dtable_icon": null,
        "dtable_color": null
    }
}

Delete a common dataset

DELETE api/v2.1/dtable/common-datasets/:dataset_id/

Sample request

curl -X DELETE 'Authorization: Token e39d9392d02a770e3edccdc5116da293a7773533' -H 'Accept: application/json; charset=utf-8; indent=4' "https://cloud.seatable.io/api/v2.1/dtable/common-datasets/26/"

Sample response

{
    "success": true
}

Import a common dataset

POST api/v2.1/dtable/common-datasets/:dataset_id/import/

Request parameters

sample request

curl -X POST https://cloud.seatable.cn/api/v2.1/dtable/common-datasets/92/import/ -H 'Authorization: Token bc02529369168f8892c0ff1584cf3e6e8884c4d6' -H 'Content-Type: application/json' -d '{
  "dst_dtable_uuid":"4786bdda-01d9-48cb-820c-05907d4e6be8",
}'

sample response

{
    "task_id": "1654654935162"
}

Sync imported common dataset

POST api/v2.1/dtable/common-datasets/:dataset_id/sync/

Request parameters

sample request

curl -X POST https://cloud.seatable.cn/api/v2.1/dtable/common-datasets/92/sync/ -H 'Authorization: Token bc02529369168f8892c0ff1584cf3e6e8884c4d6' -H 'Content-Type: application/json' -d '{
  "dst_dtable_uuid":"4786bdda-01d9-48cb-820c-05907d4e6be8",
  "dst_table_id":"DR5e"
}'

sample response

{
    "task_id": "1654654935162"
}

Update common dataset sync config

PUT api/v2.1/dtable/common-datasets/\<dataset_id>/sync/

Request Params

Sample Request

curl -X PUT http://127.0.0.1:8000/GET api/v2.1/dtable/common-datasets/20/sync/ -H 'Authorization: Token 8daddaecd02cf939df7047310953e533f1e8cc54' -H 'Content-Type: application/json' -d '{
  "is_sync_periodically":"false",
  "dst_dtable_uuid":"e4bac752-3322-4c25-9866-3e1d93ecb05f",
  "dst_table_id": "yXjp",
}'

Sample Response

{
  "success": true
}

Errors

List common dataset sync record

GET api/v2.1/dtable/common-datasets/syncs/

Request parameters

sample request

curl -X GET 'https://cloud.seatable.cn/api/v2.1/dtable/common-datasets/syncs/?dst_dtable_uuid=4786bdda-01d9-48cb-820c-05907d4e6be8' -H 'Authorization: Token bc02529369168f8892c0ff1584cf3e6e8884c4d6'

sample response

{
    "dataset_sync_list": [
        {
            "id": 101,
            "dataset_id": 92,
            "dst_dtable_uuid": "4786bdda-01d9-48cb-820c-05907d4e6be8",
            "dst_table_id": "DR5e",
            "created_at": "2022-01-19T11:36:57+08:00",
            "creator": "freeplant@163.com",
            "last_sync_time": "2022-01-19T11:36:57+08:00",
            "src_version": 3551,
            "is_sync_periodically": false,
            "is_valid": true
        },
        {
            "id": 219,
            "dataset_id": 13,
            "dst_dtable_uuid": "4786bdda-01d9-48cb-820c-05907d4e6be8",
            "dst_table_id": "mTKE",
            "created_at": "2022-06-08T10:25:45+08:00",
            "creator": "jiwei.ran@seafile.com",
            "last_sync_time": "2022-06-08T10:25:45+08:00",
            "src_version": 799,
            "is_sync_periodically": false,
            "is_valid": true
        }
    ]
}

Last modified by seatable, 2022-06-08

List common dataset a user can access
List common dataset a base can access
List common dataset of all groups
Publish a common dataset from a view
Get contents of a common dataset
Update a common dataset
Delete a common dataset
Import a common dataset
Sync imported common dataset
Update common dataset sync config
List common dataset sync record