Obtenir une campagne
curl --request GET \
--url https://api.crowdchange.dev/v2/private/fundraiser/{id} \
--header 'Authorization: <api-key>'import requests
url = "https://api.crowdchange.dev/v2/private/fundraiser/{id}"
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/private/fundraiser/{id}', 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/private/fundraiser/{id}",
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/private/fundraiser/{id}"
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/private/fundraiser/{id}")
.header("Authorization", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.crowdchange.dev/v2/private/fundraiser/{id}")
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{
"id": 1,
"partner_id": 10,
"name": "Campaign",
"description": "Description",
"created_at": "2022-01-01 16:00:03",
"amount_goal": 1000,
"amount_raised": 550,
"url": "https://demo.crowdchange.dev/2",
"n_donors": 100,
"language": "en",
"user": {
"id": 1,
"name": "John Snow",
"first_name": "John",
"last_name": "Snow",
"title": "Mr.",
"email": "john@crowdchange.co"
},
"fundraiser_template": {
"id": 1,
"name": "Template"
},
"start_at": "2022-01-01 16:00:03",
"end_at": "2022-01-02 16:00:03",
"tags_list": [
"tag1",
"tag2"
]
}
API spécifiques à la campagne
Obtenir une campagne
Récupérez les informations serveur détaillées d’une campagne CrowdChange par son identifiant, incluant configuration, objectif et statistiques.
GET
/
v2
/
private
/
fundraiser
/
{id}
Obtenir une campagne
curl --request GET \
--url https://api.crowdchange.dev/v2/private/fundraiser/{id} \
--header 'Authorization: <api-key>'import requests
url = "https://api.crowdchange.dev/v2/private/fundraiser/{id}"
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/private/fundraiser/{id}', 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/private/fundraiser/{id}",
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/private/fundraiser/{id}"
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/private/fundraiser/{id}")
.header("Authorization", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.crowdchange.dev/v2/private/fundraiser/{id}")
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{
"id": 1,
"partner_id": 10,
"name": "Campaign",
"description": "Description",
"created_at": "2022-01-01 16:00:03",
"amount_goal": 1000,
"amount_raised": 550,
"url": "https://demo.crowdchange.dev/2",
"n_donors": 100,
"language": "en",
"user": {
"id": 1,
"name": "John Snow",
"first_name": "John",
"last_name": "Snow",
"title": "Mr.",
"email": "john@crowdchange.co"
},
"fundraiser_template": {
"id": 1,
"name": "Template"
},
"start_at": "2022-01-01 16:00:03",
"end_at": "2022-01-02 16:00:03",
"tags_list": [
"tag1",
"tag2"
]
}
Paramètres de chemin
integer
requis
Identifiant de la campagne.
Réponse
integer
Identifiant de la campagne.
integer
Identifiant du site.
string
Nom de la campagne.
string
Description de la campagne.
string
Date de création de la campagne.
number
Montant de l’objectif.
number
Montant amassé par la campagne.
string
URL complète de la campagne.
integer
Nombre de donateurs.
string
Langue de la campagne. Valeurs permises :
en, frobject
string
Date de début de l’événement.
string
Date de fin de l’événement.
any[]
Étiquettes de la campagne.
| Statut | Description |
|---|---|
400 | Requête invalide |
401 | Non autorisé |
403 | Interdit |
{
"id": 1,
"partner_id": 10,
"name": "Campaign",
"description": "Description",
"created_at": "2022-01-01 16:00:03",
"amount_goal": 1000,
"amount_raised": 550,
"url": "https://demo.crowdchange.dev/2",
"n_donors": 100,
"language": "en",
"user": {
"id": 1,
"name": "John Snow",
"first_name": "John",
"last_name": "Snow",
"title": "Mr.",
"email": "john@crowdchange.co"
},
"fundraiser_template": {
"id": 1,
"name": "Template"
},
"start_at": "2022-01-01 16:00:03",
"end_at": "2022-01-02 16:00:03",
"tags_list": [
"tag1",
"tag2"
]
}
Cette page vous a-t-elle été utile ?
⌘I