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"
}{
"error": "<string>"
}Files
Generate Public Media URL
Generate a public URL for a media file stored in Texter.
POST
https://{projectID}.texterchat.com/server/api/v2
/
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"
}{
"error": "<string>"
}Required token scopes:
View all chats, View all files (both are required)
The generated link provides read-only access and remains valid according to the TTL (time-to-live) specified in the request. If no TTL is specified, the link does not expire.
Generating a new link does not override existing ones - multiple public URLs can coexist for the same file.Authorizations
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.
Path Parameters
The file ID. Obtain it from the media[].fileId field within a message object (see Get Messages of a Chat)
Body
application/json
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
Required range:
10 <= x <= 630720000