JSON API » cos » cos/create
Creates a new class of service.
Input parameters
Requires authentication and the administrator role privileges.
Name | Type | Description | Required | Default value |
---|---|---|---|---|
auth_username | String | Authentication username. | Yes | |
auth_password | String | Authentication password. | Yes | |
name | String | Name. | Yes | |
customer | Integer | ID of customer to create in. | No | Customer of authentication user. |
description | String | Description. | No | Empty string. |
external_out | Integer | Whether to allow external calls by default. 0 to forbid, 1 to allow, 2 to allow if time group is active, 3 to allow if timegroup is not active. | No | 1 |
failure | String | Number to redirect to if call is forbidden. Empty string to play error message. | No | Empty string. |
internal_out | Integer | Whether to allow internal calls by default. 0 to forbid, 1 to allow, 2 to allow if time group is active, 3 to allow if time group is not active. | No | 1 |
timegroup | Integer | ID of time group. 0 for none. | No | 0 |
validation | Integer | 1 to validate input then return, 0 for full action. | No | 0 |
Responses
Code | Description |
---|---|
200 | Success. |
201 | Input passed validation. Only returned if validation=1. |
400 | Invalid input parameters specified. Check the key and message fields for more details. |
401 | The authentication details provided are invalid. |
402 | Your role does not allow this. |
403 | Your rate plan does not allow this. |
Data returned
The ID of the created class of service.
Example: With required parameters
http://enswitch.example.com/api/json/cos/create/?auth_username=user;auth_password=password;name=user1{ "responses":[ { "code":"200", "key":"", "message":"OK" } ], "data":{ "id":123 } }
Change history
Version | Changes |
---|---|
3.13 | Function added. |