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 as a timestamp, permanent validity if -1 is passed
Example: 1577758776
Allow empty: False
Allow empty string: True
extractionCode string Extraction code for access when creating an encrypted share
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 display watermark, default false
Allow empty: False
maskCfg None
maskCfg.fields string Desensitization 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 enabling 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 Supplementary Description

Request Parameter Description

Parameter type Description
changeTime boolean Whether to allow viewers to change the time range
expirationAt integer Expiration time as a second-level timestamp, permanent validity if -1 is passed
extractionCode string Extraction code for access when creating an encrypted share, public by default
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

maskCfg Internal Field Description

Parameter type Description
fields string Desensitization fields, multiple fields separated by commas
reExprs array Regular expressions list

maskCfg.reExprs Internal Field Description

Parameter type Description
name string Desensitization field name
reExpr string Regular expression
enable integer Whether to enable 0,1

ipWhitelistSet Internal Field Description

Parameter type Description
isOpen boolean Expiration time as a second-level timestamp, permanent validity if -1 is passed
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"
} 

Feedback

Is this page helpful? ×