title: SalesForce DocuSign REST API createAndSendenvelope
body: <p>Can anyone give a sample apex code REST API example for createAndSendenvelope. I am using demo DocuSign sandbox and I get INCOMPLETE ENVELOPE error. I do have all the required elements in my envelope, so looking to see what I am missing or if I am not creating it in a correct manner. Below is the json that I pass as request and  I get response: "The Envelope is not Complete. A Complete Envelope Requires Documents, Recipients, Tabs, and a Subject Line. Content-Type does not contain boundary parameter."</p>
  
  <pre><code>--BOUNDARY
  Content-Type: application/json
  Content-Disposition: form-data
  
  {
      "status": "created",
      "recipients": {
          "signers": [{
              "tabs": {
                  "signHeretabs": [{
                      "yPosition": "15",
                      "xPosition": "249",
                      "width": "100",
                      "tablabel": null,
                      "required": "TRUE",
                      "recipientId": "1",
                      "pagenumber": "1",
                      "fontSize": "Size12",
                      "font": "Calibri",
                      "documentid": "1",
                      "anchorYoffset": null,
                      "anchorXOffset": null,
                      "anchorUnits": "pixels",
                      "anchorString": "Sign Here",
                      "anchorIgnoreIfNotPresent": "true"
                  }],
                  "initialsTabs": [{
                      "yPosition": "45",
                      "xPosition": "249",
                      "width": "100",
                      "tablabel": null,
                      "required": "TRUE",
                      "receipientId": "1",
                      "pagenumber": "1",
                      "fontSize": "Size12",
                      "font": "Calibri",
                      "documentId": "1",
                      "anchorYoffset": null,
                      "anchorXOffset": null,
                      "anchorUnits": "pixels",
                      "anchorString": "Initials Here",
                      "anchorIgnoreIfNotPresent": "true"
                  }],
                  "dateSignedTabs": [{
                      "yPosition": "65",
                      "xPosition": "249",
                      "width": "100",
                      "tablabel": null,
                      "required": "TRUE",
                      "receipientid": "1",
                      "pagenumber": "1",
                      "fontSize": "Size12",
                      "font": "Calibri",
                      "documentid": "1",
                      "anchorYoffset": "-5",
                      "anchorXOffset": null,
                      "anchorUnits": "pixels",
                      "anchorString": "Date Signed",
                      "anchorIgnoreIfNotPresent": "true"
                  }]
              },
              "routingorder": "1",
              "rolename": "First Signer",
              "recipientid": "1",
              "name": "Marisol L Testcase",
              "email": "testfd1@gcpa.com"
          }]
      },
      "emailsubject": "TestDocuSign Call",
      "emailBlurb": "Test Email Blurb",
      "documents": [{
          "name": "Name1",
          "fileExtension": ".txt",
          "documentId": "1",
          "documentBase64": null
      }]
  }
  
  --BOUNDARY
  Content-Type: application/octet-stream
  Content-Disposition: file; filename="Name1"; documentid=1
  Content-Transfer-Encoding: base64
  
  VGhpcyBpcyBhIHNhbXBsZSBmaWxlIHVwbG9hZCBmb3IgdGVzdGluZy4=
  --BOUNDARY--
  </code></pre>
  
  <p>Update: I could get rid of the boundary parameter error and now get "The Envelope is not Complete. A Complete Envelope Requires Documents, Recipients, Tabs, and a Subject Line. <strong>Envelope definition missing.</strong>"</p>