Skip to content

获取显示器列表

请求方法以及路径

html
POST http://localhost:[端口号]/openapi/app/all-displays?ticket=[OpenApi票据]

接口功能描述

获取当前电脑连接的显示器列表。

请求参数

Header 请求参数

参数名参数值必填类型描述
Content-Typeapplication/jsonStringapplication/json

接口响应结果示例

成功响应示例

json
{
  "code": "00000",
  "message": "Success",
  "data": {
    "status": "success",
    "errorCode": "",
    "errorMsg": "",
    "result": {
      "displays": [
        {
          "id": 1,
          "label": "内建视网膜显示器",
          "scaleFactor": 2,
          "size": {
            "width": 1512,
            "height": 982
          },
          "workArea": {
            "x": 0,
            "y": 38,
            "width": 1512,
            "height": 859
          },
          "workAreaSize": {
            "width": 1512,
            "height": 859
          }
        },
        {
          "id": 2,
          "label": "MateView",
          "scaleFactor": 2,
          "size": {
            "width": 1920,
            "height": 1280
          },
          "workArea": {
            "x": 0,
            "y": -1255,
            "width": 1920,
            "height": 1255
          },
          "workAreaSize": {
            "width": 1920,
            "height": 1255
          }
        }
      ]
    }
  }
}


调用接口失败

接口响应状态码,不为00000时,接口调用失败。
具体接口调用错误原因可查看接口响应状态码信息对照表进行查询。

json
{
  "code": "00001",
  "message": "产生未知错误,请反馈给官方客服!",
  "data": {}
}