Create Share Link
Production
Production
POST
https://discohook.app/api/v1/share
CAUTION
share.discohook.app
, migrate ASAP; it will stop being hosted soon!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
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:22Z",
"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
Shell
JavaScript
Java
Swift
Go
PHP
Python
HTTP
C
C#
Objective-C
Ruby
OCaml
Dart
R
Request Request Example
Shell
JavaScript
Java
Swift
curl --location --request POST 'https://discohook.app/api/v1/share' \
--header 'Content-Type: application/json' \
--data-raw ''
Responses
🟢200Success
application/json
Body
id
string
required
url
string <uri>
required
expires
string <date-time>
required
id
is not guaranteed to never be used again, and so in the future may refer to different dataExample
{
"id": "7pSFyueh",
"url": "https://discohook.app/?share=7pSFyueh",
"expires": "2024-05-29T14:38:53.519Z"
}
Modified at 2024-08-04 17:00:04