Test Microsoft Teams Connectivity

POST/zstack/v1/sns/application-endpoints/microsoft-teams/test-connection

Headers

Authorization: OAuth the-session-uuid

Body

{
  "params": {
    "url": "https://microsoft.com/cgi-bin/webhook/send?key=f8b9014a-207a-44d5-ae26-3501bf01dbc4",
    "testMsg": "hello",
    "endpointUuid": "1c201c27a81740ddadbc5d2f3f38a5e4"
  },
  "systemTags": [],
  "userTags": []
}

In the example above, the systemTags and userTags fields are optional. They are listed to indicate that these two fields can be included in the body.

Curl Example

curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X POST -d '{"params":{"url":"https://microsoft.com/cgi-bin/webhook/send?key=f8b9014a-207a-44d5-ae26-3501bf01dbc4","testMsg":"hello","endpointUuid":"1c201c27a81740ddadbc5d2f3f38a5e4"}}' \
http://localhost:8080/zstack/v1/sns/application-endpoints/microsoft-teams/test-connection

Parameter List

NameTypeLocationDescriptionAllowed ValuesStarting Version
url (optional)Stringbody (contained in the params structure)Microsoft Teams Webhook URL 4.2.0
testMsgStringbody (contained in the params structure)Test message 4.2.0
endpointUuid (optional)Stringbody (contained in the params structure)Microsoft Teams endpoint UUID 4.2.0
systemTags (optional)ListbodySystem tags 4.2.0
userTags (optional)ListbodyUser tags 4.2.0

API Response

Response Example

{
  "connected": true,
  "webhookResp": {}
}
NameTypeDescriptionStarting Version
successboolean 4.2.0
connectedbooleanWhether the webhook URL is reachable4.2.0
webhookRespLinkedHashMapWebhook response data5.0.0
errorErrorCodeThe error code. If not null, the operation failed. This field is null when the operation succeeds. For details, see error4.2.0

error

NameTypeDescriptionStarting Version
codeStringThe error code number. A globally unique identifier for the error, for example, SYS.1000, HOST.1001.5.0.0
descriptionStringA brief description of the error5.0.0
detailsStringDetailed information about the error5.0.0
elaborationStringReserved field. Default is null.5.0.0
opaqueLinkedHashMapReserved field. Default is null.5.0.0
causeErrorCodeThe root error. The source error that caused the current error. If there is no root error, this field is null.5.0.0

SDK Examples

Java SDK

SNSMicrosoftTeamsTestConnectionAction action = new SNSMicrosoftTeamsTestConnectionAction();
action.url = "https://microsoft.com/cgi-bin/webhook/send?key=f8b9014a-207a-44d5-ae26-3501bf01dbc4";
action.testMsg = "hello";
action.endpointUuid = "1c201c27a81740ddadbc5d2f3f38a5e4";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
SNSMicrosoftTeamsTestConnectionAction.Result res = action.call();

Python SDK

SNSMicrosoftTeamsTestConnectionAction action = SNSMicrosoftTeamsTestConnectionAction()
action.url = "https://microsoft.com/cgi-bin/webhook/send?key=f8b9014a-207a-44d5-ae26-3501bf01dbc4"
action.testMsg = "hello"
action.endpointUuid = "1c201c27a81740ddadbc5d2f3f38a5e4"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
SNSMicrosoftTeamsTestConnectionAction.Result res = action.call()