Create Share Link
POST
/share:::caution
If you are currently using share.discohook.app
, migrate ASAP; it will stop being hosted soon!
:::
Your request must be in total fewer than 24.5 MiB as indicated by the Content-Length header. This is a limitation of Cloudflare KV.
Request
Body Params application/json
data
object (QueryData)
required
version
enum<string>
optional
Allowed value:
d2
backup_id
string
optional
messages
array[object (QueryDataMessage) {3}]
required
targets
array [object {1}]
required
ttl
integer <int32>
optional
Total number of seconds that the share link should be valid for, relative to now. e.x. 300
creates a share link that expires in 5 minutes.
>= 300<= 2419200
Default:
604800
Example
{
"data": {
"version": "d2",
"backup_id": "string",
"messages": [
{
"_id": "string",
"data": {
"author": {
"name": "string",
"icon_url": "string",
"badge": "string"
},
"content": "string",
"embeds": [
{
"title": "string",
"description": "string",
"color": 0,
"author": {
"name": "string",
"url": "string",
"icon_url": "string"
},
"fields": [
{
"name": "string",
"value": "string",
"inline": true
}
],
"footer": {
"text": "string",
"icon_url": "string"
},
"timestamp": "2019-08-24T14:15:22.123Z",
"image": {
"url": "string"
},
"thumbnail": {
"url": "string"
},
"provider": {
"name": "string",
"url": "string"
}
}
],
"attachments": [
"string"
],
"webhook_id": "string",
"components": [
{
"type": 1,
"components": [
{
"style": "1",
"custom_id": "string"
}
]
}
],
"flags": 0
},
"reference": "string"
}
],
"targets": [
{
"url": "http://example.com"
}
]
},
"ttl": 604800
}
Request samples
Responses
Success(200)
HTTP Code: 200
Content Type : JSONapplication/json
Data Schema
id
string
required
url
string <uri>
required
Fully qualified URL, prefer using this over constructing your own
expires
string <date-time>
required
When the share link will expire if not refreshed. Don't rely on this value long-term for two reasons: 1) Deluxe members are able to refresh share links. 2) id
is not guaranteed to never be used again, and so in the future may refer to different data
Example
{
"id": "7pSFyueh",
"url": "https://discohook.app/?share=7pSFyueh",
"expires": "2024-05-29T14:38:53.519Z"
}
Last modified: 5 months ago