docusign / docusign-esign-php-client

The Official Docusign PHP Client Library used to interact with the eSign REST API. Send, sign, and approve documents using this client.
https://www.docusign.com/devcenter
MIT License
198 stars 123 forks source link

DocuSign populating template fields not working #53

Closed newtek-bneff closed 6 years ago

newtek-bneff commented 6 years ago

I am trying to take one of our tenplates saved in docusign and create en envelope with some Tabs pre-populated, but they keep turning up blank. What am I doing wrong?

Here's my API Call:

POST https://demo.docusign.net/restapi/v2/accounts/*********/envelopes HTTP/1.1

Accept: application/json Accept-Encoding: gzip,deflate,sdch Accept-Language: en-US,en;q=0.8,fa;q=0.6,sv;q=0.4 Cache-Control: no-cache Origin: https://apiexplorer.docusign.com Referer: https://apiexplorer.docusign.com/ User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.132 Safari/537.36 Authorization: Bearer eyJ0eXAiOiJNVCIsImFsZyI6IlJTMjU2Iiwia2lkIjoiNjgxODVmZjEtNGU1MS00Y2U5LWFmMWMtNjg5ODEyMjAzMzE3In0.AQkAAAABAAUABwAAnnShjF7VSAgAAN6Xr89e1UgCAPUDGkyQm1dBup7evMP9LjwNACQAAAA3Y2ZlMzUzZC1jOTFjLTQzMmUtOWE5MC02ZWYwMDFmN2JhN2EVAAEAAAASAAAAAAAYAAEAAAAFAAAAIAAAoCtj9F3VSA.LMVQ1R7MMGDbOn8d5qrPx-4Ovk7lJUgyUYv__INfOzfhCBgLHSv8o5fLhASt_wQAB9btmdr3oez12JsR2gpyLm8ku57bwOI8s_0mJWQCAqT5EMo1pnys68ZbjF_jLQsmpRtWjWyaE4axpU9hz0vU3bu4X7wF8Fb0lQhYjGCmAhV-uAT9s08OD4DUf14bti5rWHaLZ5ikdr8RfAOuqaEk8OUkxJHgLmd9DsDJDDXEnGsHvWOYVcMToY61d63eUMWWakTOqJD5PFPiHsVnlTNZbh2XQGe7tCCjhI4iIniVMwlaN8lDiHTnuL8LnpCRkT3gZRo90iw5rTRDbR8JTB2AYA Content-Length: 517 Content-Type: application/json

{
  "emailSubject": "templateTest",
  "status": "sent",
  "templateId": "d2115bd5-d13e-42b8-ae57-d914ecdcd215",
  "templateRoles": [
    {
      "email": "bneff@newtekone.com",
      "name": "Barnet Neff",
      "roleName": "Customer",
      "tabs": {
        "textTabs": [
          {
            "documentId": "1",
            "pageNumber": "1",
            "tabLabel": "test",
            "value": "Template One",
            "xPosition": "0",
            "yPosition": "0"
          }
        ]
      }
    }
  ]
}

If it helps, here is the tab object in question (its a simple text tab):

  protected 'container' => 
    array (size=48)
      'anchor_case_sensitive' => null
      'anchor_horizontal_alignment' => null
      'anchor_ignore_if_not_present' => null
      'anchor_match_whole_word' => null
      'anchor_string' => null
      'anchor_units' => null
      'anchor_x_offset' => null
      'anchor_y_offset' => null
      'bold' => string 'false' (length=5)
      'conceal_value_on_document' => string 'false' (length=5)
      'conditional_parent_label' => null
      'conditional_parent_value' => null
      'custom_tab_id' => null
      'disable_auto_size' => string 'false' (length=5)
      'document_id' => string '1' (length=1)
      'error_details' => null
      'font' => string 'lucidaconsole' (length=13)
      'font_color' => string 'black' (length=5)
      'font_size' => string 'size9' (length=5)
      'formula' => null
      'height' => int 11
      'is_payment_amount' => string 'false' (length=5)
      'italic' => string 'false' (length=5)
      'locked' => string 'false' (length=5)
      'max_length' => int 4000
      'merge_field' => null
      'name' => null
      'original_value' => string '' (length=0)
      'page_number' => string '1' (length=1)
      'recipient_id' => string '89060912' (length=8)
      'require_all' => string 'false' (length=5)
      'required' => string 'true' (length=4)
      'require_initial_on_shared_change' => string 'false' (length=5)
      'sender_required' => null
      'shared' => string 'false' (length=5)
      'status' => null
      'tab_id' => string 'fa9df7b1-95c5-4bb4-8c9e-fbc5ce953ca6' (length=36)
      'tab_label' => string 'test' (length=4)
      'tab_order' => null
      'template_locked' => string 'false' (length=5)
      'template_required' => string 'false' (length=5)
      'underline' => string 'false' (length=5)
      'validation_message' => string '' (length=0)
      'validation_pattern' => string '' (length=0)
      'value' => string '' (length=0)
      'width' => int 84
      'x_position' => string '198' (length=3)
      'y_position' => string '339' (length=3)
newtek-bneff commented 6 years ago

Nevermind, the issue was that I was looking at the document from the sender perspective, I needed to look from the recipient and it was filled out.

mmallis87 commented 6 years ago

@newtekDev glad you had it figured out. As a side note, it's discouraged to share your bearer token publicly, even if it is a demo token. Happy DocuSigning!

salines commented 5 years ago

Hello, I have same problem.

https://stackoverflow.com/questions/52934613/how-to-post-text-to-template-using-php-sdk

Any Help?