Chilkat Online Tools

Swift / DocuSign REST API / 14. Created Embedded View

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.

    // {
    //   "returnUrl": "",
    //   "authenticationMethod": "none",
    //   "email": "{{email}}",
    //   "userName": "{{userName}}"
    // }

    let json = CkoJsonObject()
    json.UpdateString("returnUrl", value: "")
    json.UpdateString("authenticationMethod", value: "none")
    json.UpdateString("email", value: "{{email}}")
    json.UpdateString("userName", value: "{{userName}}")

    http.SetRequestHeader("Content-Type", value: "application/json")
    // Adds the "Authorization: Bearer {{accessToken}}" header.
    http.AuthToken = "{{accessToken}}"

    var resp: CkoHttpResponse? = http.PostJson3("{{apiVersion}}/accounts/{{accountId}}/envelopes/{{envelopeId_draft}}/views/recipient_preview", contentType: "application/json", json: json)
    if http.LastMethodSuccess == false {

    resp = nil


Curl Command

curl -X POST
	-H "Content-Type: application/json"
	-H "Authorization: Bearer {{accessToken}}"
	-d '{
    "returnUrl": "",
    "authenticationMethod": "none",
    "email": {{user1_email}},
    "userName": {{user1_name}}

Postman Collection Item JSON

  "name": "14. Created Embedded View",
  "request": {
    "method": "POST",
    "header": [
        "key": "Content-Type",
        "value": "application/json"
        "key": "Authorization",
        "value": "Bearer {{accessToken}}"
    "body": {
      "mode": "raw",
      "raw": "{\n    \"returnUrl\": \"\",\n    \"authenticationMethod\": \"none\",\n    \"email\": {{user1_email}},\n    \"userName\": {{user1_name}}\n}"
    "url": {
      "raw": "{{baseUrl}}/{{apiVersion}}/accounts/{{accountId}}/envelopes/{{envelopeId_draft}}/views/recipient_preview",
      "host": [
      "path": [
    "description": "In this example, we will create an embedded preview of what our recipients see when the envelope is sent out to them."
  "response": [