DocuSign REST API - Convert PDF form fields into DocuSign Secure field - Not Working

余生长醉 提交于 2020-01-05 07:37:38

问题


I am using DocuSign REST API for send document for sign. I am using Php Rest Docusign Api class. I want Convert PDF form fields into DocuSign Secure field. I have setdocumenttransformPdfFields as true as per DocuSign Rest Api guide on https://www.docusign.com/p/RESTAPIGuide/Content/REST%20API%20References/Document%20Parameters.htm.

I am sending following information as CURLOPT_POSTFIELDS. My Sending pdf test1.pdf have already eSignSignHere adobe text field. If I try same pdf file from Docusign website, It is working fine. I have tried also with Signature field.

--myboundary
Content-Type: application/json
Content-Disposition: form-data
{  
   "emailSubject":"Doc Subject",
   "emailBlurb":"Doc Blurb",
   "documents":[  
      {  
         "name":"test1.pdf",
         "documentId":"1",
         "transformPdfFields":"true"
      }
   ],
   "status":"sent",
   "recipients":{  
      "signers":[  
         {  
            "routingOrder":"1",
            "recipientId":"1",
            "name":"support",
            "email":"support@varshaawebteam.com",
            "clientUserId":null,
            "defaultRecipient":true
         }
      ]
   }
}
--myboundary
Content-Type:application/pdf
Content-Disposition: file; filename="test1.pdf"; documentid=1

%PDF-1.6
%âãÏÓ
--All Pdf Binary Data here—
%%EOF

--myboundary--

Curl Call with this data gives result also as following:

stdClass Object ( [envelopeId] => 46915426-740a-4ea3-8e68-47843568dadc
[uri] => /envelopes/46915426-740a-4ea3-8e68-47843568dadc [statusDateTime]
=> 2014-12-11T11:20:02.2700000Z [status] => sent )

回答1:


You can get this working with composite templates. Here is some sample JSON that would replace your existing JSON.

{
    "emailSubject": "Doc Subject",
    "emailBlurb": "Doc Blurb",
    "status": "sent",
    "compositeTemplates": [
        {
            "inlineTemplates": [
                {
                    "sequence": "1",
                    "recipients": {
                        "signers": [
                            {
                                "email": "support@varshaawebteam.com",
                                "name": "support",
                                "recipientId": "1",
                                "defaultRecipient": "true",
                            }
                        ]
                    }
                }
            ],
            "document": {
                "name": "test1.pdf",
                "documentId": "1",
                "transformPdfFields": "true"
            }
        }
    ]
}

Documentation for composite REST templates can be found here: DocuSign REST v2 API Guide - Composite Templates



来源:https://stackoverflow.com/questions/27636511/docusign-rest-api-convert-pdf-form-fields-into-docusign-secure-field-not-wor

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!