ZonesAdd
Add Zones
Request address
POST
http://OmsAddress/app/newoms.php/webservice/business/zones/add?cmd=10006&ip-type=webservicerest&access-token=AccessTokenVal
POST request parameter description
| Parameter name | Data type | Description | Whether the field is required | Remarks |
|---|---|---|---|---|
| set_id | integer | Set id of a game zone | Yes | |
| app_id | integer | App id of a zone | Yes | |
| zone_id | integer | Zone id | Yes | |
| zone_group | string | Zone group | ||
| zone_name | string | Game zone name with a maximum length of 63 | ||
| zone_tag | string | List of game zone tag, which is spliced by the semicolon ";" of the game zone tags. The list cannot exceed 5 game zone tags. Each game area tag can only contain Chinese characters, English letters, numbers and underscores, and the maximum length is 64 |
Data Parameters
Use json format to represent the record related information. The following is an example:
{
"set_id": 126,
"app_id": 2,
"zone_id": 1005,
"zone_name": "test_add_zone",
"zone_group": "group name",
"zone_tag": "tag1;tag2;tag3;tag4;tag5;"
}
Return Syntax
Return Parameter Description
When the returned status code is not 200, it indicates that the addition was unsuccessful, and the returned data is error information
When the returned status code is 200, it means the addition was successful, and the returned zone is the newly added zone
Request Example
Send A Request through the Curl Method
For the parameters in the command, please refer to the "Description of POST Request Parameters" on this page. For the method to obtain access-token, see: Get access-token
curl -H "Content-type: application/json" -X "POST" -d '{
"set_id": 126,
"app_id": 2,
"zone_id": 1005,
"zone_name": "test_add_zone",
"zone_group": "group name",
"zone_tag": "tag1;tag2;tag3;tag4;tag5;"
}' http://omsaddress/app/newoms.php/webservice/business/zones/add?cmd=10006&ip-type=webservicerest&access-token=\
Return Example
Successful Return Example
Status of http request = 200
{
"set_id": 126,
"app_id": 2,
"zone_id": 1005,
"zone_name": "test_add_zone",
"zone_group": "Normal",
"zone_tag": "tag1;tag2;tag3;tag4;tag5",
"create_date": "2017-03-03 11:56:55",
"uid": 172
}
Failed Return Example
Status of http request != 200
{
"name": "Unauthorized",
"message": "You are requesting with an invalid credential.",
"code": 0,
"status": 401,
"type": "yii\\web UnauthorizedHttpException"
}