Home / Docs Center / Device API Reference / Scheduled SnapshotCA Authentication

Scheduled SnapshotCA Authentication

Device API Reference · New API

Project: Device API Document (New Version) | page_id: 1771

Upload CA Configuration API Document

Overview

Used to query and update the device upload CA configuration.

Route registration location:
- /xsw/api/sys/getUploadCAConf
- /xsw/api/sys/setUploadCAConf

Supported methods:
- GET
- POST

Common error return structure:

Field Type Description
code int32 0 on success; error code, usually 1000 on failure
msg string Error message

1. Get Upload CA Configuration

API Information

  • Path: /xsw/api/sys/getUploadCAConf
  • Method: GET / POST
  • Request body: none

Return Structure

On success, the object UploadCAConf is returned:

Field Type Description
enable int32 Upload CA verification mode
content string CA file text content

Notes:
- enable is read from the configuration item syscontrol.0.upload_ca_enable.
- When the CA file does not exist, content returns an empty string.

Success Example

{
  "enable": 1,
  "content": "-----BEGIN CERTIFICATE-----\n...\n-----END CERTIFICATE-----\n"
}

Failure Example

{
  "code": 1000,
  "msg": "...error reason..."
}

2. Set Upload CA Configuration

API Information

  • Path: /xsw/api/sys/setUploadCAConf
  • Method: GET / POST
  • Recommended Content-Type: application/json

Request Body

{
  "enable": 1,
  "content": "-----BEGIN CERTIFICATE-----\n...\n-----END CERTIFICATE-----\n"
}

Field description:

Field Type Required Description
enable int32 Yes Verification mode, allowed values: 0, 1, 2, 101
content string No CA file content; the CA file is not updated when it is an empty string

Parameter validation rules:
- enable only allows 0/1/2/101; otherwise the error is returned: enable should be 0,1,2,101.
- The request body must be valid JSON; otherwise the error is returned: invalid json body: ....

Processing Logic

  1. Parse the JSON request body into UploadCAConf.
  2. Verify whether enable is within the allowed range.
  3. If content is not empty, write the CA file.
  4. Update the configuration field syscontrol.0.upload_ca_enable.
  5. Persist the configuration.

Success Response

{
  "code": 0,
  "msg": ""
}

Failure Response

{
  "code": 1000,
  "msg": "...error reason..."
}

3. cURL Examples

Get Configuration

curl -X GET "http://<host>/xsw/api/sys/getUploadCAConf"

Update Configuration (Mode Only)

curl -X POST "http://<host>/xsw/api/sys/setUploadCAConf" \
  -H "Content-Type: application/json" \
  -d '{"enable":2,"content":""}'

Update Configuration (Mode + CA Content)

curl -X POST "http://<host>/xsw/api/sys/setUploadCAConf" \
  -H "Content-Type: application/json" \
  -d '{"enable":1,"content":"-----BEGIN CERTIFICATE-----\n...\n-----END CERTIFICATE-----\n"}'
Didn't find what you need?Contact us,Talk to our engineers directly.

Request a Quote

Fill in the form and we will get back with a quote and proposal within 1 business day.

Click "Generate inquiry email" to open your mail client with the body pre-filled. If no mail client is configured, click "Copy" and paste it into webmail — recipient: sunshiyang@xstrive.com.