CreateAppStackWebhook - Create AppStack webhook
Creates an AppStack Webhook configuration using OpenAPI.
Applicable editions | Central Edition, Region Edition |
Service endpoint and authorization
- Get the service endpoint: Replace
{domain}in the API request syntax. - Get a personal access token.
- Get the organization ID: Required only for the Central Edition. To obtain it, go to the Basic Information page of the Organization Management console.
Product | Resource | Required permissions |
Application Delivery | Webhook | Read and write |
Request syntax
Central Edition
POST https://{domain}/oapi/v1/appstack/organizations/{organizationId}/hook/api
Region Edition
POST https://{domain}/oapi/v1/appstack/hook/api
Request headers
Parameter | Type | Required | Description | Example |
x-yunxiao-token | string | Yes | The personal access token. | pt-0fh3****0fbG_35af****0484 |
Request parameters
Parameter | Type | Location | Required | Description | Example |
organizationId | string | path |
| The organization ID. | ec766e6xxxxxxxxxx34d6exe671 |
| - | object | body | No | The request body. | |
| description | string | body | Yes | The webhook description. The value can be up to 256 characters long. | Test webhook |
| events | array | body | Yes | The list of events. | |
| - | object | body | No | ||
| action | string | body | Yes | The event action. Valid values: | Create |
| event | string | body | Yes | The event type. Valid values: | App |
| scopeId | string | body | Yes | The scope ID. | enterprise ID,application name |
| scopeType | string | body | Yes | The scope type. Valid values: | ORGANIZATION |
| spec | object | body | Yes | The webhook specification. | |
| token | string | body | No | The webhook token. The value can be up to 128 characters long. | aaaa |
| type | string | body | Yes | The type. | WEBHOOK |
| url | string | body | Yes | The webhook URL. | https://devops.aliyun.com/appstack/setting/webhooks1 |
| type | string | body | Yes | The type. | WEBHOOK |
Request examples
Central Edition
curl -X 'POST' \
'https://{domain}/oapi/v1/appstack/organizations/ec766e6xxxxxxxxxx34d6exe671/hook/api' \
-H 'Content-Type: application/json' \
-H 'x-yunxiao-token: pt-0fh3****0fbG_35af****0484' \
--data '
{
"description": "Test webhook",
"events": [
{
"action": "Create",
"event": "App"
}
],
"scopeId": "enterprise ID,application name",
"scopeType": "ORGANIZATION",
"spec": {
"token": "aaaa",
"type": "WEBHOOK",
"url": "https://devops.aliyun.com/appstack/setting/webhooks1"
},
"type": "WEBHOOK"
}'
Region Edition
curl -X 'POST' \
'https://{domain}/oapi/v1/appstack/hook/api' \
-H 'Content-Type: application/json' \
-H 'x-yunxiao-token: pt-0fh3****0fbG_35af****0484' \
--data '
{
"description": "Test webhook",
"events": [
{
"action": "Create",
"event": "App"
}
],
"scopeId": "enterprise ID,application name",
"scopeType": "ORGANIZATION",
"spec": {
"token": "aaaa",
"type": "WEBHOOK",
"url": "https://devops.aliyun.com/appstack/setting/webhooks1"
},
"type": "WEBHOOK"
}'
Response parameters
Parameter | Type | Description | Example |
| - | object | The AppStack Webhook configuration. | |
| description | string | The webhook description. The value can be up to 256 characters long. | Test |
| disabledExpired | string | The time when the disabled status expires. | |
| enabled | boolean | Specifies whether the webhook is enabled. | true |
| events | array | The list of events. | |
| - | object | ||
| action | string | The event action. | Create |
| event | string | The event type. | App |
| scopeId | string | The scope ID. | enterprise ID,application name |
| scopeType | string | The scope type. Valid values: | ORGANIZATION |
| sn | string | The unique identifier of the webhook. | c263a6749757xxxxxx2f45f2f80e |
| spec | object | The detailed specification of the webhook. | |
| token | string | The webhook token. The value can be up to 128 characters long. | |
| type | string | The type. | WEBHOOK |
| url | string | The webhook URL. The value can be up to 1,024 characters long. | https://devops.aliyun.com/appstack/setting/webhooks |
| timeout | integer | The timeout period, in seconds. | 3 |
| type | string | The type. | WEBHOOK |
Response example
{
"description": "Test",
"disabledExpired": "",
"enabled": true,
"events": [
{
"action": "Create",
"event": "App"
}
],
"scopeId": "enterprise ID,application name",
"scopeType": "ORGANIZATION",
"sn": "c263a6749757xxxxxx2f45f2f80e",
"spec": {
"token": "",
"type": "WEBHOOK",
"url": "https://devops.aliyun.com/appstack/setting/webhooks"
},
"timeout": 3,
"type": "WEBHOOK"
}
Error codes
For details about API error codes, see the Error Code Center.