Carte de chaleur
curl --request GET \
--url https://api.crowdchange.dev/v2/client/fundraiser/{id}/heatmap \
--header 'Authorization: <api-key>'import requests
url = "https://api.crowdchange.dev/v2/client/fundraiser/{id}/heatmap"
headers = {"Authorization": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: '<api-key>'}};
fetch('https://api.crowdchange.dev/v2/client/fundraiser/{id}/heatmap', 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.crowdchange.dev/v2/client/fundraiser/{id}/heatmap",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: <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.crowdchange.dev/v2/client/fundraiser/{id}/heatmap"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "<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.crowdchange.dev/v2/client/fundraiser/{id}/heatmap")
.header("Authorization", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.crowdchange.dev/v2/client/fundraiser/{id}/heatmap")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = '<api-key>'
response = http.request(request)
puts response.read_body[
{
"amount_raised": 100,
"n_donors": 10,
"country": "CA",
"state": "NY"
}
]
API spécifiques à la campagne
Carte de chaleur
Récupérez les totaux de dons agrégés par pays et province pour une campagne CrowdChange, parfait pour afficher une carte thermique géographique.
GET
/
v2
/
client
/
fundraiser
/
{id}
/
heatmap
Carte de chaleur
curl --request GET \
--url https://api.crowdchange.dev/v2/client/fundraiser/{id}/heatmap \
--header 'Authorization: <api-key>'import requests
url = "https://api.crowdchange.dev/v2/client/fundraiser/{id}/heatmap"
headers = {"Authorization": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: '<api-key>'}};
fetch('https://api.crowdchange.dev/v2/client/fundraiser/{id}/heatmap', 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.crowdchange.dev/v2/client/fundraiser/{id}/heatmap",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: <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.crowdchange.dev/v2/client/fundraiser/{id}/heatmap"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "<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.crowdchange.dev/v2/client/fundraiser/{id}/heatmap")
.header("Authorization", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.crowdchange.dev/v2/client/fundraiser/{id}/heatmap")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = '<api-key>'
response = http.request(request)
puts response.read_body[
{
"amount_raised": 100,
"n_donors": 10,
"country": "CA",
"state": "NY"
}
]
Paramètres de chemin
integer
requis
ID de la campagne.
Réponse
Retourne un tableau d’objets contenant les champs suivants.number
Montant total amassé
number
Nombre de donateurs
string
Code de pays
string
État ou province.
| Statut | Description |
|---|---|
400 | Requête invalide |
403 | Interdit |
[
{
"amount_raised": 100,
"n_donors": 10,
"country": "CA",
"state": "NY"
}
]
Cette page vous a-t-elle été utile ?
⌘I