Xiaomi User API

The User API from Xiaomi — 4 operation(s) for user.

OpenAPI Specification

xiaomi-user-api-openapi.yml Raw ↑
openapi: 3.0.3
info:
  title: Xiaomi Galaxy FDS Access Control User API
  description: Xiaomi Galaxy File Data Storage (FDS) is a cloud object storage service providing a RESTful API for managing files and objects. It supports bucket management, object CRUD operations, access control lists, multipart uploads, and CDN prefetch/refresh operations across multiple regional data centers.
  version: 1.0.0
  contact:
    name: Xiaomi FDS Support
    url: https://docs.api.xiaomi.com/en/fds/
servers:
- url: https://cnbj0.fds.api.xiaomi.com
  description: China Beijing region
- url: https://awsbj0.fds.api.xiaomi.com
  description: China Beijing region (AWS)
- url: https://awssgp0.fds.api.xiaomi.com
  description: Singapore region
security:
- hmacAuth: []
tags:
- name: User
paths:
  /user/profile:
    get:
      operationId: getUserProfile
      summary: Get User Profile
      description: Retrieves the authenticated user's profile information including nickname, user ID, and profile picture URL. Requires OAuth scope 1.
      tags:
      - User
      parameters:
      - name: clientId
        in: query
        required: true
        description: The allocated application client ID.
        schema:
          type: integer
          format: int64
      - name: token
        in: query
        required: true
        description: The OAuth 2.0 access token.
        schema:
          type: string
      responses:
        '200':
          description: User profile retrieved successfully.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UserProfile'
        '401':
          description: Unauthorized. Invalid or expired access token.
        '403':
          description: Forbidden. Insufficient scope permissions.
  /user/openidV2:
    get:
      operationId: getUserOpenId
      summary: Get User OpenID
      description: Retrieves the authenticated user's unique OpenID for the application. Requires OAuth scope 3.
      tags:
      - User
      parameters:
      - name: clientId
        in: query
        required: true
        description: The allocated application client ID.
        schema:
          type: integer
          format: int64
      - name: token
        in: query
        required: true
        description: The OAuth 2.0 access token.
        schema:
          type: string
      responses:
        '200':
          description: User OpenID retrieved successfully.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UserOpenId'
        '401':
          description: Unauthorized. Invalid or expired access token.
  /user/phoneAndEmail:
    get:
      operationId: getUserPhoneAndEmail
      summary: Get User Phone and Email
      description: Retrieves the authenticated user's phone number and email address. Fields may be empty if the user has not provided them. Requires OAuth scope 4 or 6.
      tags:
      - User
      parameters:
      - name: clientId
        in: query
        required: true
        description: The allocated application client ID.
        schema:
          type: integer
          format: int64
      - name: token
        in: query
        required: true
        description: The OAuth 2.0 access token.
        schema:
          type: string
      responses:
        '200':
          description: User contact information retrieved successfully.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UserContact'
        '401':
          description: Unauthorized. Invalid or expired access token.
  /user/relation:
    get:
      operationId: getUserFriendList
      summary: Get User Friend List
      description: Retrieves the authenticated user's MiChat friend list. Requires OAuth scope 2.
      tags:
      - User
      parameters:
      - name: clientId
        in: query
        required: true
        description: The allocated application client ID.
        schema:
          type: integer
          format: int64
      - name: token
        in: query
        required: true
        description: The OAuth 2.0 access token.
        schema:
          type: string
      responses:
        '200':
          description: Friend list retrieved successfully.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FriendList'
        '401':
          description: Unauthorized. Invalid or expired access token.
components:
  schemas:
    FriendList:
      type: object
      properties:
        result:
          type: string
        description:
          type: string
        data:
          type: object
          properties:
            friends:
              type: array
              items:
                type: object
                properties:
                  userId:
                    type: integer
                    format: int64
                  nickname:
                    type: string
    UserOpenId:
      type: object
      properties:
        result:
          type: string
        description:
          type: string
        data:
          type: object
          properties:
            openId:
              type: string
              description: Application-scoped unique user identifier.
    UserProfile:
      type: object
      properties:
        result:
          type: string
          description: Result status code.
        description:
          type: string
          description: Result description.
        data:
          type: object
          properties:
            nickname:
              type: string
              description: User's display name.
            miliaoId:
              type: integer
              format: int64
              description: User's unique Xiaomi account ID.
            avatarUrl:
              type: string
              format: uri
              description: URL to the user's profile picture.
    UserContact:
      type: object
      properties:
        result:
          type: string
        description:
          type: string
        data:
          type: object
          properties:
            phone:
              type: string
              description: User's phone number (may be empty).
            email:
              type: string
              format: email
              description: User's email address (may be empty).
  securitySchemes:
    hmacAuth:
      type: http
      scheme: custom
      description: HMAC-based signature authentication. Requests must include a Date header and Authorization header with HMAC-SHA1 signature.