Skip to main content

API access

Requests and authentication​

All OpenAPI V1 endpoints use POST and start with /api/open/v1. Send a UTF-8 JSON object up to 2 MiB. Send {} when there are no business parameters.

An AK/SK pair belongs to a subaccount. Requests are authorized using that subaccount's feature and resource permissions. Accounts with credential management permission can get or reset credentials through the AK/SK action in the Console's subaccount list.

Request headerRequiredDescription
Content-TypeYesapplication/json.
AccessKeyIdYesThe subaccount's AK.
SignatureMethodYesSet to HmacSHA256.
TimestampYesUTC time in ISO 8601 format, such as 2026-11-30T08:00:00Z. It must be within 5 minutes of the server time.
SignatureNonceYesUse a new random value for each request, up to 128 characters. A UUID is suitable.
SignatureYesSignature encoded in standard Base64.
Idempotency-KeyConditionally requiredRequired for DataSource and subaccount management writes. Use 1 to 128 visible ASCII characters.

Calculate the signature​

Join the following items in order using LF (\n). End the string at the last character of the request body digest.

  1. HTTP method. Use POST.
  2. Full endpoint path, starting with /api/open/v1/.
  3. Raw query string after the question mark. Use an empty string if omitted.
  4. AccessKeyId.
  5. SignatureMethod.
  6. Timestamp.
  7. SignatureNonce.
  8. Idempotency-Key. Use an empty string if omitted.
  9. SHA-256 digest of the exact request body bytes sent, encoded in lowercase hexadecimal.

Use the UTF-8 bytes of the SK as the HMAC-SHA256 key, sign the string, and encode the result in standard Base64.

Example API call​

Set the CLOUDDM_BASE_URL, CLOUDDM_ACCESS_KEY_ID, and CLOUDDM_SECRET_KEY environment variables, then run the Python example below. DataSource type list

import base64
import hashlib
import hmac
import os
import uuid
from datetime import datetime, timezone
from urllib.parse import urlsplit
from urllib.request import Request, urlopen

base_url = os.environ["CLOUDDM_BASE_URL"].rstrip("/")
access_key_id = os.environ["CLOUDDM_ACCESS_KEY_ID"]
secret_key = os.environ["CLOUDDM_SECRET_KEY"]
path = "/api/open/v1/datasource/listDataSourceTypes"
url = base_url + path
body = b"{}"
method = "POST"
signature_method = "HmacSHA256"
timestamp = datetime.now(timezone.utc).strftime("%Y-%m-%dT%H:%M:%SZ")
nonce = str(uuid.uuid4())
idempotency_key = ""

string_to_sign = "\n".join([
method,
path,
urlsplit(url).query,
access_key_id,
signature_method,
timestamp,
nonce,
idempotency_key,
hashlib.sha256(body).hexdigest(),
])
signature = base64.b64encode(
hmac.digest(secret_key.encode("utf-8"), string_to_sign.encode("utf-8"), "sha256")
).decode("ascii")

headers = {
"Content-Type": "application/json",
"AccessKeyId": access_key_id,
"SignatureMethod": signature_method,
"Timestamp": timestamp,
"SignatureNonce": nonce,
"Signature": signature,
}
if idempotency_key:
headers["Idempotency-Key"] = idempotency_key

request = Request(url, data=body, headers=headers, method=method)
with urlopen(request, timeout=30) as response:
print(response.read().decode("utf-8"))

Pagination​

ParameterTypeRequiredDescription
pageNumberIntegerYesPage number, starting at 1.
pageSizeIntegerYesNumber of records per page, from 1 to 100.

data.items contains the current page's records. data.total is the number of records that match the permissions and filters. A page beyond the last page returns an empty items array.

Idempotent retries​

Generate an Idempotency-Key for each management write. On retry, reuse the original key, query string, and request body, and generate a new Timestamp, SignatureNonce, and Signature.

Successful responses are retained for 24 hours. When the same subaccount retries the same endpoint, its permissions are checked again. If the check passes, the first successful response is returned. Reusing the key with a different query string or request body returns 409 / STATE_CONFLICT.

Responses​

FieldTypeDescription
requestIdStringRequest identifier used to look up call records.
codeStringApplication result code.
msgStringResult message.
dataObject, array, or nullData returned by the endpoint.
HTTP statusApplication codeDescription
200OKRequest processed successfully. For connection tests, data.success indicates whether the connection succeeded.
201OKThe DataSource or subaccount was created successfully.
400INVALID_ARGUMENTInvalid request parameters or format.
401UNAUTHENTICATEDInvalid credentials or signature, disabled account, timestamp outside the allowed window, or reused nonce.
403FORBIDDENInsufficient feature or resource permissions.
404NOT_FOUNDThe endpoint or resource is missing, or the OpenAPI plugin is unloaded.
405INVALID_ARGUMENTThe request method must be POST.
409STATE_CONFLICTA resource state conflict occurred, or the same idempotency key was used for different request content.
422SQL_RULE_BLOCKEDSQL was blocked by a rule.
422SQL_EXECUTION_FAILEDSQL execution failed.
429RATE_LIMITEDThe SQL execution concurrency limit was reached.
500INTERNAL_ERRORThe service failed to process the request.
504EXECUTION_TIMEOUTSQL execution timed out.