v1 (discontinued)
API Discontinued
This API version is discontinued, it's advised you use gRPC.
POST
/v1/export
JSON Body
Field | Type | Description |
---|---|---|
token | string | The bot token for performing requests |
channelId | string | The id of the channel to export |
Response Codes
Status | Description |
---|---|
200 | Success - exported channel sent as text/html |
401 | Unauthorized - bad Discord bot token |
409 | Conflict - unknown channel |
Examples
Typescript:
import fetch from 'node-fetch';
async function exportChannel(channelId: string, token: string): Promise<Buffer> {
const response = await fetch('http://exportapi:80/v1/export', {
method: 'POST',
body: JSON.stringify({ channelId, token }),
headers: {
'Content-Type': 'application/json'
}
});
if (response.ok) {
return response.buffer();
}
throw Error('Channel export failed!');
}
Rust
// reqwest = { version = "0.10", features = ["json"] }
use reqwest::Client;
use std::collections::HashMap;
use std::io::copy;
use std::fs::File;
async fn export_channel(channelId: &str, token: &str) -> Result<File, reqwest::Error> {
let client = Client::new();
let mut map = HashMap::new();
map.insert("channelId", "channel id");
map.insert("token", "discord token");
let file = client.post("http://exportapi:80/v1/export").json(&map).await?.text().await?;
let dest = File::create("myexport.html")?;
copy(&mut file.as_bytes(), &mut dest)?;
Ok(dest)
}