Account service

Updated at:

This service provides APIs to query and set user account information.

Close an account

Description

Path

Version

Description

Requires user identity authentication

account/unregister

1.0.6

Closes an account.

Yes. The client software development kit (SDK) must enable identity authentication.

Request parameters

This operation does not have any business request parameters.

Response parameters

This operation does not have any business response parameters.

Examples

  • Request example

    {
         "id":1508232047196,
          "request": {
            "iotToken": "109049cxxxxxxxxb15f6f62e29a3ba",
            "apiVer": "1.0.6"
          },
          "params": {
           },
          "version": "1.0"
    }
  • Successful response example

    {
      "code": 200,
      "message": "success",
      "localizedMsg": null,
      "class": "com.aliyun.iotx.common.base.service.IoTxResult"
    }

Get the current user's details based on logon status

Description

Path

Version

Description

Requires user identity authentication

/user/account/session/authidentity

1.0.1

Gets the current user's details based on logon status.

Yes. The client SDK must enable identity authentication.

Request parameters

Parameter

Type

Required

Description

iotToken

String

Yes

The user logon status.

Response parameters

Name

Type

Description

companyId

String

The company ID.

companyName

String

The company name.

identityId

String

The unified identity ID.

loginName

String

The logon name.

nickName

String

The nickname.

phone

String

The phone number.

email

String

The email address.

Examples

  • Request example

    {
         "id":1508232047194,
          "request": {
            "apiVer": "1.0.1"
          },
          "params": {
            "request": {
              "iotToken": "xxxxxxxxxxxxx",
            }
          },
          "version": "1.0"
    }
  • Successful response example

    {
      "id": "8d1a665e-ce92-xxxx-xxxx-99d2e81814f3",
      "code": 200,
      "message": null,
      "localizedMsg": null,
      "data": {
        "companyId": "95BDDAxxxxxxxxt8240A19D5",
        "companyName": "test IoT Technology Co., Ltd.",
        "identityId": "5022al4d34xxxxxxxxaf3fac06085",
        "loginName": "test IoT",
        "nickName": "test IoT",
        "phone": "xxxxxxxxxxx",
        "email": "a***@example.net"
      }
    }

Get the URL and encrypted signature for uploading a profile picture

To change a profile picture, follow these steps:

  1. Call this API to retrieve the upload URL, signature, and other parameters.

  2. After the app retrieves the upload URL, signature, and other parameters, upload the profile picture using the POST method. For more information, see PostObject.

    When you upload, do not set the x-oss-forbid-overwrite parameter in the header to true. Otherwise, the upload may fail. After the upload is successful, construct the profile picture URL by combining the host and dir parameters from the API response in Step 1. The format is "https://" + host + "/" + dir.

  3. Update the image URL by calling the API to modify account properties.

Path

Version

Description

Requires user identity authentication

/living/user/avatar/upload/signature/get

1.0.0

Gets the URL and encrypted signature for uploading a user profile picture.

Yes. The client SDK must enable identity authentication.

Request parameters

Parameter

Type

Required

Description

fileSize

int

Yes

The size of the profile picture file in bytes. The value must be between 1 and 10,485,760 (10 MB).

Response parameters

Name

Type

Description

accessKey

String

The AccessKey ID for Object Storage Service (OSS).

dir

String

The storage directory of the image in the OSS bucket.

expire

Long

The expiration timestamp in milliseconds. You can upload the profile picture to OSS before this timestamp.

host

String

The OSS domain name.

signature

String

The signature.

policy

String

The information used to verify the validity of the request form fields.

Examples

  • Request example

    {
         "id":1508232047194,
          "request": {
            "apiVer": "1.0.0"
          },
          "params": {
            "request": {
              "fileSize": 300888
            }
          },
          "version": "1.0"
    }
  • Successful response example

    {
        "id":1508232047194,
        "code":200,
        "data": {
            "signature":"b45CXXXXXXXXXXXXXXXXXXXXXX",
            "accessKey":"LTAXXXXXXXXXXXXX",
            "expire":1578077777777,
            "host":"xxxx.oss-ap-shanghai.aliyuncs.com",
            "dir":"images/third_app_user/profile/50adopbXXXXXX_MmI2NGJjZD.png",
            "policy":"eyJleHBpcmFXXXXXXXXXXX0aW9uIjoiMjAy"
           }
    }