Send Test HTTP Request

POST/zstack/v1/sns/application-endpoints/http/test-connection

Headers

Authorization: OAuth the-session-uuid

Body

{
  "params": {
    "url": "https://open.feishu.cn/open-apis/bot/v2/hook/006879a3-0898-4428-aad4-3221db3daf81",
    "username": "admin",
    "password": "password",
    "endpointUuid": "1c201c27a81740ddadbc5d2f3f38a5e4"
  },
  "systemTags": [],
  "userTags": []
}

In the preceding example, the systemTags and userTags fields are optional. They are listed to indicate that the body can contain these two fields.

Curl Example

curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X POST -d '{"params":{"url":"https://open.feishu.cn/open-apis/bot/v2/hook/006879a3-0898-4428-aad4-3221db3daf81","username":"admin","password":"password","endpointUuid":"1c201c27a81740ddadbc5d2f3f38a5e4"}}' \
http://localhost:8080/zstack/v1/sns/application-endpoints/http/test-connection

Parameter List

NameTypeLocationDescriptionAllowed ValuesStarting Version
url (Optional)Stringbody (Contained in the params structure)webhook url 4.10.0
username (Optional)Stringbody (Contained in the params structure)Basic Auth username 4.10.0
password (Optional)Stringbody (Contained in the params structure)Basic Auth password 4.10.0
endpointUuid (Optional)Stringbody (Contained in the params structure)Endpoint UUID 4.10.0
systemTags (Optional)ListbodySystem tags 4.10.0
userTags (Optional)ListbodyUser tags 4.10.0

API Response

Response example

{
  "connected": true,
  "webhookResp": "{'result': 'success'}"
}
NameTypeDescriptionStarting Version
successboolean 4.10.0
connectedbooleanSend result4.10.0
webhookRespObjectRemote endpoint response4.10.0
errorErrorCodeError code. If not null, the operation failed. This field is null when the operation succeeds. For details, see error4.10.0

error

NameTypeDescriptionStarting Version
codeStringThe error code number, a globally unique identifier for the error, for example, SYS.1000 or HOST.10010.6
descriptionStringA brief description of the error0.6
detailsStringDetailed information about the error0.6
elaborationStringReserved field. Defaults to null0.6
opaqueLinkedHashMapReserved field. Defaults to null0.6
causeErrorCodeThe root error that caused the current error. This field is null if there is no root cause0.6

SDK Examples

Java SDK

SNSHttpTestConnectionAction action = new SNSHttpTestConnectionAction();
action.url = "https://open.feishu.cn/open-apis/bot/v2/hook/006879a3-0898-4428-aad4-3221db3daf81";
action.username = "admin";
action.password = "password";
action.endpointUuid = "1c201c27a81740ddadbc5d2f3f38a5e4";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
SNSHttpTestConnectionAction.Result res = action.call();

Python SDK

SNSHttpTestConnectionAction action = SNSHttpTestConnectionAction()
action.url = "https://open.feishu.cn/open-apis/bot/v2/hook/006879a3-0898-4428-aad4-3221db3daf81"
action.username = "admin"
action.password = "password"
action.endpointUuid = "1c201c27a81740ddadbc5d2f3f38a5e4"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
SNSHttpTestConnectionAction.Result res = action.call()