Updated on 2024-03-15 GMT+08:00

Creating an SMS Application

Function

This API is used to create an application.

URI

POST /v2/{project_id}/msgsms/apps

Table 1 URI parameter

Parameter

Mandatory

Type

Description

project_id

Yes

String

Project ID. For details, see Obtaining Account, User, and Project Information.

Request Parameters

Table 2 Request header parameters

Parameter

Mandatory

Type

Description

X-Auth-Token

Yes

String

User token. It can be obtained by calling the IAM API used to obtain a user token. The value of X-Subject-Token in the response header is a token.

Content-Type

Yes

String

Request body parameter type. This parameter must be set to application/json.

Table 3 Request body parameters

Parameter

Mandatory

Type

Description

app_name

Yes

String

Application name.

create_sign_and_template

No

Boolean

Whether to create a test signature and template. This parameter is valid only when region is set to cn.

  • true: yes
  • false: no

region

Yes

String

Region.

  • cn: Chinese mainland
  • intl: international

up_link_addr

No

String

Uplink callback address. This parameter is valid only when region is set to cn.

show_secret

No

Boolean

Indicates whether to display app_secret in the returned message.

Response Parameters

Status code: 200

Table 4 Response body parameters

Parameter

Type

Description

app_key

String

Application key.

app_name

String

Application name.

id

String

Primary key ID of the application.

app_secret

String

Application secret, which is carried in SMS messages.

Request Example

POST /v2/845ada5bc7444f1295cd517af0123da1/msgsms/apps 
Host: 100.85.***.***:30300
Content-Type: application/json
X-Auth-Token:******
Content-Length: 144
 
{
"app_name":"auto_test789",
"create_sign_and_template": 0,
"enterprise_project_id":"0",
"enterprise_project_name":"default",
"region":"cn",
 "show_secret": true
}

Response Example

{
    "id": "9e61f59c-1a6b-4ee5-9651-5bca450694b3",
    "app_key": "******3baZf4c856O4Qrbqvui3K2",
    "app_name": "auto_test789",
    "app_secret": "********3baZf4c85Qrbqvui3K2iu"
}

Returned Values

Status Code

Description

200

OK

201

Created

401

Unauthorized

403

Forbidden

404

Not Found

500

System error