Commitments
Edit multiple commitments
PATCH
/
admin
/
commitments
Edit multiple commitments
curl --request PATCH \
--url https://api.helpyousponsor.com/v1/admin/commitments \
--header 'Content-Type: application/json' \
--header 'X-HYS-API-Key: <api-key>' \
--data '
{
"donor_entity_ids": "[1, 2, 3]",
"values": {
"frequency": "1",
"until": "2022-12-31",
"method": "1",
"amount": "100.00",
"next": "2022-01-31"
}
}
'import requests
url = "https://api.helpyousponsor.com/v1/admin/commitments"
payload = {
"donor_entity_ids": "[1, 2, 3]",
"values": {
"frequency": "1",
"until": "2022-12-31",
"method": "1",
"amount": "100.00",
"next": "2022-01-31"
}
}
headers = {
"X-HYS-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {'X-HYS-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
donor_entity_ids: '[1, 2, 3]',
values: {
frequency: '1',
until: '2022-12-31',
method: '1',
amount: '100.00',
next: '2022-01-31'
}
})
};
fetch('https://api.helpyousponsor.com/v1/admin/commitments', 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.helpyousponsor.com/v1/admin/commitments",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'donor_entity_ids' => '[1, 2, 3]',
'values' => [
'frequency' => '1',
'until' => '2022-12-31',
'method' => '1',
'amount' => '100.00',
'next' => '2022-01-31'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-HYS-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.helpyousponsor.com/v1/admin/commitments"
payload := strings.NewReader("{\n \"donor_entity_ids\": \"[1, 2, 3]\",\n \"values\": {\n \"frequency\": \"1\",\n \"until\": \"2022-12-31\",\n \"method\": \"1\",\n \"amount\": \"100.00\",\n \"next\": \"2022-01-31\"\n }\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("X-HYS-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.patch("https://api.helpyousponsor.com/v1/admin/commitments")
.header("X-HYS-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"donor_entity_ids\": \"[1, 2, 3]\",\n \"values\": {\n \"frequency\": \"1\",\n \"until\": \"2022-12-31\",\n \"method\": \"1\",\n \"amount\": \"100.00\",\n \"next\": \"2022-01-31\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.helpyousponsor.com/v1/admin/commitments")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["X-HYS-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"donor_entity_ids\": \"[1, 2, 3]\",\n \"values\": {\n \"frequency\": \"1\",\n \"until\": \"2022-12-31\",\n \"method\": \"1\",\n \"amount\": \"100.00\",\n \"next\": \"2022-01-31\"\n }\n}"
response = http.request(request)
puts response.read_body{
"message": "Successful"
}{
"message": "Error",
"errors": {}
}⌘I
Edit multiple commitments
curl --request PATCH \
--url https://api.helpyousponsor.com/v1/admin/commitments \
--header 'Content-Type: application/json' \
--header 'X-HYS-API-Key: <api-key>' \
--data '
{
"donor_entity_ids": "[1, 2, 3]",
"values": {
"frequency": "1",
"until": "2022-12-31",
"method": "1",
"amount": "100.00",
"next": "2022-01-31"
}
}
'import requests
url = "https://api.helpyousponsor.com/v1/admin/commitments"
payload = {
"donor_entity_ids": "[1, 2, 3]",
"values": {
"frequency": "1",
"until": "2022-12-31",
"method": "1",
"amount": "100.00",
"next": "2022-01-31"
}
}
headers = {
"X-HYS-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {'X-HYS-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
donor_entity_ids: '[1, 2, 3]',
values: {
frequency: '1',
until: '2022-12-31',
method: '1',
amount: '100.00',
next: '2022-01-31'
}
})
};
fetch('https://api.helpyousponsor.com/v1/admin/commitments', 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.helpyousponsor.com/v1/admin/commitments",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'donor_entity_ids' => '[1, 2, 3]',
'values' => [
'frequency' => '1',
'until' => '2022-12-31',
'method' => '1',
'amount' => '100.00',
'next' => '2022-01-31'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-HYS-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.helpyousponsor.com/v1/admin/commitments"
payload := strings.NewReader("{\n \"donor_entity_ids\": \"[1, 2, 3]\",\n \"values\": {\n \"frequency\": \"1\",\n \"until\": \"2022-12-31\",\n \"method\": \"1\",\n \"amount\": \"100.00\",\n \"next\": \"2022-01-31\"\n }\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("X-HYS-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.patch("https://api.helpyousponsor.com/v1/admin/commitments")
.header("X-HYS-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"donor_entity_ids\": \"[1, 2, 3]\",\n \"values\": {\n \"frequency\": \"1\",\n \"until\": \"2022-12-31\",\n \"method\": \"1\",\n \"amount\": \"100.00\",\n \"next\": \"2022-01-31\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.helpyousponsor.com/v1/admin/commitments")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["X-HYS-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"donor_entity_ids\": \"[1, 2, 3]\",\n \"values\": {\n \"frequency\": \"1\",\n \"until\": \"2022-12-31\",\n \"method\": \"1\",\n \"amount\": \"100.00\",\n \"next\": \"2022-01-31\"\n }\n}"
response = http.request(request)
puts response.read_body{
"message": "Successful"
}{
"message": "Error",
"errors": {}
}
