User Start Upload Avatar
🔑 Need JWT Authorization
Description
Start upload user avatar
Method And Path
js
POST /v2/user/upload-avatar/start
Request
Header
ts
{
"authorization": string;
"x-request-id": string;
"x-session-id": string;
}
Body
ts
{
"fileName": string;
"fileSize": number;
}
fileName
File name
- maxLength:
128
- minLength:
1
- format: avatar-suffix
fileSize
File size
- minimum:
1
- maximum: avatar.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
}