C / DocuSign REST API / Adds email setting overrides to an envelope.
Back to Collection Items
#include <C_CkHttp.h>
#include <C_CkJsonObject.h>
#include <C_CkHttpResponse.h>
void ChilkatSample(void)
{
HCkHttp http;
BOOL success;
HCkJsonObject json;
HCkHttpResponse resp;
// This example assumes the Chilkat API to have been previously unlocked.
// See Global Unlock Sample for sample code.
http = CkHttp_Create();
// Use this online tool to generate code from sample JSON: Generate Code to Create JSON
// The following JSON is sent in the request body.
// {
// "replyEmailAddressOverride": "sample string 1",
// "replyEmailNameOverride": "sample string 2",
// "bccEmailAddresses": [
// {
// "bccEmailAddressId": "sample string 1",
// "email": "sample string 2"
// }
// ]
// }
json = CkJsonObject_Create();
CkJsonObject_UpdateString(json,"replyEmailAddressOverride","sample string 1");
CkJsonObject_UpdateString(json,"replyEmailNameOverride","sample string 2");
CkJsonObject_UpdateString(json,"bccEmailAddresses[0].bccEmailAddressId","sample string 1");
CkJsonObject_UpdateString(json,"bccEmailAddresses[0].email","sample string 2");
// Adds the "Authorization: Bearer {{accessToken}}" header.
CkHttp_putAuthToken(http,"{{accessToken}}");
CkHttp_SetRequestHeader(http,"Accept","application/json");
resp = CkHttp_PostJson3(http,"https://domain.com/v2.1/accounts/{{accountId}}/envelopes/{{envelopeId}}/email_settings","application/json",json);
if (CkHttp_getLastMethodSuccess(http) == FALSE) {
printf("%s\n",CkHttp_lastErrorText(http));
CkHttp_Dispose(http);
CkJsonObject_Dispose(json);
return;
}
printf("%d\n",CkHttpResponse_getStatusCode(resp));
printf("%s\n",CkHttpResponse_bodyStr(resp));
CkHttpResponse_Dispose(resp);
CkHttp_Dispose(http);
CkJsonObject_Dispose(json);
}
Curl Command
curl -X POST
-H "Accept: application/json"
-H "Authorization: Bearer {{accessToken}}"
-d '{
"replyEmailAddressOverride": "sample string 1",
"replyEmailNameOverride": "sample string 2",
"bccEmailAddresses": [
{
"bccEmailAddressId": "sample string 1",
"email": "sample string 2"
}
]
}'
https://domain.com/v2.1/accounts/{{accountId}}/envelopes/{{envelopeId}}/email_settings
Postman Collection Item JSON
{
"name": "Adds email setting overrides to an envelope.",
"request": {
"method": "POST",
"header": [
{
"key": "Accept",
"value": "application/json"
},
{
"key": "Authorization",
"value": "Bearer {{accessToken}}"
}
],
"body": {
"mode": "raw",
"raw": "{\n \"replyEmailAddressOverride\": \"sample string 1\",\n \"replyEmailNameOverride\": \"sample string 2\",\n \"bccEmailAddresses\": [\n {\n \"bccEmailAddressId\": \"sample string 1\",\n \"email\": \"sample string 2\"\n }\n ]\n}"
},
"url": {
"raw": "{{baseUrl}}/v2.1/accounts/{{accountId}}/envelopes/{{envelopeId}}/email_settings",
"host": [
"{{baseUrl}}"
],
"path": [
"v2.1",
"accounts",
"{{accountId}}",
"envelopes",
"{{envelopeId}}",
"email_settings"
],
"variable": [
{
"key": "accountId",
"value": "{{accountId}}"
},
{
"key": "envelopeId",
"value": "{{envelopeId}}"
}
]
},
"description": "Adds email override settings, changing the email address to reply to an email address, name, or the BCC for email archive information, for the envelope. Note that adding email settings will only affect email communications that occur after the addition was made.\n\n### Important: The BCC Email address feature is designed to provide a copy of all email communications for external archiving purposes. DocuSign recommends that envelopes sent using the BCC for Email Archive feature, including the BCC Email Override option, include additional signer authentication options. To send a copy of the envelope to a recipient who does not need to sign, use a Carbon Copies or Certified Deliveries Recipient Type."
},
"response": [
]
}