Share¶
POST /api/v1/snapshots/{snapshot_uuid}/share
Overview¶
Generate a sharing link for the specified snapshot based on snapshot_uuid
.
Route Parameters¶
Parameter Name | Type | Required | Description |
---|---|---|---|
snapshot_uuid | string | Y | Snapshot UUID |
Body Request Parameters¶
Parameter Name | Type | Required | Description |
---|---|---|---|
changeTime | boolean | Whether to allow viewers to change the time range, default is false Can be null: False |
|
expirationAt | integer | Expiration time as a timestamp, permanent validity pass -1 Example: 1577758776 Can be null: False Can be an empty string: True |
|
extractionCode | string | Extraction code when accessing encrypted sharing Example: 123455x Can be null: False Can be an empty string: True Maximum length: 12 |
|
hiddenTopBar | boolean | Whether to hide the top bar, default is false Can be null: False |
|
showWatermark | boolean | Whether to display watermark, default is false Can be null: False |
|
maskCfg | None | ||
maskCfg.fields | string | Desensitization fields, multiple fields separated by commas Example: message,host Can be null: False Can be an empty string: True |
|
maskCfg.reExprs | array | Regular expressions Example: [{'name': 'jjj', 'reExpr': 'ss', 'enable': 0}, {'name': 'lll', 'reExpr': 'ss', 'enable': 1}] Can be null: False |
|
ipWhitelistSet | None | ||
ipWhitelistSet.isOpen | boolean | Whether to enable IP whitelist Can be null: False |
|
ipWhitelistSet.type | string | Type of enabling IP whitelist, followWorkspace Example: 123455x Can be null: False Can be an empty string: True Maximum length: 12 Optional values: ['followWorkspace', 'custom'] |
|
ipWhitelistSet.ipWhitelist | array | IP whitelist list, used when type is custom Example: [] Can be null: False |
Supplementary Parameter Explanation¶
Request Parameter Explanation
Parameter Name | Type | Description |
---|---|---|
changeTime | boolean | Whether to allow viewers to change the time range |
expirationAt | integer | Expiration time as a second-level timestamp, permanent validity pass -1 |
extractionCode | string | Extraction code when accessing encrypted sharing, default is public |
hiddenTopBar | boolean | Whether to hide the top bar, default is false |
showWatermark | boolean | Whether to display watermark |
maskCfg | dict | Desensitization configuration |
ipWhitelistSet | dict | Snapshot IP whitelist configuration |
Internal Fields Explanation of maskCfg | Parameter Name | Type | Description | |-----------------------|----------|------------------------| |fields |string| Desensitization fields, multiple fields separated by commas| |reExprs |array | List of regular expressions|
Internal Fields Explanation of maskCfg.reExprs | Parameter Name | Type | Description | |-----------------------|----------|------------------------| |name |string| Name of desensitization field| |reExpr |string | Regular expression| |enable |integer | Whether to enable 0,1|
Internal Fields Explanation of ipWhitelistSet | Parameter Name | Type | Description | |-----------------------|----------|------------------------| |isOpen |boolean| Expiration time as a second-level timestamp, permanent validity pass -1| |type |string | Type of enabling IP whitelist, follow workspace IP whitelist configuration: followWorkspace, custom: custom| |ipWhitelist |boolean | IP whitelist list, used when type is custom|
Request Example¶
curl 'https://openapi.guance.com/api/v1/snapshots/snap_xxxx32/share' \
-H 'DF-API-KEY: <DF-API-KEY>' \
-H 'Content-Type: application/json;charset=UTF-8' \
--data-raw '{"changeTime":true,"expirationAt":1730874467,"hiddenTopBar":false,"showWatermark":true,"maskCfg":{"fields":"","reExprs":[]},"ipWhitelistSet":{"isOpen":false},"changeTime":true}' \
--compressed
Response¶
{
"code": 200,
"content": {
"declaration": {
"asd": "aa,bb,cc,1,True",
"asdasd": "dawdawd",
"business": "aaa",
"dd": "dd",
"fawf": "afawf",
"organization": "64fe7b4062f74d0007b46676"
},
"isHidden": false,
"shortUrl": "https://aa.com/rj6mm3",
"token": "shared.eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ3c191dWlkIjoid2tzcF80YjU3YzdiYWIzOGU0YTJkOTYzMGY2NzVkYzIwMDE1ZCIsInNoYXJlX2NvbmZpZ191dWlkIjoic2hhcmVfNDhiYjBhMTExNDJhNDM0Nzk0NmM4Y2YxOWExZTAxZTYiLCJleHBpcmF0aW9uQXQiOjE3MzA4NzQ0NjcsInJlc291cmNlVHlwZSI6InNuYXBzaG90In0.ZMgLS7S1umNSMA8-zJIGQh4G8cEl4vl5fVHNHoIQrbU"
},
"errorCode": "",
"message": "",
"success": true,
"traceId": "TRACE-67FFC05B-64BA-4A56-B831-D3FCEFE4451C"
}