DELETE - Delete Label

Introduces the interface invocation method of the Delete Label interface.

DELETE Request Description

A complete DELETE request should include the following four parameter contents:
  • url: The address of the request.
  • headers: The HTTP headers of the request.
  • data: The metadata information sent, example format is:
    metadata = {   
                        "app": "875a2442-2fe6-49a5-abf7-00fbd727e99e",
                        "queryID": "8a0aa812-0f80-4d25-8e3f-60583bac8b96",
                        "labels": {
                        "test_key": "tt_value",
                        "id": "8888"
                        },
                        "sendBack": {
                        "type": "response"
                        }
                        }
  • files: The local files to be operated on.
Note: For complete code examples, refer to the Python request examples in the tagging chapter. POST -Add Label

Request Address

https://<ucwi_endpoint>:5443/skg/v1/dlp/label/custom/<request_mode>

Request URL and Header

Parameter Name Parameter Location Required Description
authorization header Yes The authentication information in the request. Refer to the chapter for details Authentication.
x-skg-timestamp header Yes The current Timestamp. Refer to the chapter for details Authentication.
<request_mode> url Yes
  • sync - Synchronous mode
  • async - Asynchronous mode

Request Metadata

Parameter Name Type Applicable Status Description
labels Dict (Required) Synchronous and Asynchronous The content of the custom labels to be added
app String (Required) Synchronous and Asynchronous WebService Application ID
sendBack Dict (Required) Synchronous and Asynchronous The way to handle the file after deleting the label, supports local return, HTTP upload, and cloud storage such as Amazon S3, Swift.
  • response: Return the content after deleting the label to the current path. The following is a code example:
    {
                                    "queryID": "1075893f-b0ed-4a76-a07d-df3d2fc0de46",
                                    ......,
                                    "sendBack": {
                                    "type": "response", # Return the content after deleting the label to the current path
                                    }
                                    }
  • httpUpload: Send the content after deleting the label to the specified URL. The following is a code example:
    {
                                    "queryID": "1075893f-b0ed-4a76-a07d-df3d2fc0de46",
                                    ......,
                                    "sendBack": {
                                    "type": "httpUpload",
                                    "url": "http://172.11.11.6/callback", 
                                    # Send the content after deleting the label to this url
                                    }
                                    }
  • s3: Upload the content after deleting the label to the specified location in the s3 object storage. The following is a code example:
    {
                                    "queryID": "1075893f-b0ed-4a76-a07d-df3d2fc0de46",
                                    ......,
                                    "sendBack": {
                                    "type": "s3",
                                    "s3Bucket": "test",
                                    "s3Region": "",  # Upload the file after deleting the label to this location.
                                    # The value here is the region name when using s3,
                                    # If running on EC2 and using AWS IAM role, the following three items can be omitted
                                    "accessKey": "aws_accessKey",
                                    "secretKey": "aws_secretKey",
                                    "endpointUrl": "",
                                    }
                                    }
    swift: Upload the content after deleting the label to the specified location in the swift object storage. The following is a code example:
    {
                                        "queryID": "1075893f-b0ed-4a76-a07d-df3d2fc0de46",
                                        ......,
                                        "sendBack": {
                                        "type": "swift",
                                        "X-Auth-Token": "AUTH_tkbdac2a3474ee4d6396133c99cfd962c8",  
                                        # The authentication token when using swift, if the provided X-Auth-Token is valid, the following three items can be omitted.
                                        "authUrl": "http://172.22.117.120:8080/auth/v1.0",
                                        "X-Auth-User": "test",
                                        "X-Auth-Key": "test",
                                        "objectUrl": "http://172.22.117.120:8080/auth/v1.0/AUTH_test/container1/1.txt",  
                                        # Upload the file after deleting the label to this object URL location in swift object storage.
                                        # Choose one between objectUrl and ContainerUrl.
                                        "containerUrl": "", 
                                        # Upload the file after deleting the label to this container URL location in swift object storage.
                                        # Choose one between objectUrl and ContainerUrl.
                                        }
                                        }
queryID String (Required) Synchronous and Asynchronous sync/async (synchronous or asynchronous mode)
uploadtype String (Required) Asynchronous Only for asynchronous. Supports AWS S3, Alibaba Cloud OSS, Tencent Cloud COS, Swift, etc.
  • swift
  • oss
  • cos
  • s3
callback_url String (Required) Asynchronous The URL of the callback function must be filled in for asynchronous mode only
objectInfo Dict (Optional) Asynchronous Only for asynchronous mode and when using object storage. Asynchronous mode supports reviewing objects stored in Amazon S3, Swift, Alibaba Cloud OSS, Tencent Cloud COS, and other cloud services. For specific setting parameters, refer to the chapter: objectinfo Parameters for Reviewing Cloud Service Stored Content in Asynchronous Mode

Synchronous Request Parameter Example

{   
                    "app": "875a2442-2fe6-49a5-abf7-00fbd727e99e",
                    "queryID": "8a0aa812-0f80-4d25-8e3f-60583bac8b96",
                    "labels": {
                    "test_key": "tt_value",
                    "id": "8888"
                    },
                    "sendBack": {
                    "type": "response"
                    }
                    }

Asynchronous Request Parameter Example

{
                    "labels": {
                    "test_key": "tt_value",
                    "id": "8888"
                    },
                    "app": "875a2442-2fe6-49a5-abf7-00fbd727e99e",
                    "queryID": "8a0aa812-0f80-4d25-8e3f-60583bac8b96",
                    "callback_url": "http://172.11.9.1:8000/callback",
                    "sendBack": {
                    "type": "s3",
                    "s3Bucket": "leo",
                    "s3Region": "",  # The region name when using s3, if running on EC2 and using AWS IAM role, the following three items can be omitted
                    "accessKey": "admin",
                    "secretKey": "admin123",
                    "endpointUrl": "http://172.22.132.160:9000",
                    },
                    "uploadtype": "file"
                    }

Error code

If calling the API has an error, the following error codes are returned:
Error Code Description
400 Invalid parameter
404 Unknown Error
500 Invalid parameter