cURL
curl --request GET \
--url https://api.guilds.me/v1/votes \
--header 'Guilds-Api-Key: <api-key>' \
--header 'Guilds-App-Id: <api-key>'import requests
url = "https://api.guilds.me/v1/votes"
headers = {
"Guilds-Api-Key": "<api-key>",
"Guilds-App-Id": "<api-key>"
}
response = requests.get(url, headers=headers)
print(response.text)const options = {
method: 'GET',
headers: {'Guilds-Api-Key': '<api-key>', 'Guilds-App-Id': '<api-key>'}
};
fetch('https://api.guilds.me/v1/votes', 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.guilds.me/v1/votes",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Guilds-Api-Key: <api-key>",
"Guilds-App-Id: <api-key>"
],
]);
$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.guilds.me/v1/votes"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Guilds-Api-Key", "<api-key>")
req.Header.Add("Guilds-App-Id", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.guilds.me/v1/votes")
.header("Guilds-Api-Key", "<api-key>")
.header("Guilds-App-Id", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.guilds.me/v1/votes")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Guilds-Api-Key"] = '<api-key>'
request["Guilds-App-Id"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"totalVotes": 123,
"monthlyVotes": 123,
"votes": [
{
"userId": "<string>",
"remaining": 123,
"discord": true
}
]
}{
"status": 401,
"error": "Unauthorised"
}Votes
List Votes
List the current active votes
GET
/
votes
cURL
curl --request GET \
--url https://api.guilds.me/v1/votes \
--header 'Guilds-Api-Key: <api-key>' \
--header 'Guilds-App-Id: <api-key>'import requests
url = "https://api.guilds.me/v1/votes"
headers = {
"Guilds-Api-Key": "<api-key>",
"Guilds-App-Id": "<api-key>"
}
response = requests.get(url, headers=headers)
print(response.text)const options = {
method: 'GET',
headers: {'Guilds-Api-Key': '<api-key>', 'Guilds-App-Id': '<api-key>'}
};
fetch('https://api.guilds.me/v1/votes', 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.guilds.me/v1/votes",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Guilds-Api-Key: <api-key>",
"Guilds-App-Id: <api-key>"
],
]);
$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.guilds.me/v1/votes"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Guilds-Api-Key", "<api-key>")
req.Header.Add("Guilds-App-Id", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.guilds.me/v1/votes")
.header("Guilds-Api-Key", "<api-key>")
.header("Guilds-App-Id", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.guilds.me/v1/votes")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Guilds-Api-Key"] = '<api-key>'
request["Guilds-App-Id"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"totalVotes": 123,
"monthlyVotes": 123,
"votes": [
{
"userId": "<string>",
"remaining": 123,
"discord": true
}
]
}{
"status": 401,
"error": "Unauthorised"
}Authorizations
API Key specific to each guild
App ID specific to each guild
Was this page helpful?
⌘I