Create API Application
Create a new API Application and bind it to one or more websites.
Request
Request-Line
POST /waap/v1.0/apiProtection/apiApps HTTP/1.1
Request Parameters
Body Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| name | String | Mandatory | Name of the API Application.The name must have 1-26 characters. Valid characters: 0-9, A-Z, a-z, space, . (dot), _ (underline), - (hyphen), () (parentheses), * (asterisk) and + (plus sign). |
| pathPrefix | String | Optional | Optional path prefix for grouping API routes. Example: "/cms/". |
| websites | Integer[] | Mandatory | List of website IDs to bind the API Application to. At least one ID is required. |
Response
Response Body
| Property name | Type | Required | Description |
|---|---|---|---|
| appId | Integer | Mandatory | Unique identifier assigned to the created api application. |
Status Codes, Error Codes and Error Messages
| Status Code | Error Code | Error Message |
|---|---|---|
| 400 | Request.BadRequest | Bad request. |
| 400 | Name.Invalid | Name is empty or invalid. |
| 400 | Websites.Invalid | Websites is empty or invalid. |
| 404 | Website.NotFound | Website is not found. |
| 409 | ApplicationName.Exist | Application name already exists. |
| 409 | ApiAppPath.Exist | The combination of domain and path prefix already exists. |
Examples
Create API Application
Request
POST /waap/v1.0/apiProtection/apiApps HTTP/1.1
{
"name": "test",
"pathPrefix":"/",
"websites": [
392
]
}
Successful Response Body
{
"appId": 55
}