POST
/
attachments
/
signature
curl --request POST \
  --url https://app.teable.cn/api/attachments/signature \
  --header 'Authorization: Bearer REPLACE_BEARER_TOKEN' \
  --header 'content-type: application/json' \
  --data '{"contentType":"image/png","contentLength":123,"expiresIn":3600,"hash":"xxxxxxxx","type":1,"baseId":"string"}'
{
  "url": "https://example.com/attachment/upload",
  "uploadMethod": "POST",
  "token": "xxxxxxxx",
  "requestHeaders": {
    "Content-Type": "image/png"
  }
}

Authorizations

Authorization
string
header
required

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

Body

application/json
contentType
string
required

Mime type

Example:

"image/png"

contentLength
number
required

File size

Example:

123

type
enum<integer>
required

Type

Available options:
1,
2,
3,
4,
5,
6,
7
Example:

1

expiresIn
number

Token expire time, seconds

Example:

3600

hash
string

File hash

Example:

"xxxxxxxx"

baseId
string

Response

201 - application/json
return the upload URL and the key.
url
string
required

Upload url

Example:

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

uploadMethod
string
required

Upload method

Example:

"POST"

token
string
required

Secret key

Example:

"xxxxxxxx"

requestHeaders
object
required
Example:
{ "Content-Type": "image/png" }