דלג לתוכן הראשי
POST
/
files
/
share
/
{fileId}
curl --request POST \
  --url https://{projectID}.texterchat.com/server/api/v2/files/share/{fileId} \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "ttl": 86400
}'
{
  "token": "586c5aaebb8cfd628639f46d304b1b516b1d6365278455f6328c53a93b89833ff0f742127eb57c3b2de8dce83d4d8b873adb",
  "url": "https://sandbox.texterchat.com/server/files/shared/6908fc09962e17ab3033fa13/586c5aaebb8cfd628639f46d304b1b516b1d6365278455f6328c53a93b89833ff0f742127eb57c3b2de8dce83d4d8b873adb"
}

הרשאות

Authorization
string
header
נדרש

API token generated in Texter: gear icon → Developers → API Tokens. When creating a token, assign it the scopes required by the endpoints you plan to call - each endpoint lists its required scopes.

פרמטרי נתיב

fileId
string
נדרש

The file ID. Obtain it from the media[].fileId field within a message object (see Get Messages of a Chat)

גוף

application/json
ttl
integer

Time to live in seconds - how long the link remains valid before it expires. From 10 seconds to 630,720,000 (20 years). Omit for a link that never expires

טווח נדרש: 10 <= x <= 630720000

תגובה

The share token and the resulting public URL

token
string

The share token

url
string

Public link that incorporates the token. Can be used to access the file until it expires