cURL
curl -X POST \
/customers/{customerId}/email-addresses \
--header "Content-Type: application/json" \
--header "Authorization: Bearer <token>" \
--data '{
"email": "john.doe@example.com",
"receiverName": "John Doe"
}'import requests
url = "https://coreapi.io/customers/{customerId}/email-addresses"
payload = {
"email": "john.doe@example.com",
"receiverName": "John Doe",
"isInvoiceEmail": False,
"isDunningEmail": False,
"isDefault": False
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
email: 'john.doe@example.com',
receiverName: 'John Doe',
isInvoiceEmail: false,
isDunningEmail: false,
isDefault: false
})
};
fetch('https://coreapi.io/customers/{customerId}/email-addresses', 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://coreapi.io/customers/{customerId}/email-addresses",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'email' => 'john.doe@example.com',
'receiverName' => 'John Doe',
'isInvoiceEmail' => false,
'isDunningEmail' => false,
'isDefault' => false
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}{
"email": "john.doe@example.com",
"receiverName": "John Doe",
"id": "00000000-0000-0000-0000-000000000000",
"isInvoiceEmail": true,
"isDunningEmail": false,
"default": "true"
}Email
Create customer email address
Create customer email address
Required permissions:customer:writePOST
/
customers
/
{customerId}
/
email-addresses
cURL
curl -X POST \
/customers/{customerId}/email-addresses \
--header "Content-Type: application/json" \
--header "Authorization: Bearer <token>" \
--data '{
"email": "john.doe@example.com",
"receiverName": "John Doe"
}'import requests
url = "https://coreapi.io/customers/{customerId}/email-addresses"
payload = {
"email": "john.doe@example.com",
"receiverName": "John Doe",
"isInvoiceEmail": False,
"isDunningEmail": False,
"isDefault": False
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
email: 'john.doe@example.com',
receiverName: 'John Doe',
isInvoiceEmail: false,
isDunningEmail: false,
isDefault: false
})
};
fetch('https://coreapi.io/customers/{customerId}/email-addresses', 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://coreapi.io/customers/{customerId}/email-addresses",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'email' => 'john.doe@example.com',
'receiverName' => 'John Doe',
'isInvoiceEmail' => false,
'isDunningEmail' => false,
'isDefault' => false
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}{
"email": "john.doe@example.com",
"receiverName": "John Doe",
"id": "00000000-0000-0000-0000-000000000000",
"isInvoiceEmail": true,
"isDunningEmail": false,
"default": "true"
}Autorisierungen
Body
application/jsontext/html
The new CustomerEmail resource
Antwort
CustomerEmail resource created
War diese Seite hilfreich?