Mettre à jour l'équipe
curl --request PUT \
--url https://api.crowdchange.dev/v2/private/user/fundraiser/{id}/team/{teamId} \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"token": "<string>",
"name": "<string>",
"amount_goal": 123,
"description": "<string>",
"image": "<string>"
}
'import requests
url = "https://api.crowdchange.dev/v2/private/user/fundraiser/{id}/team/{teamId}"
payload = {
"token": "<string>",
"name": "<string>",
"amount_goal": 123,
"description": "<string>",
"image": "<string>"
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
token: '<string>',
name: '<string>',
amount_goal: 123,
description: '<string>',
image: '<string>'
})
};
fetch('https://api.crowdchange.dev/v2/private/user/fundraiser/{id}/team/{teamId}', 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/user/fundraiser/{id}/team/{teamId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'token' => '<string>',
'name' => '<string>',
'amount_goal' => 123,
'description' => '<string>',
'image' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"Content-Type: application/json"
],
]);
$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.crowdchange.dev/v2/private/user/fundraiser/{id}/team/{teamId}"
payload := strings.NewReader("{\n \"token\": \"<string>\",\n \"name\": \"<string>\",\n \"amount_goal\": 123,\n \"description\": \"<string>\",\n \"image\": \"<string>\"\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "<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.put("https://api.crowdchange.dev/v2/private/user/fundraiser/{id}/team/{teamId}")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"token\": \"<string>\",\n \"name\": \"<string>\",\n \"amount_goal\": 123,\n \"description\": \"<string>\",\n \"image\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.crowdchange.dev/v2/private/user/fundraiser/{id}/team/{teamId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"token\": \"<string>\",\n \"name\": \"<string>\",\n \"amount_goal\": 123,\n \"description\": \"<string>\",\n \"image\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"id": 1,
"name": "Team A",
"description": "Team description",
"image": "1eaf5ab2-5d55-11ee-82ef-001c42584fa2",
"amount_goal": 1000,
"amount_raised": 550,
"amount_raised_formatted": "$550",
"url": "https://demo.crowdchange.dev/1/team/2",
"language": "en",
"n_pages": 50,
"images": {
"original": "https://img.crowdchange.co/files/abc.png?tr=w-[width],h-[height]"
},
"fundraiser": {
"id": 1,
"name": "Gala Night",
"amount_goal": 10000,
"amount_raised": 8000,
"amount_raised_formatted": "$8,000",
"url": "https://demo.crowdchange.dev/1",
"language": "en",
"organization": {
"id": 1,
"name": "Crowdchange",
"custom_id": "CrowdchangeID"
}
},
"user": {
"name": "John Snow",
"first_name": "John",
"last_name": "Snow",
"title": "Mr."
}
}
API spécifiques à l'utilisateur
Mettre à jour l'équipe
Mettez à jour l’équipe de financement CrowdChange de l’utilisateur authentifié dans une campagne, incluant nom, description, objectif et image de couverture.
PUT
/
v2
/
private
/
user
/
fundraiser
/
{id}
/
team
/
{teamId}
Mettre à jour l'équipe
curl --request PUT \
--url https://api.crowdchange.dev/v2/private/user/fundraiser/{id}/team/{teamId} \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"token": "<string>",
"name": "<string>",
"amount_goal": 123,
"description": "<string>",
"image": "<string>"
}
'import requests
url = "https://api.crowdchange.dev/v2/private/user/fundraiser/{id}/team/{teamId}"
payload = {
"token": "<string>",
"name": "<string>",
"amount_goal": 123,
"description": "<string>",
"image": "<string>"
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
token: '<string>',
name: '<string>',
amount_goal: 123,
description: '<string>',
image: '<string>'
})
};
fetch('https://api.crowdchange.dev/v2/private/user/fundraiser/{id}/team/{teamId}', 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/user/fundraiser/{id}/team/{teamId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'token' => '<string>',
'name' => '<string>',
'amount_goal' => 123,
'description' => '<string>',
'image' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"Content-Type: application/json"
],
]);
$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.crowdchange.dev/v2/private/user/fundraiser/{id}/team/{teamId}"
payload := strings.NewReader("{\n \"token\": \"<string>\",\n \"name\": \"<string>\",\n \"amount_goal\": 123,\n \"description\": \"<string>\",\n \"image\": \"<string>\"\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "<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.put("https://api.crowdchange.dev/v2/private/user/fundraiser/{id}/team/{teamId}")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"token\": \"<string>\",\n \"name\": \"<string>\",\n \"amount_goal\": 123,\n \"description\": \"<string>\",\n \"image\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.crowdchange.dev/v2/private/user/fundraiser/{id}/team/{teamId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"token\": \"<string>\",\n \"name\": \"<string>\",\n \"amount_goal\": 123,\n \"description\": \"<string>\",\n \"image\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"id": 1,
"name": "Team A",
"description": "Team description",
"image": "1eaf5ab2-5d55-11ee-82ef-001c42584fa2",
"amount_goal": 1000,
"amount_raised": 550,
"amount_raised_formatted": "$550",
"url": "https://demo.crowdchange.dev/1/team/2",
"language": "en",
"n_pages": 50,
"images": {
"original": "https://img.crowdchange.co/files/abc.png?tr=w-[width],h-[height]"
},
"fundraiser": {
"id": 1,
"name": "Gala Night",
"amount_goal": 10000,
"amount_raised": 8000,
"amount_raised_formatted": "$8,000",
"url": "https://demo.crowdchange.dev/1",
"language": "en",
"organization": {
"id": 1,
"name": "Crowdchange",
"custom_id": "CrowdchangeID"
}
},
"user": {
"name": "John Snow",
"first_name": "John",
"last_name": "Snow",
"title": "Mr."
}
}
Paramètres de chemin
integer
requis
ID de la campagne.
integer
requis
ID de l’équipe.
Corps
string
requis
Jeton d’accès de l’utilisateur.
string
Nom de l’équipe
number
Montant de l’objectif de l’équipe
string
Description de l’équipe
string
ID de l’image de l’équipe
Réponse
Retourne l’objet mis à jour avec les champs suivants.integer
ID de l’équipe.
string
Nom de l’équipe.
string
Description de l’équipe
string
ID de l’image de l’équipe
number
Montant de l’objectif.
number
Montant amassé par l’équipe.
string
Montant amassé par l’équipe, formaté avec le symbole de devise.
string
URL de la page de l’équipe.
string
Langue de l’équipe. Valeurs permises :
en, frinteger
Nombre de pages.
object
Campagne à laquelle l’équipe appartient.
Afficher propriétés
Afficher propriétés
integer
ID de la campagne.
string
Nom de la campagne.
number
Montant de l’objectif de la campagne.
number
Montant total amassé par la campagne.
string
Montant amassé par la campagne, formaté avec le symbole de devise.
string
URL complète de la page de la campagne.
string
Langue de la campagne. Valeurs permises :
en, frobject
| Status | Description |
|---|---|
400 | Bad Request |
403 | Forbidden |
{
"id": 1,
"name": "Team A",
"description": "Team description",
"image": "1eaf5ab2-5d55-11ee-82ef-001c42584fa2",
"amount_goal": 1000,
"amount_raised": 550,
"amount_raised_formatted": "$550",
"url": "https://demo.crowdchange.dev/1/team/2",
"language": "en",
"n_pages": 50,
"images": {
"original": "https://img.crowdchange.co/files/abc.png?tr=w-[width],h-[height]"
},
"fundraiser": {
"id": 1,
"name": "Gala Night",
"amount_goal": 10000,
"amount_raised": 8000,
"amount_raised_formatted": "$8,000",
"url": "https://demo.crowdchange.dev/1",
"language": "en",
"organization": {
"id": 1,
"name": "Crowdchange",
"custom_id": "CrowdchangeID"
}
},
"user": {
"name": "John Snow",
"first_name": "John",
"last_name": "Snow",
"title": "Mr."
}
}
Cette page vous a-t-elle été utile ?
⌘I