Chilkat Online Tools

Swift3 / DocuSign REST API / Adds email setting overrides to an envelope.

Back to Collection Items

func chilkatTest() {
    // This example assumes the Chilkat API to have been previously unlocked.
    // See Global Unlock Sample for sample code.

    let http = CkoHttp()!
    var success: Bool

    // 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"
    //     }
    //   ]
    // }

    let json = CkoJsonObject()!
    json.update("replyEmailAddressOverride", value: "sample string 1")
    json.update("replyEmailNameOverride", value: "sample string 2")
    json.update("bccEmailAddresses[0].bccEmailAddressId", value: "sample string 1")
    json.update("bccEmailAddresses[0].email", value: "sample string 2")

    // Adds the "Authorization: Bearer {{accessToken}}" header.
    http.authToken = "{{accessToken}}"
    http.setRequestHeader("Accept", value: "application/json")

    var resp: CkoHttpResponse? = http.postJson3("https://domain.com/v2.1/accounts/{{accountId}}/envelopes/{{envelopeId}}/email_settings", contentType: "application/json", json: json)
    if http.lastMethodSuccess == false {
        print("\(http.lastErrorText!)")
        return
    }

    print("\(resp!.statusCode.intValue)")
    print("\(resp!.bodyStr!)")
    resp = nil

}

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": [
  ]
}