Skip to content

Share



POST /api/v1/snapshots/{snapshot_uuid}/share

Overview

Generate a share link for the specified snapshot based on snapshot_uuid

Route Parameters

Parameter Type Required Description
snapshot_uuid string Y Snapshot UUID

Body Request Parameters

Parameter Type Required Description
changeTime boolean Whether to allow viewers to change the time range, default is false
Allow empty: False
expirationAt integer Expiration time is a timestamp, permanent valid if -1
Example: 1577758776
Allow empty: False
Allow empty string: True
extractionCode string Extraction code for encrypted sharing
Example: 123455x
Allow empty: False
Allow empty string: True
Max length: 12
hiddenTopBar boolean Whether to hide the top bar, default is false
Allow empty: False
showWatermark boolean Whether to show watermark, default false
Allow empty: False
maskCfg None
maskCfg.fields string Masked fields, multiple fields separated by commas
Example: message,host
Allow empty: False
Allow empty string: True
maskCfg.reExprs array Regular expressions
Example: [{'name': 'jjj', 'reExpr': 'ss', 'enable': 0}, {'name': 'lll', 'reExpr': 'ss', 'enable': 1}]
Allow empty: False
ipWhitelistSet None
ipWhitelistSet.isOpen boolean Whether to enable IP whitelist
Allow empty: False
ipWhitelistSet.type string Type of IP whitelist, followWorkspace
Example: 123455x
Allow empty: False
Allow empty string: True
Max length: 12
Optional values: ['followWorkspace', 'custom']
ipWhitelistSet.ipWhitelist array IP whitelist list, used when type is custom
Example: []
Allow empty: False

Parameter Additional Explanation

Request Parameter Explanation

Parameter Type Description
changeTime boolean Whether to allow viewers to change the time range
expirationAt integer Expiration time is a timestamp, permanent valid if -1
extractionCode string Extraction code for encrypted sharing, default is public
hiddenTopBar boolean Whether to hide the top bar, default is false
showWatermark boolean Whether to show watermark
maskCfg dict Mask configuration
ipWhitelistSet dict Snapshot IP whitelist configuration

maskCfg Internal Field Explanation

Parameter Type Description
fields string Masked fields, multiple fields separated by commas
reExprs array Regular expression list

maskCfg.reExprs Internal Field Explanation

Parameter Type Description
name string Masked field name
reExpr string Regular expression
enable integer Whether to enable 0,1

ipWhitelistSet Internal Field Explanation

Parameter Type Description
isOpen boolean Expiration time is a timestamp, permanent valid if -1
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? ×