Get Quotes by Character

This example shows how to use the GET /api/quotes/character/:name endpoint in various languages.

const fetch = require('node-fetch');

fetch('https://api.tsto.app/api/quotes/character/Homer%20Simpson?apikey=YOUR_KEY&page=1&amount=50')
  .then(res => res.json())
  .then(data => console.log(data))
  .catch(err => console.error(err));
import requests

url = "https://api.tsto.app/api/quotes/character/Homer%20Simpson"
params = {
    "apikey": "YOUR_KEY",
    "page": 1,
    "amount": 50
}
response = requests.get(url, params=params)
print(response.json())
#include 
#include 

int main() {
    CURL *curl = curl_easy_init();
    if (curl) {
        curl_easy_setopt(curl, CURLOPT_URL, "https://api.tsto.app/api/quotes/character/Homer%20Simpson?apikey=YOUR_KEY&page=1&amount=50");
        CURLcode res = curl_easy_perform(curl);
        curl_easy_cleanup(curl);
    }
    return 0;
}

Send Auth Code

This example shows how to use the POST /api/auth/sendCode endpoint to send an authentication code to a user's email and receive the code in the response.

const fetch = require('node-fetch');

const url = 'https://api.tsto.app/api/auth/sendCode';
const params = new URLSearchParams({
  apikey: 'YOUR_KEY',
  emailAddress: '[email protected]',
  teamName: 'GameServer-Reborn',
  username: 'ethanprimmer'
});

fetch(`${url}?${params.toString()}`, { method: 'POST' })
  .then(res => res.json())
  .then(data => console.log(data))
  .catch(err => console.error(err));
import requests

url = "https://api.tsto.app/api/auth/sendCode"
params = {
    "apikey": "YOUR_KEY",
    "emailAddress": "[email protected]",
    "teamName": "GameServer-Reborn",
    "username": "ethanprimmer"
}
response = requests.post(url, params=params)
print(response.json())
#include 
#include 

int main() {
    CURL *curl = curl_easy_init();
    if (curl) {
        curl_easy_setopt(curl, CURLOPT_URL, "https://api.tsto.app/api/auth/[email protected]&teamName=GameServer-Reborn&username=ethanprimmer");
        curl_easy_setopt(curl, CURLOPT_POST, 1L);
        CURLcode res = curl_easy_perform(curl);
        curl_easy_cleanup(curl);
    }
    return 0;
}