Cooldowns
Creates a Cooldown
POST /api/cooldown/create
https://api.cookie-api.com/api/cooldown/create
Authentication Learn how to get your API Key and use it in your requests!
URL Parameters | |
---|---|
cooldown_start | UNIX Timestamp of the cooldown start |
cooldown_end | UNIX Timestamp of the cooldown end |
identifier optional | Unique identifier (for example a user id) for the cooldown. max 200 characters |
name optional | Name for your cooldown |
curl --location --request POST 'https://api.cookie-api.com/api/cooldown/create?cooldown_start=1739104501&cooldown_end=1739104701&identifier=test%20saidsa%20jidsa%20jdsa&name=Test%20cooldown' \--header 'Authorization: API_Key'
import requests
url = 'https://api.cookie-api.com/api/cooldown/create'params = { 'cooldown_start': 1739104501, 'cooldown_end': 1739104701, 'identifier': 'test saidsa jidsa jdsa', 'name': 'Test cooldown'}headers = { 'Authorization': 'API_Key'}
response = requests.post(url, params=params, headers=headers)print(response.json())
const fetch = require('node-fetch');
const url = 'https://api.cookie-api.com/api/cooldown/create';const params = new URLSearchParams({ cooldown_start: '1739104501', cooldown_end: '1739104701', identifier: 'test saidsa jidsa jdsa', name: 'Test cooldown'});const headers = { 'Authorization': 'API_Key'};
fetch(`${url}?${params}`, { method: 'POST', headers }) .then(response => response.json()) .then(data => console.log(data)) .catch(error => console.error('Error:', error));
package main
import ( "bytes" "fmt" "log" "net/http" "net/url" "strings")
func main() { url := "https://api.cookie-api.com/api/cooldown/create" params := url.Values{} params.Add("cooldown_start", "1739104501") params.Add("cooldown_end", "1739104701") params.Add("identifier", "test saidsa jidsa jdsa") params.Add("name", "Test cooldown")
req, err := http.NewRequest("POST", url+"?"+params.Encode(), nil) if err != nil { log.Fatal(err) }
req.Header.Add("Authorization", "API_Key")
client := &http.Client{} resp, err := client.Do(req) if err != nil { log.Fatal(err) } defer resp.Body.Close()
var body []byte resp.Body.Read(body) fmt.Println(string(body))}
const https = require('https');const querystring = require('querystring');
const params = querystring.stringify({ cooldown_start: '1739104501', cooldown_end: '1739104701', identifier: 'test saidsa jidsa jdsa', name: 'Test cooldown'});
const options = { hostname: 'api.cookie-api.com', path: '/api/cooldown/create?' + params, method: 'POST', headers: { 'Authorization': 'API_Key' }};
const req = https.request(options, res => { let data = '';
res.on('data', chunk => { data += chunk; });
res.on('end', () => { console.log(JSON.parse(data)); });});
req.on('error', error => { console.error(error);});
req.end();
require 'net/http'require 'json'require 'uri'
url = URI.parse('https://api.cookie-api.com/api/cooldown/create')uri = URI.parse(url.to_s + "?cooldown_start=1739104501&cooldown_end=1739104701&identifier=test%20saidsa%20jidsa%20jdsa&name=Test%20cooldown")request = Net::HTTP::Post.new(uri)request['Authorization'] = 'API_Key'
response = Net::HTTP.start(uri.hostname, uri.port) { |http| http.request(request) }
puts JSON.parse(response.body)
use reqwest::blocking::Client;use reqwest::header::HeaderMap;use serde_json::Value;
fn main() { let url = "https://api.cookie-api.com/api/cooldown/create?cooldown_start=1739104501&cooldown_end=1739104701&identifier=test%20saidsa%20jidsa%20jdsa&name=Test%20cooldown"; let mut headers = HeaderMap::new(); headers.insert("Authorization", "API_Key".parse().unwrap());
let client = Client::new(); let res = client.post(url) .headers(headers) .send() .unwrap();
let body: Value = res.json().unwrap(); println!("{:?}", body);}
Responses
{ "cooldown_end": "1739104626", "cooldown_id": "1404549975", "cooldown_start": "1739104626", "name": "Test cooldown", "success": true, "unique_identifier": "test saidsa jidsa jdsa"}
Get a Cooldown
Gets a Cooldown
GET /api/cooldown/get-cooldown
https://api.cookie-api.com/api/cooldown/get-cooldown
Authentication Learn how to get your API Key and use it in your requests!
URL Parameters | |
---|---|
filter_type | Filter type. Must be one of the following: 'name', 'identifier', 'cooldownid' |
filter_value | Filter value |
curl --location 'https://api.cookie-api.com/api/cooldown/get-cooldown?filter_type=cooldownid&filter_value=1404549975' \--header 'Authorization: API_Key'
import requests
url = 'https://api.cookie-api.com/api/cooldown/get-cooldown'params = { 'filter_type': 'cooldownid', 'filter_value': '1404549975'}headers = { 'Authorization': 'API_Key'}
response = requests.get(url, params=params, headers=headers)print(response.json())
const fetch = require('node-fetch');
const url = 'https://api.cookie-api.com/api/cooldown/get-cooldown';const params = new URLSearchParams({ filter_type: 'cooldownid', filter_value: '1404549975'});const headers = { 'Authorization': 'API_Key'};
fetch(`${url}?${params}`, { method: 'GET', headers }) .then(response => response.json()) .then(data => console.log(data)) .catch(error => console.error('Error:', error));
package main
import ( "fmt" "log" "net/http" "net/url" "io/ioutil")
func main() { url := "https://api.cookie-api.com/api/cooldown/get-cooldown" params := url.Values{} params.Add("filter_type", "cooldownid") params.Add("filter_value", "1404549975")
resp, err := http.Get(url + "?" + params.Encode()) if err != nil { log.Fatal(err) } defer resp.Body.Close()
body, err := ioutil.ReadAll(resp.Body) if err != nil { log.Fatal(err) }
fmt.Println(string(body))}
const https = require('https');const querystring = require('querystring');
const params = querystring.stringify({ filter_type: 'cooldownid', filter_value: '1404549975'});
const options = { hostname: 'api.cookie-api.com', path: '/api/cooldown/get-cooldown?' + params, method: 'GET', headers: { 'Authorization': 'API_Key' }};
const req = https.request(options, res => { let data = '';
res.on('data', chunk => { data += chunk; });
res.on('end', () => { console.log(JSON.parse(data)); });});
req.on('error', error => { console.error(error);});
req.end();
require 'net/http'require 'json'require 'uri'
url = URI.parse('https://api.cookie-api.com/api/cooldown/get-cooldown')uri = URI.parse(url.to_s + "?filter_type=cooldownid&filter_value=1404549975")request = Net::HTTP::Get.new(uri)request['Authorization'] = 'API_Key'
response = Net::HTTP.start(uri.hostname, uri.port) { |http| http.request(request) }
puts JSON.parse(response.body)
use reqwest::blocking::Client;use reqwest::header::HeaderMap;use serde_json::Value;
fn main() { let url = "https://api.cookie-api.com/api/cooldown/get-cooldown?filter_type=cooldownid&filter_value=1404549975"; let mut headers = HeaderMap::new(); headers.insert("Authorization", "API_Key".parse().unwrap());
let client = Client::new(); let res = client.get(url) .headers(headers) .send() .unwrap();
let body: Value = res.json().unwrap(); println!("{:?}", body);}
Responses
{ "results": [ { "active": true, "cooldown_id": "1404549975", "end": "1739105930", "identifier": "test saidsa jidsa jdsa", "name": "Test cooldown", "start": "1739104626", "started": true, "time_left": 1304 } ], "success": true}
Get all Cooldowns
Gets all Cooldown
GET /api/cooldown/list
https://api.cookie-api.com/api/cooldown/list
Authentication Learn how to get your API Key and use it in your requests!
curl --location 'https://api.cookie-api.com/api/cooldown/list' \--header 'Authorization: API_Key'
import requests
url = 'https://api.cookie-api.com/api/cooldown/list'headers = { 'Authorization': 'API_Key'}
response = requests.get(url, headers=headers)print(response.json())
const fetch = require('node-fetch');
const url = 'https://api.cookie-api.com/api/cooldown/list';const headers = { 'Authorization': 'API_Key'};
fetch(url, { method: 'GET', headers }) .then(response => response.json()) .then(data => console.log(data)) .catch(error => console.error('Error:', error));
package main
import ( "fmt" "log" "net/http" "io/ioutil")
func main() { url := "https://api.cookie-api.com/api/cooldown/list" req, err := http.NewRequest("GET", url, nil) if err != nil { log.Fatal(err) }
req.Header.Add("Authorization", "API_Key")
client := &http.Client{} resp, err := client.Do(req) if err != nil { log.Fatal(err) } defer resp.Body.Close()
body, err := ioutil.ReadAll(resp.Body) if err != nil { log.Fatal(err) }
fmt.Println(string(body))}
const https = require('https');
const options = { hostname: 'api.cookie-api.com', path: '/api/cooldown/list', method: 'GET', headers: { 'Authorization': 'API_Key' }};
const req = https.request(options, res => { let data = '';
res.on('data', chunk => { data += chunk; });
res.on('end', () => { console.log(JSON.parse(data)); });});
req.on('error', error => { console.error(error);});
req.end();
require 'net/http'require 'json'require 'uri'
url = URI.parse('https://api.cookie-api.com/api/cooldown/list')request = Net::HTTP::Get.new(url)request['Authorization'] = 'API_Key'
response = Net::HTTP.start(url.hostname, url.port) { |http| http.request(request) }
puts JSON.parse(response.body)
use reqwest::blocking::Client;use reqwest::header::HeaderMap;use serde_json::Value;
fn main() { let url = "https://api.cookie-api.com/api/cooldown/list"; let mut headers = HeaderMap::new(); headers.insert("Authorization", "API_Key".parse().unwrap());
let client = Client::new(); let res = client.get(url) .headers(headers) .send() .unwrap();
let body: Value = res.json().unwrap(); println!("{:?}", body);}
Responses
{ "cooldowns": [ { "active": true, "cooldown_id": "1404549975", "end": "1739105930", "identifier": "test saidsa jidsa jdsa", "name": "Test cooldown", "start": "1739104626", "started": true, "time_left": 1304 } ], "length": 1, "success": true}
Delete a Cooldown
Deletes a cooldown
DELETE /api/cooldown/delete
https://api.cookie-api.com/api/cooldown/delete
Authentication Learn how to get your API Key and use it in your requests!
URL Parameters | |
---|---|
cooldown_id | ID of the cooldown that should be deleted |
curl --location --request DELETE 'https://api.cookie-api.com/api/cooldown/delete?cooldown_id=1404549975' \--header 'Authorization: API_Key'
import requests
url = 'https://api.cookie-api.com/api/cooldown/delete'params = { 'cooldown_id': '1404549975'}headers = { 'Authorization': 'API_Key'}
response = requests.delete(url, params=params, headers=headers)print(response.json())
const fetch = require('node-fetch');
const url = 'https://api.cookie-api.com/api/cooldown/delete';const params = new URLSearchParams({ cooldown_id: '1404549975'});const headers = { 'Authorization': 'API_Key'};
fetch(`${url}?${params}`, { method: 'DELETE', headers }) .then(response => response.json()) .then(data => console.log(data)) .catch(error => console.error('Error:', error));
package main
import ( "fmt" "log" "net/http" "net/url" "io/ioutil")
func main() { url := "https://api.cookie-api.com/api/cooldown/delete" params := url.Values{} params.Add("cooldown_id", "1404549975")
req, err := http.NewRequest("DELETE", url+"?"+params.Encode(), nil) if err != nil { log.Fatal(err) }
req.Header.Add("Authorization", "API_Key")
client := &http.Client{} resp, err := client.Do(req) if err != nil { log.Fatal(err) } defer resp.Body.Close()
body, err := ioutil.ReadAll(resp.Body) if err != nil { log.Fatal(err) }
fmt.Println(string(body))}
const https = require('https');const querystring = require('querystring');
const params = querystring.stringify({ cooldown_id: '1404549975'});
const options = { hostname: 'api.cookie-api.com', path: '/api/cooldown/delete?' + params, method: 'DELETE', headers: { 'Authorization': 'API_Key' }};
const req = https.request(options, res => { let data = '';
res.on('data', chunk => { data += chunk; });
res.on('end', () => { console.log(JSON.parse(data)); });});
req.on('error', error => { console.error(error);});
req.end();
require 'net/http'require 'json'require 'uri'
url = URI.parse('https://api.cookie-api.com/api/cooldown/delete')uri = URI.parse(url.to_s + "?cooldown_id=1404549975")request = Net::HTTP::Delete.new(uri)request['Authorization'] = 'API_Key'
response = Net::HTTP.start(uri.hostname, uri.port) { |http| http.request(request) }
puts JSON.parse(response.body)
use reqwest::blocking::Client;use reqwest::header::HeaderMap;use serde_json::Value;
fn main() { let url = "https://api.cookie-api.com/api/cooldown/delete?cooldown_id=1404549975"; let mut headers = HeaderMap::new(); headers.insert("Authorization", "API_Key".parse().unwrap());
let client = Client::new(); let res = client.delete(url) .headers(headers) .send() .unwrap();
let body: Value = res.json().unwrap(); println!("{:?}", body);}
Responses
{ "success": true}