curl --request PATCH \
--url https://prod-api.raisedonors.com/api/Donor/{id}/phone/{phoneId} \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"value": "<string>",
"isPrimary": true,
"isOptedIn": true,
"countryCode": "<string>"
}
'const options = {
method: 'PATCH',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({value: '<string>', isPrimary: true, isOptedIn: true, countryCode: '<string>'})
};
fetch('https://prod-api.raisedonors.com/api/Donor/{id}/phone/{phoneId}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://prod-api.raisedonors.com/api/Donor/{id}/phone/{phoneId}"
payload = {
"value": "<string>",
"isPrimary": True,
"isOptedIn": True,
"countryCode": "<string>"
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)using RestSharp;
var options = new RestClientOptions("https://prod-api.raisedonors.com/api/Donor/{id}/phone/{phoneId}");
var client = new RestClient(options);
var request = new RestRequest("");
request.AddHeader("Authorization", "<api-key>");
request.AddJsonBody("{\n \"value\": \"<string>\",\n \"isPrimary\": true,\n \"isOptedIn\": true,\n \"countryCode\": \"<string>\"\n}", false);
var response = await client.PatchAsync(request);
Console.WriteLine("{0}", response.Content);
<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://prod-api.raisedonors.com/api/Donor/{id}/phone/{phoneId}",
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([
'value' => '<string>',
'isPrimary' => true,
'isOptedIn' => true,
'countryCode' => '<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;
}HttpResponse<String> response = Unirest.patch("https://prod-api.raisedonors.com/api/Donor/{id}/phone/{phoneId}")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"value\": \"<string>\",\n \"isPrimary\": true,\n \"isOptedIn\": true,\n \"countryCode\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://prod-api.raisedonors.com/api/Donor/{id}/phone/{phoneId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"value\": \"<string>\",\n \"isPrimary\": true,\n \"isOptedIn\": true,\n \"countryCode\": \"<string>\"\n}"
response = http.request(request)
puts response.read_bodyconst url = 'https://prod-api.raisedonors.com/api/Donor/{id}/phone/{phoneId}';
const options = {
method: 'PATCH',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({value: '<string>', isPrimary: true, isOptedIn: true, countryCode: '<string>'})
};
fetch(url, options)
.then(res => res.json())
.then(json => console.log(json))
.catch(err => console.error(err));{
"id": 300102,
"donorId": 200234,
"typeDisplay": "Mobile Phone",
"value": "(555) 012-3401",
"secondaryValue": null,
"isPrimary": true,
"isOptedIn": true,
"isValid": true,
"isEmail": false,
"isPhone": true,
"isBounced": false,
"countryCode": "1"
}{
"type": "https://tools.ietf.org/html/rfc7231#section-6.5.1",
"title": "One or more validation errors occurred.",
"status": 400,
"errors": {
"email": [
"A valid email address is required."
],
"lastName": [
"The lastName field is required."
]
},
"instance": "/api/Donor/200234/phone/300102"
}{
"type": "https://tools.ietf.org/html/rfc7235#section-3.1",
"title": "Unauthorized",
"status": 401,
"detail": "The Authorization header is missing, malformed, or carries a token that is expired or revoked.",
"instance": "/api/Donor/{id}/phone/{phoneId}"
}Partially Update a Donor Phone Number
Updates only the phone number fields you send.
curl --request PATCH \
--url https://prod-api.raisedonors.com/api/Donor/{id}/phone/{phoneId} \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"value": "<string>",
"isPrimary": true,
"isOptedIn": true,
"countryCode": "<string>"
}
'const options = {
method: 'PATCH',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({value: '<string>', isPrimary: true, isOptedIn: true, countryCode: '<string>'})
};
fetch('https://prod-api.raisedonors.com/api/Donor/{id}/phone/{phoneId}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://prod-api.raisedonors.com/api/Donor/{id}/phone/{phoneId}"
payload = {
"value": "<string>",
"isPrimary": True,
"isOptedIn": True,
"countryCode": "<string>"
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)using RestSharp;
var options = new RestClientOptions("https://prod-api.raisedonors.com/api/Donor/{id}/phone/{phoneId}");
var client = new RestClient(options);
var request = new RestRequest("");
request.AddHeader("Authorization", "<api-key>");
request.AddJsonBody("{\n \"value\": \"<string>\",\n \"isPrimary\": true,\n \"isOptedIn\": true,\n \"countryCode\": \"<string>\"\n}", false);
var response = await client.PatchAsync(request);
Console.WriteLine("{0}", response.Content);
<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://prod-api.raisedonors.com/api/Donor/{id}/phone/{phoneId}",
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([
'value' => '<string>',
'isPrimary' => true,
'isOptedIn' => true,
'countryCode' => '<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;
}HttpResponse<String> response = Unirest.patch("https://prod-api.raisedonors.com/api/Donor/{id}/phone/{phoneId}")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"value\": \"<string>\",\n \"isPrimary\": true,\n \"isOptedIn\": true,\n \"countryCode\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://prod-api.raisedonors.com/api/Donor/{id}/phone/{phoneId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"value\": \"<string>\",\n \"isPrimary\": true,\n \"isOptedIn\": true,\n \"countryCode\": \"<string>\"\n}"
response = http.request(request)
puts response.read_bodyconst url = 'https://prod-api.raisedonors.com/api/Donor/{id}/phone/{phoneId}';
const options = {
method: 'PATCH',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({value: '<string>', isPrimary: true, isOptedIn: true, countryCode: '<string>'})
};
fetch(url, options)
.then(res => res.json())
.then(json => console.log(json))
.catch(err => console.error(err));{
"id": 300102,
"donorId": 200234,
"typeDisplay": "Mobile Phone",
"value": "(555) 012-3401",
"secondaryValue": null,
"isPrimary": true,
"isOptedIn": true,
"isValid": true,
"isEmail": false,
"isPhone": true,
"isBounced": false,
"countryCode": "1"
}{
"type": "https://tools.ietf.org/html/rfc7231#section-6.5.1",
"title": "One or more validation errors occurred.",
"status": 400,
"errors": {
"email": [
"A valid email address is required."
],
"lastName": [
"The lastName field is required."
]
},
"instance": "/api/Donor/200234/phone/300102"
}{
"type": "https://tools.ietf.org/html/rfc7235#section-3.1",
"title": "Unauthorized",
"status": 401,
"detail": "The Authorization header is missing, malformed, or carries a token that is expired or revoked.",
"instance": "/api/Donor/{id}/phone/{phoneId}"
}value or countryCode — and the rest stay as they are. Returns the updated phone number.Authorizations
JWT Authorization header using the Bearer scheme. Example: "Authorization: Bearer {token}"
Path Parameters
The ID of the donor the phone number belongs to.
The ID of the phone number.
Body
The partial phone number update request.
Represents a partial contact method request for PATCH operations. All properties are optional to allow partial updates.
The type of contact method, such as Email, Phone, or Mobile.
0, 10, 11, 12, 20, 21, 22, 99 The email address or phone number itself.
200Whether this is the donor's primary contact method of its type.
Whether the donor has opted in to being contacted at this value.
The country calling code of a phone number, such as 1 for the United States.
Response
OK
Represents a donor contact method model.
The unique identifier of the contact method.
The unique identifier of the donor.
The type of contact method, such as Email, Phone, or Mobile.
0, 10, 11, 12, 20, 21, 22, 99 The display name of the contact method type.
The email address or phone number itself.
The extension or other secondary part of the value.
Whether this is the donor's primary contact method of its type.
Whether the donor has opted in to being contacted at this value.
Whether the contact method is valid.
Whether the contact method is an email address.
Whether the contact method is a phone number.
Whether email sent to this address has bounced.
The country calling code of the phone number, such as 1 for the United States.
Was this page helpful?