Initialize discord sandbox with data
curl --request POST \
--url https://api.klavis.ai/sandbox/discord/{sandbox_id}/initialize \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"channels": [
{
"messages": [
{
"content": "Welcome to the Discord sandbox test!",
"reactions": [
{
"name": "👋"
},
{
"name": "🎉"
}
]
},
{
"content": "This is the second test message.",
"reactions": [
{
"name": "👍"
}
]
},
{
"content": "Message without reactions for testing.",
"reactions": []
}
]
}
]
}
'import requests
url = "https://api.klavis.ai/sandbox/discord/{sandbox_id}/initialize"
payload = { "channels": [{ "messages": [
{
"content": "Welcome to the Discord sandbox test!",
"reactions": [{ "name": "👋" }, { "name": "🎉" }]
},
{
"content": "This is the second test message.",
"reactions": [{ "name": "👍" }]
},
{
"content": "Message without reactions for testing.",
"reactions": []
}
] }] }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
channels: [
{
messages: [
{
content: 'Welcome to the Discord sandbox test!',
reactions: [{name: '👋'}, {name: '🎉'}]
},
{content: 'This is the second test message.', reactions: [{name: '👍'}]},
{content: 'Message without reactions for testing.', reactions: []}
]
}
]
})
};
fetch('https://api.klavis.ai/sandbox/discord/{sandbox_id}/initialize', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
channels: [
{
messages: [
{
content: 'Welcome to the Discord sandbox test!',
reactions: [{name: '👋'}, {name: '🎉'}]
},
{content: 'This is the second test message.', reactions: [{name: '👍'}]},
{content: 'Message without reactions for testing.', reactions: []}
]
}
]
})
};
fetch('https://api.klavis.ai/sandbox/discord/{sandbox_id}/initialize', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"sandbox_id": "<string>",
"message": "<string>"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Discord
Initialize discord sandbox with data
Initialize the sandbox with discord-specific data following the defined schema.
POST
/
sandbox
/
discord
/
{sandbox_id}
/
initialize
Initialize discord sandbox with data
curl --request POST \
--url https://api.klavis.ai/sandbox/discord/{sandbox_id}/initialize \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"channels": [
{
"messages": [
{
"content": "Welcome to the Discord sandbox test!",
"reactions": [
{
"name": "👋"
},
{
"name": "🎉"
}
]
},
{
"content": "This is the second test message.",
"reactions": [
{
"name": "👍"
}
]
},
{
"content": "Message without reactions for testing.",
"reactions": []
}
]
}
]
}
'import requests
url = "https://api.klavis.ai/sandbox/discord/{sandbox_id}/initialize"
payload = { "channels": [{ "messages": [
{
"content": "Welcome to the Discord sandbox test!",
"reactions": [{ "name": "👋" }, { "name": "🎉" }]
},
{
"content": "This is the second test message.",
"reactions": [{ "name": "👍" }]
},
{
"content": "Message without reactions for testing.",
"reactions": []
}
] }] }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
channels: [
{
messages: [
{
content: 'Welcome to the Discord sandbox test!',
reactions: [{name: '👋'}, {name: '🎉'}]
},
{content: 'This is the second test message.', reactions: [{name: '👍'}]},
{content: 'Message without reactions for testing.', reactions: []}
]
}
]
})
};
fetch('https://api.klavis.ai/sandbox/discord/{sandbox_id}/initialize', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
channels: [
{
messages: [
{
content: 'Welcome to the Discord sandbox test!',
reactions: [{name: '👋'}, {name: '🎉'}]
},
{content: 'This is the second test message.', reactions: [{name: '👍'}]},
{content: 'Message without reactions for testing.', reactions: []}
]
}
]
})
};
fetch('https://api.klavis.ai/sandbox/discord/{sandbox_id}/initialize', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"sandbox_id": "<string>",
"message": "<string>"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Authorizations
Your Klavis AI API key.
Path Parameters
The unique sandbox identifier
Query Parameters
If true, use default test data for initialization
Body
application/json
Complete Discord sandbox data structure.
Hierarchy:
- Channels contain Messages
- Messages can have Reactions
List of channels
Show child attributes
Show child attributes
⌘I
