跳转到主要内容
POST
/
attachments
/
signature
cURL
curl --request POST \
  --url http://127.0.0.1:3000/api/attachments/signature \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "contentType": "image/png",
  "contentLength": 123,
  "type": 1,
  "expiresIn": 3600,
  "hash": "xxxxxxxx",
  "baseId": "<string>"
}
'
{
  "url": "https://example.com/attachment/upload",
  "uploadMethod": "POST",
  "token": "xxxxxxxx",
  "requestHeaders": {
    "Content-Type": "image/png"
  }
}

授权

Authorization
string
header
必填

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

请求体

application/json
contentType
string
必填

Mime type

示例:

"image/png"

contentLength
number
必填

File size

示例:

123

type
enum<integer>
必填

Type

可用选项:
1,
2,
3,
4,
5,
6,
7,
8,
9,
10,
11,
12,
13,
14
示例:

1

expiresIn
number

Token expire time, seconds

示例:

3600

hash
string

File hash

示例:

"xxxxxxxx"

baseId
string

响应

201 - application/json

return the upload URL and the key.

url
string
必填

Upload url

示例:

"https://example.com/attachment/upload"

uploadMethod
string
必填

Upload method

示例:

"POST"

token
string
必填

Secret key

示例:

"xxxxxxxx"

requestHeaders
object
必填
示例:
{ "Content-Type": "image/png" }
Last modified on December 10, 2025