Back to Collection Items
        import com.chilkatsoft.*;
public class ChilkatExample {
  static {
    try {
        System.loadLibrary("chilkat");
    } catch (UnsatisfiedLinkError e) {
      System.err.println("Native code library failed to load.\n" + e);
      System.exit(1);
    }
  }
  public static void main(String argv[])
  {
    // This example assumes the Chilkat API to have been previously unlocked.
    // See Global Unlock Sample for sample code.
    CkHttp http = new CkHttp();
    boolean success;
    // 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": "http://httpbin.org/get",
    //   "authenticationMethod": "none",
    //   "email": "{{email}}",
    //   "userName": "{{userName}}"
    // }
    CkJsonObject json = new CkJsonObject();
    json.UpdateString("returnUrl","http://httpbin.org/get");
    json.UpdateString("authenticationMethod","none");
    json.UpdateString("email","{{email}}");
    json.UpdateString("userName","{{userName}}");
    // Adds the "Authorization: Bearer {{accessToken}}" header.
    http.put_AuthToken("{{accessToken}}");
    CkHttpResponse resp = new CkHttpResponse();
    success = http.HttpJson("POST","https://domain.com/{{apiVersion}}/accounts/{{accountId}}/envelopes/{{envelopeId_draft}}/views/recipient_preview",json,"application/json",resp);
    if (success == false) {
        System.out.println(http.lastErrorText());
        return;
        }
    System.out.println(resp.get_StatusCode());
    System.out.println(resp.bodyStr());
  }
}
        Curl Command
        curl -X POST
	-H "Authorization: Bearer {{accessToken}}"
	-d '{
    "returnUrl": "http://httpbin.org/get",
    "authenticationMethod": "none",
    "email": {{user1}},
    "userName": {{user1_name}}
}'
https://domain.com/{{apiVersion}}/accounts/{{accountId}}/envelopes/{{envelopeId_draft}}/views/recipient_preview
        Postman Collection Item JSON
        {
  "name": "14. Created Embedded View",
  "request": {
    "method": "POST",
    "header": [
      {
        "key": "Authorization",
        "value": "Bearer {{accessToken}}"
      }
    ],
    "body": {
      "mode": "raw",
      "raw": "{\n    \"returnUrl\": \"http://httpbin.org/get\",\n    \"authenticationMethod\": \"none\",\n    \"email\": {{user1}},\n    \"userName\": {{user1_name}}\n}"
    },
    "url": {
      "raw": "{{baseUrl}}/{{apiVersion}}/accounts/{{accountId}}/envelopes/{{envelopeId_draft}}/views/recipient_preview",
      "host": [
        "{{baseUrl}}"
      ],
      "path": [
        "{{apiVersion}}",
        "accounts",
        "{{accountId}}",
        "envelopes",
        "{{envelopeId_draft}}",
        "views",
        "recipient_preview"
      ]
    },
    "description": "In this example, we will create an embedded preview of what our recipients see when the envelope is sent out to them."
  },
  "response": [
  ]
}