REST API文档

菜单管理

主菜单

菜单信息说明如下:

参数说明
k菜单名称
v菜单值
leaf_flag
sort排序

获取所有菜单

  • 请求 URL: /api/system_modules 返回所有主菜单

  • 请求 URL: /api/system_modules/$id 返回指定 ID 的菜单信息

  • 请求方式: GET

  • 返回值: 费率 JSON 对象,如果找不到会返回 HTTP 状态码404

  • curl 示例:

curl -H "X-XTRA-AUTH-ID: 62dd0173-4916-4b1c-b958-546e4d7c91fe" http://192.168.1.100:8081/api/system_modules
  • 返回值
[
	{
		"sort": 2,
		"module_no": "",
		"module_id": 6,
		"created_by": "system",
		"description": "",
		"updated_at": "2023-03-23 06:25:24",
		"created_at": "2023-03-23 06:25:24",
		"leaf_flag": 1,
		"v": "SMENUS_SYSTEM_SETTINGS",
		"id": 8,
		"level": 1,
		"k": "System",
		"icon": "ProfileOutlined"
	},
	{
		"sort": 6,
		"module_no": "",
		"module_id": 6,
		"created_by": "system",
		"description": "",
		"updated_at": "2023-03-23 06:25:24",
		"created_at": "2023-03-23 06:25:24",
		"leaf_flag": 1,
		"v": "SMENUS_Modules",
		"id": 12,
		"level": 1,
		"k": "Modules Configuration",
		"icon": "DatabaseOutlined"
	},
	{
		"sort": 2,
		"module_no": "2",
		"module_id": 0,
		"created_by": "system",
		"description": "",
		"updated_at": "2023-03-23 06:25:24",
		"created_at": "2023-03-23 06:25:24",
		"leaf_flag": 1,
		"v": "SMENUS_CALL",
		"id": 2,
		"level": 0,
		"k": "Call",
		"icon": "PhoneOutlined"
	},
	...
	{
		"sort": 9,
		"module_no": "13",
		"module_id": 0,
		"created_by": "system",
		"description": "",
		"updated_at": "2023-03-23 06:25:24",
		"created_at": "2023-03-23 06:25:24",
		"leaf_flag": 1,
		"v": "SMENUS_SYSTEM_STATUS",
		"id": 13,
		"level": 0,
		"k": "Status",
		"icon": "ProfileOutlined"
	}
]

修改主菜单

  • 请求 URL: /api/system_modules/$id
  • 请求方式: PUT
  • 消息头: Content-Type: application/json
  • Body 信息:
{
  "sort": "2"
}
  • curl 示例:
curl -XPUT -H "X-XTRA-AUTH-ID: 62dd0173-4916-4b1c-b958-546e4d7c91fe" \
-H "Content-Type: application/json" \
-d '{"sort": "2"}' \
http://192.168.1.100:8081/api/system_modules/1
  • 返回值:
{
  "code": 200,
  "data": "1",
  "message": "success"
}

子菜单

菜单信息说明如下:

参数说明
k子菜单名称
status_flag子菜单状态,0-无效 1-有效
url菜单路径
mod_id所属模块 ID

获取所有子菜单

  • 请求 URL: /api/system_menus 返回所有子菜单

  • 请求 URL: /api/system_menus/$id 返回指定 ID 的子菜单信息

  • 请求方式: GET

  • 返回值: 如果找不到会返回 HTTP 状态码404

  • curl 示例:

curl -H "X-XTRA-AUTH-ID: 62dd0173-4916-4b1c-b958-546e4d7c91fe" http://192.168.1.100:8081/api/system_menus
  • 返回值
{
	"data": [
		{
			"enable_shortcut": "1",
			"k": "CDRs",
			"description": "",
			"id": "31",
			"mod_id": "5",
			"sort": "1",
			"status_flag": "1",
			"module_id": "5",
			"url": "/settings/cdrs",
			"created_at": "2023-03-23 06:25:24",
			"icon": "NumberOutlined",
			"mod_k": "CDR"
		},
		...
		{
			"enable_shortcut": "0",
			"k": "Call Limit Group",
			"description": "",
			"id": "14",
			"mod_id": "2",
			"sort": "14",
			"status_flag": "1",
			"module_id": "2",
			"url": "/settings/call_limit_groups",
			"created_at": "2023-03-23 06:25:24",
			"icon": "HddOutlined",
			"mod_k": "Call"
		}
	]
}

修改子菜单

  • 请求 URL: /api/system_menus/$id
  • 请求方式: PUT
  • 消息头: Content-Type: application/json
  • Body 信息:
{
  "sort": "2",
  "status_flag": "0"
}
  • curl 示例:
curl -XPUT -H "X-XTRA-AUTH-ID: 62dd0173-4916-4b1c-b958-546e4d7c91fe" \
-H "Content-Type: application/json" \
-d '{"sort": "2","status_flag": "0"}' \
http://192.168.1.100:8081/api/system_menus/1
  • 返回值:
{
  "code": 200,
  "data": "1",
  "message": "success"
}

删除子菜单

  • 请求 URL/api/system_menus/$id

  • 请求方式DELETE

  • 消息头: 无

  • 返回值: 对象,包含被删除的 ID

  • 示例

  • curl 示例

curl -0 -H "X-XTRA-AUTH-ID: 62dd0173-4916-4b1c-b958-546e4d7c91fe" -XDELETE "192.168.1.100:8081/api/system_menus/1"

返回:

{
  "code": 200,
  "message": "success",
  "data": "1"
}

删除子菜单下指定菜单按钮

  • 请求 URL/api/system_buttons/$id

  • 请求方式DELETE

  • 消息头: 无

  • 返回值: 对象,包含被删除的 ID

  • 示例

  • curl 示例

curl -0 -H "X-XTRA-AUTH-ID: 62dd0173-4916-4b1c-b958-546e4d7c91fe" -XDELETE "192.168.1.100:8081/api/system_buttons/300"

返回:

{
  "code": 200,
  "message": "success",
  "data": "300"
}
高级配置-计费管理