Skip to content

Share a Snapshot



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 the viewer to change the time range, defaults to false
Can be null: False
expirationAt integer Expiration time as a timestamp, permanent validity if set to -1
Example: 1577758776
Can be null: False
Can be empty string: True
extractionCode string Extraction code when creating encrypted sharing
Example: 123455x
Can be null: False
Can be empty string: True
Maximum length: 12 < br>
hiddenTopBar boolean Whether to hide the top bar, defaults to false
Can be null: False
showWatermark boolean Whether to display watermark, defaults to false
Can be null: False
maskCfg None
maskCfg.fields string Sensitive fields, multiple fields separated by commas
Example: message,host
Can be null: False
Can be 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 < br>
ipWhitelistSet.type string Type of IP whitelist, followWorkspace
Example: 123455x
Can be null: False
Can be empty string: True
Maximum length: 12
Possible values: ['followWorkspace', 'custom'] < br>
ipWhitelistSet.ipWhitelist array IP whitelist list, used when type is custom
Example: []
Can be null: False < br>

Additional Parameter Explanation

Request Parameter Explanation

Parameter Name Type Description
changeTime boolean Whether to allow the viewer to change the time range
expirationAt integer Expiration time as a second-level timestamp, permanent validity if set to -1
extractionCode string Extraction code when creating encrypted sharing, default public
hiddenTopBar boolean Whether to hide the top bar, defaults to false
showWatermark boolean Whether to display watermark
maskCfg dict Desensitization configuration
ipWhitelistSet dict Snapshot IP whitelist configuration

Explanation of Internal Fields in maskCfg | Parameter Name | Type | Description | |-----------------------|----------|------------------------| |fields |string| Sensitive fields, multiple fields separated by commas| |reExprs |array | List of regular expressions|


Explanation of Internal Fields in maskCfg.reExprs | Parameter Name | Type | Description | |-----------------------|----------|------------------------| |name |string| Name of the sensitive field| |reExpr |string | Regular expression| |enable |integer | Whether enabled 0,1|


Explanation of Internal Fields in ipWhitelistSet | Parameter Name | Type | Description | |-----------------------|----------|------------------------| |isOpen |boolean| Whether to enable IP whitelist| |type |string | Type of 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"
} 

Feedback

Is this page helpful? ×