AttachTemplate - Attach an application template

Updated at:

Applicable editions

Centralized and region

Service endpoint and authorization

Product

Resource

Required permissions

AppStack

Application

Read/Write

Request syntax

Centralized edition

POST https://{domain}/oapi/v1/appstack/organizations/{organizationId}/apps/{name}/template:attach

Region edition

POST https://{domain}/oapi/v1/appstack/apps/{name}/template:attach

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

In

Required

Description

Example

name

string

path

Yes

The name of the application.

organizationId

string

path

  • Yes: centralized edition

  • No: region edition

The organization ID.

ec766e63aee3437d9a51f334d6exe671

-

object

body

No

The request body.

appTemplateName

string

body

Yes

The unique name of the application template.

my-app-template

Request example

Centralized edition

curl -X 'POST' \
  'https://{domain}/oapi/v1/appstack/organizations/ec766e63aee3437d9a51f334d6exe671/apps/{name}/template:attach' \
  -H 'Content-Type: application/json' \
  -H 'x-yunxiao-token: pt-0fh3****0fbG_35af****0484' \
  --data '
    {
        "appTemplateName": "my-app-template"
    }'

Region edition

curl -X 'POST' \
  'https://{domain}/oapi/v1/appstack/apps/{name}/template:attach' \
  -H 'Content-Type: application/json' \
  -H 'x-yunxiao-token: pt-0fh3****0fbG_35af****0484' \
  --data '
    {
        "appTemplateName": "my-app-template"
    }'

Response parameters

Parameter

Type

Description

Example

-

object

The response object.

data

boolean

The result of the operation. A value of true indicates the template was successfully attached.

errorAdvice

string

Suggestions for troubleshooting the error.

errorCode

string

The error code that is returned if the request fails.

ApiDeprecated

errorMap

object

A map that contains the error details.

errorMessage

string

The returned error message.

showType

integer

The display type of the error message.

success

boolean

Specifies whether the request was successful. true indicates success; false indicates failure.

traceId

string

The unique ID of the request, used for tracing.

Response example

{
    "data": false,
    "errorAdvice": "",
    "errorCode": "ApiDeprecated",
    "errorMap": {
    },
    "errorMessage": "",
    "showType": 0,
    "success": false,
    "traceId": ""
}

Error codes

For a list of API error codes, see the Error Code Center.