Request a charity
curl --request POST \
--url https://api.donate.gg/api/v2/charity-requests \
--header 'Content-Type: application/json' \
--header 'donate-api-key: <api-key>' \
--data '
{
"registerId": "united-states",
"registrationNumber": "86-0481941"
}
'import requests
url = "https://api.donate.gg/api/v2/charity-requests"
payload = {
"registerId": "united-states",
"registrationNumber": "86-0481941"
}
headers = {
"donate-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'donate-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({registerId: 'united-states', registrationNumber: '86-0481941'})
};
fetch('https://api.donate.gg/api/v2/charity-requests', 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.donate.gg/api/v2/charity-requests",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'registerId' => 'united-states',
'registrationNumber' => '86-0481941'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"donate-api-key: <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"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.donate.gg/api/v2/charity-requests"
payload := strings.NewReader("{\n \"registerId\": \"united-states\",\n \"registrationNumber\": \"86-0481941\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("donate-api-key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
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.donate.gg/api/v2/charity-requests")
.header("donate-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"registerId\": \"united-states\",\n \"registrationNumber\": \"86-0481941\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.donate.gg/api/v2/charity-requests")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["donate-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"registerId\": \"united-states\",\n \"registrationNumber\": \"86-0481941\"\n}"
response = http.request(request)
puts response.read_body{
"registerId": "united-states",
"registrationNumber": "86-0481941",
"status": "listed",
"charityId": "9b4dae4e-d8c1-4322-a594-35a4858296b2",
"queue": null
}{
"registerId": "united-states",
"registrationNumber": "12-3456789",
"status": "requested",
"charityId": null,
"queue": {
"ahead": 4,
"typicalSeconds": 172800
}
}{
"code": "VALIDATION_ERROR",
"message": "<string>",
"issues": [
{
"path": "<string>",
"code": "required",
"message": "<string>"
}
]
}{
"code": "UNAUTHENTICATED",
"message": "This operation needs your API key. Send it in the donate-api-key header."
}{
"code": "CHARITY_UNAVAILABLE",
"message": "<string>"
}{
"code": "PAYLOAD_TOO_LARGE",
"message": "<string>"
}{
"code": "REGISTRATION_NOT_FOUND",
"message": "<string>"
}{
"code": "RATE_LIMIT_EXCEEDED",
"message": "<string>"
}{
"code": "PROVIDER_UNAVAILABLE",
"message": "<string>"
}Charity requests
Request a charity
Ask for a charity to be added to Donate. The registration is checked against its register and saved for review; a request never lists a charity by itself and review has no fixed timeline. 201 when this request started a review, 200 when the registration was already listed, requested or reviewed. Repeating a request is safe: it counts as demand and does not reopen a decision. Requests have their own budget per project on top of the normal rate limit. Requires your API key.
POST
/
v2
/
charity-requests
Request a charity
curl --request POST \
--url https://api.donate.gg/api/v2/charity-requests \
--header 'Content-Type: application/json' \
--header 'donate-api-key: <api-key>' \
--data '
{
"registerId": "united-states",
"registrationNumber": "86-0481941"
}
'import requests
url = "https://api.donate.gg/api/v2/charity-requests"
payload = {
"registerId": "united-states",
"registrationNumber": "86-0481941"
}
headers = {
"donate-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'donate-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({registerId: 'united-states', registrationNumber: '86-0481941'})
};
fetch('https://api.donate.gg/api/v2/charity-requests', 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.donate.gg/api/v2/charity-requests",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'registerId' => 'united-states',
'registrationNumber' => '86-0481941'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"donate-api-key: <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"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.donate.gg/api/v2/charity-requests"
payload := strings.NewReader("{\n \"registerId\": \"united-states\",\n \"registrationNumber\": \"86-0481941\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("donate-api-key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
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.donate.gg/api/v2/charity-requests")
.header("donate-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"registerId\": \"united-states\",\n \"registrationNumber\": \"86-0481941\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.donate.gg/api/v2/charity-requests")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["donate-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"registerId\": \"united-states\",\n \"registrationNumber\": \"86-0481941\"\n}"
response = http.request(request)
puts response.read_body{
"registerId": "united-states",
"registrationNumber": "86-0481941",
"status": "listed",
"charityId": "9b4dae4e-d8c1-4322-a594-35a4858296b2",
"queue": null
}{
"registerId": "united-states",
"registrationNumber": "12-3456789",
"status": "requested",
"charityId": null,
"queue": {
"ahead": 4,
"typicalSeconds": 172800
}
}{
"code": "VALIDATION_ERROR",
"message": "<string>",
"issues": [
{
"path": "<string>",
"code": "required",
"message": "<string>"
}
]
}{
"code": "UNAUTHENTICATED",
"message": "This operation needs your API key. Send it in the donate-api-key header."
}{
"code": "CHARITY_UNAVAILABLE",
"message": "<string>"
}{
"code": "PAYLOAD_TOO_LARGE",
"message": "<string>"
}{
"code": "REGISTRATION_NOT_FOUND",
"message": "<string>"
}{
"code": "RATE_LIMIT_EXCEEDED",
"message": "<string>"
}{
"code": "PROVIDER_UNAVAILABLE",
"message": "<string>"
}Authorizations
Body
application/json
Response
Nothing new was requested. status says why.
Was this page helpful?