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 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
Allow empty: False
expirationAt integer Expiration time as a timestamp, pass -1 for permanent validity
Example: 1577758776
Allow empty: False
Allow empty string: True
extractionCode string Extraction code for accessing 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 show watermark, default false
Allow empty: False
maskCfg None
maskCfg.fields string Fields to be masked, 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 to enable, 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 Name type Description
changeTime boolean Whether to allow viewers to change the time range
expirationAt integer Expiration time as a second-level timestamp, pass -1 for permanent validity
extractionCode string Extraction code for accessing when creating an encrypted share, public by default
hiddenTopBar boolean Whether to hide the top bar, default is false
showWatermark boolean Whether to show watermark
maskCfg dict Masking configuration
ipWhitelistSet dict Snapshot IP whitelist configuration

maskCfg Internal Field Description

Parameter Name type Description
fields string Fields to be masked, multiple fields separated by commas
reExprs array List of regular expressions

maskCfg.reExprs Internal Field Description

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

ipWhitelistSet Internal Field Description

Parameter Name type Description
isOpen boolean Expiration time as a second-level timestamp, pass -1 for permanent validity
type string Type of IP whitelist to enable, follow workspace IP whitelist configuration: followWorkspace, custom: custom
ipWhitelist boolean IP whitelist list, used when type is custom

Request Example

curl 'https://openapi.truewatch.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": "eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.<payload>.<signature>"
    },
    "errorCode": "",
    "message": "",
    "success": true,
    "traceId": "TRACE-67FFC05B-64BA-4A56-B831-D3FCEFE4451C"
}