Device User Management

Last Updated on : 2023-10-09 01:57:20download

API list

Action Description
deviceUser.add Add a user.
deviceUser.edit Modify a user.
deviceUser.delete Delete a user.
deviceUser.info Query information about a user.
deviceUser.list Query user information by device ID.

Add a user

API endpoint

action: deviceUser.add

Request parameter

Parameter name Parameter type Description Required
device_id String The device ID. Yes
nick_name String The nickname of the user. Yes
sex Integer The gender of the user. Valid values:
  • 1: male
  • 2: female
  • Yes
    birthday Long The date of birth (day, month, year). No
    height Integer The height. Unit: centimeter. No
    weight Integer The weight. Unit: gram. No
    contact String The contact information. No

    Response parameter

    Name Type Description
    t Long The returned time.
    success Boolean Indicates whether the operation is successful.
    result String The added user ID.

    Sample request

    {
      "action": "deviceUser.add",
      "params": {
        "device_id": "vedeo787322q",
        "nick_name": "test",
        "sex": 1
      }
    }
    

    Sample response

    {
        "t":1564996327422,
        "success":true,
        "result": "5121231"
    }
    

    Error codes

    The following table lists common error codes for the API calls. For more error codes, see Global Error Codes.

    Error code Description
    500 A system error has occurred while processing your request.

    Modify a user

    API endpoint

    action: deviceUser.edit
    

    Request parameter

    Parameter name Parameter type Description Required
    device_id String The device ID. Yes
    user_id String The added user ID. Yes
    nick_name String The nickname of the user. Yes
    sex Integer The gender of the user. Valid values:
  • 1: male
  • 2: female
  • Yes
    birthday Long The date of birth (day, month, year). No
    height Integer The height. Unit: centimeter. No
    weight Integer The weight. Unit: gram. No

    Response parameter

    Name Type Description
    t Long The timestamp.
    success Boolean Indicates whether the operation is successful.
    result Object The returned result.

    Sample request

    {
      "action": "deviceUser.edit",
      "params": {
        "device_id": "vedeo16236124",
        "user_id": "12445765",
        "nick_name": "test",
        "sex": 1,
        "birthday": 1544996327422,
        "height": 178,
        "weight": 160
      }
    }
    

    Sample response

    {
        "t":1564996327422,
        "success":true,
        "result": true
    }
    

    Error codes

    The following table lists common error codes for the API calls. For more error codes, see Global Error Codes.

    Error code Description
    500 A system error has occurred while processing your request.

    Delete a user

    API endpoint

    action: deviceUser.delete
    

    Request parameter

    Parameter name Parameter type Description Required
    device_id String The device ID. Yes
    user_id String The user ID. Yes

    Response parameter

    Name Type Description
    t Long The timestamp.
    success Boolean Indicates whether the operation is successful.
    result Boolean The returned result.

    Sample request

    {
      "action": "deviceUser.delete",
      "params": {
        "device_id": "vedeo16236124",
        "user_id": "5232342"
      }
    }
    

    Sample response

    {
        "t":1564996327422,
        "success":true,
        "result": true
    }
    

    Error codes

    The following table lists common error codes for the API calls. For more error codes, see Global Error Codes.

    Error code Description
    500 A system error has occurred while processing your request.

    Query user information

    API endpoint

    action: deviceUser.info
    

    Request parameter

    Parameter name Parameter type Description Required
    device_id String The device ID. Yes
    user_id String The user ID. Yes

    Response parameter

    Name Type Description
    t Long The timestamp.
    success Boolean Indicates whether the operation is successful.
    result Object The returned result.

    Description of result

    Parameter name Parameter type Description
    device_id String The device ID.
    nick_name String The nickname of the user.
    sex Integer The gender of the user. Valid values:
  • 1: male
  • 2: female
  • birthday Long The date of birth (day, month, year).
    height Integer The height. Unit: centimeter.
    weight Integer The weight. Unit: gram.
    contact String The contact information.

    Sample request

    {
      "action": "deviceUser.info",
      "params": {
        "device_id": "vedeo16236124",
        "user_id": "5232342"
      }
    }
    

    Sample response

    {
        "t":1564996327422,
        "success":true,
        "result":
          {
            "device_id": "vedeo16236124",
            "nick_name": "",
            "sex": 1,
            "birthday": 1544996327422,
            "height": 178,
            "weight": 160,
            "contact": ""
          }
    }
    

    Error codes

    The following table lists common error codes for the API calls. For more error codes, see Global Error Codes.

    Error code Description
    500 A system error has occurred while processing your request.

    Query user information by device ID

    API endpoint

    action: deviceUser.list
    

    Request parameter

    Parameter name Parameter type Description Required
    device_id String The device ID. Yes

    Response parameter

    Name Type Description
    t Long The timestamp.
    success Boolean Indicates whether the operation is successful.
    result List The returned result.

    Description of result

    Parameter name Parameter type Description
    device_id String The device ID.
    nick_name String The nickname of the user.
    sex Integer The gender of the user. Valid values:
  • 1: male
  • 2: female
  • birthday Long The date of birth (day, month, year).
    height Integer The height. Unit: centimeter.
    weight Integer The weight. Unit: gram.
    contact String The contact information.

    Sample request

    {
      "action": "deviceUser.list",
      "params": {
        "device_id": "vedeo16236124"
      }
    }
    

    Sample response

    {
        "t":1564996327422,
        "success":true,
        "result": [
          {
            "device_id": "vedeo16236124",
            "nick_name": "",
            "sex": 1,
            "birthday": 1544996327422,
            "height": 178,
            "weight": 160,
            "contact": ""
          }
        ]
    }
    

    Error codes

    The following table lists common error codes for the API calls. For more error codes, see Global Error Codes.

    Error codes Description
    500 A system error has occurred while processing your request.