Skip to content
On this page

User Start Upload Avatar

🔑 Need JWT Authorization

Description

Start upload user avatar

Method And Path

js
POST /v2/user/upload-avatar/start

Request

ts
{
    "authorization": string;
    "x-request-id": string;
    "x-session-id": string;
}

Body

ts
{
    "fileName": string;
    "fileSize": number;
}

fileName

File name

fileSize

File size

Response

Success

HTTP Status Code: 200

ts
{
    status: Status.Success,
    data: {
        fileUUID: string,
        ossDomain: string,
        ossFilePath: string,
        policy: string,
        signature: string,
    }
}

Extends Type: Status

fileUUID

UUID of the current avatar file

ossDomain

OSS domain

ossFilePath

OSS file path

e.g. /test/x.png

policy

OSS policy

Ref: Policy

signature

OSS signature

Ref: Policy

Failed

HTTP Status Code: 200

ts
{
    status: Status.Failed,
    code: ErrorCode
}

Extends Type: Status, ErrorCode

Released under the MIT License.