Skip to main content

Overview

Adds connection signing keys for a specified app.
You can submit multiple sign_keys in one request. The server retains up to three keys, with the most recently added keys listed first.

API Reference

  • Method POST
  • Path /apigateway/apps/connectsignkeys/add

Request

Authentication: This API validates request headers. See Authentication.

ParameterData TypeRequiredDescription
x-appkeystringYesApplication appkey.
x-noncestringYesRandom string. Use a unique value for each request.
x-timestampstringYesTimestamp in milliseconds, represented as a string and used to calculate the signature.
x-signaturestringYesSignature value. See the signature calculation pseudocode below.
Content-TypestringYesMust be application/json.
x-request-idstringNoUnique request ID. If omitted, the server generates one automatically.

Signature Calculation Pseudocode

input:
signKey
nonce
timestamp

payload = nonce + timestamp + signKey
signature = hex_encode(HMAC_SHA256(payload, key=signKey))

To integrate a client, calculate the signature using a single signKey: signature = hex(HMAC-SHA256(nonce + timestamp + signKey, signKey)).

Request Parameters

ParameterData TypeRequiredDescription
sign_keysarray\<string>YesSigning keys to add. Multiple keys can be submitted in one request. The server retains up to three keys, and the serialized configuration can contain up to 2,048 characters.

Request Example

POST /apigateway/apps/connectsignkeys/add HTTP/1.1
x-appkey: appkey
x-signature: 2e639ae3600a4sdff61fb88b76f485b
x-nonce: nonce
x-timestamp: 1672568121910
Content-Type: application/json

{
"sign_keys": [
"sign_key_1",
"sign_key_2"
]
}

Response Example

{
"code": 0
}