Create auth session
curl --request POST \
--url https://api.duckybot.xyz/auth \
--header 'Discord-Code: <discord-code>'import requests
url = "https://api.duckybot.xyz/auth"
headers = {"Discord-Code": "<discord-code>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {'Discord-Code': '<discord-code>'}};
fetch('https://api.duckybot.xyz/auth', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.duckybot.xyz/auth",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Discord-Code: <discord-code>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.duckybot.xyz/auth"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("Discord-Code", "<discord-code>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.duckybot.xyz/auth")
.header("Discord-Code", "<discord-code>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.duckybot.xyz/auth")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Discord-Code"] = '<discord-code>'
response = http.request(request)
puts response.read_body{
"code": 200,
"message": "Session has been successfully authorized.",
"data": {
"token": "c8d8fe6a-90c3-41f9-a464-e1ebf37b8b67",
"user": {
"username": "troptopreal",
"name": "Troptop",
"id": "598958193032560642",
"avatar": "https://cdn.discordapp.com/avatars/598958193032560642/b4a9105d349cc3e9c3d5c0d3b24adbb8.png"
}
}
}
Authentication Endpoints
Create auth session
Create a new auth session linked to a Discord user.
POST
/
auth
Create auth session
curl --request POST \
--url https://api.duckybot.xyz/auth \
--header 'Discord-Code: <discord-code>'import requests
url = "https://api.duckybot.xyz/auth"
headers = {"Discord-Code": "<discord-code>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {'Discord-Code': '<discord-code>'}};
fetch('https://api.duckybot.xyz/auth', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.duckybot.xyz/auth",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Discord-Code: <discord-code>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.duckybot.xyz/auth"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("Discord-Code", "<discord-code>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.duckybot.xyz/auth")
.header("Discord-Code", "<discord-code>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.duckybot.xyz/auth")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Discord-Code"] = '<discord-code>'
response = http.request(request)
puts response.read_body{
"code": 200,
"message": "Session has been successfully authorized.",
"data": {
"token": "c8d8fe6a-90c3-41f9-a464-e1ebf37b8b67",
"user": {
"username": "troptopreal",
"name": "Troptop",
"id": "598958193032560642",
"avatar": "https://cdn.discordapp.com/avatars/598958193032560642/b4a9105d349cc3e9c3d5c0d3b24adbb8.png"
}
}
}
{
"code": 200,
"message": "Session has been successfully authorized.",
"data": {
"token": "c8d8fe6a-90c3-41f9-a464-e1ebf37b8b67",
"user": {
"username": "troptopreal",
"name": "Troptop",
"id": "598958193032560642",
"avatar": "https://cdn.discordapp.com/avatars/598958193032560642/b4a9105d349cc3e9c3d5c0d3b24adbb8.png"
}
}
}
Headers
string
required
The Discord OAuth2 access code of the user.
Response Data
string
The newly-generated Ducky session token.
āI