Verify a callback ingress connection¶
Verify a callback ingress connection.
POST https://api.moi.matrixorigin.cn/v5/workspaces/{workspace_id}/ingress-connections/{connection_id}/test
Before you call this API¶
Prepare a personal access token with access to the target workspace and the required action privileges. The path workspace must match X-Workspace-ID. Examples use jq. See Common information for variables, objects, and states.
Request body¶
curl -X POST "https://api.moi.matrixorigin.cn/v5/workspaces/$WORKSPACE_ID/ingress-connections/$CONNECTION_ID/test" \
-H "X-API-Key: $AI_STUDIO_API_KEY" \
-H "X-Workspace-ID: $WORKSPACE_ID" \
-H 'Content-Type: application/json' \
--data-binary "$(jq -n --argjson ASSOCIATION_VERSION "$ASSOCIATION_VERSION" --argjson CONFIG_VERSION "$CONFIG_VERSION" --arg CALLBACK_URL "$CALLBACK_URL" '
{
"expected_association_version": $ASSOCIATION_VERSION,
"expected_config_version": $CONFIG_VERSION,
"callback_url": $CALLBACK_URL
}
')"
For callback only; not managed_stream or mail_polling. Telegram registers a Webhook with the provider; other platforms test channel configuration. Success enables the connection and increments its configuration version. Failure may also return HTTP 200 with an ok:false test result. Inspect the result before querying connection state.
Fields |
Type |
Required |
Description |
|---|---|---|---|
|
integer |
Yes |
association_version from the latest connection details; must be greater than 0. |
|
integer |
Yes |
config_version from the latest connection details; must be greater than 0. |
|
string |
Conditional |
For Telegram, the deployment’s full HTTPS URL with a path exactly matching callback_path in details, without query or fragment. |
Successful response¶
{
"code": 0,
"data": {
"ok": false,
"status": "failed",
"last_test_error": "示例测试拒绝"
}
}
Field |
Type |
Description |
|---|---|---|
|
integer |
0 on success. |
|
object |
Result object; see common object descriptions for fields. |
Error response¶
Handle HTTP status, business results, and error fields as described in Errors and environments. Read current state on source or version conflicts; do not automatically retry with a different identity, resource, or request ID.