Php docusign api不上载docx或doc文件

Php docusign api不上载docx或doc文件,php,docusignapi,Php,Docusignapi,我正在使用一个演示帐户。 我使用PHP通过restapi连接文档 当我上传pdf文档时,它工作正常,但当我上传任何其他类型的文档时,它会给出错误。是否有人可以确认错误是由于演示帐户 我收到的错误是: Fatal error: Uncaught exception 'DocuSign\eSign\ApiException' with message [400] Error connecting to the API 我使用了开发者页面中显示的代码 我的代码: // configure the

我正在使用一个演示帐户。 我使用
PHP
通过restapi连接文档

当我上传
pdf
文档时,它工作正常,但当我上传任何其他类型的文档时,它会给出错误。是否有人可以确认错误是由于演示帐户

我收到的错误是:

Fatal error: Uncaught exception 'DocuSign\eSign\ApiException' with message 
[400] Error connecting to the API
我使用了开发者页面中显示的代码

我的代码:

// configure the document we want signed 
$documentFileName = "/test/Docs/test.docx"; 

// working for test.pdf 
$documentName = "test.pdf"; 
// instantiate a new envelopeApi object 
$envelopeApi = new DocuSign\eSign\Api\EnvelopesApi($apiClient); 
// Add a document to the envelope 
$document = new DocuSign\eSign\Model\Document(); 
$document->setDocumentBase64(base64_encode(file_get_contents‌​(DIR . $documentFileName))); 
$document->setName($documentName);

对于pdf以外的文件类型,需要显式设置文件类型。这是通过
fileExtension
字段完成的

尝试添加

$document->setFileExtension("docx"); // Word docx file

请参阅。

对于pdf以外的文件类型,您需要明确设置文件类型。这是通过
fileExtension
字段完成的

尝试添加

$document->setFileExtension("docx"); // Word docx file

请参阅。

My code://配置我们要签名的文档$documentFileName=“/test/Docs/test.docx”//为test.pdf工作$documentName=“test.pdf”//实例化一个新的envelopeApi对象$envelopeApi=new DocuSign\eSign\Api\EnvelopesApi($apiClient);//将文档添加到信封$document=new DocuSign\eSign\Model\document()$document->setDocumentBase64(base64编码(文件获取内容(DIR.$documentFileName))$文档->设置名称($documentName);注意:您可以编辑自己的问题以添加其他信息,如代码示例欢迎使用stackoverflow!记住检查(接受)你自己问题的最佳答案。并向上投票所有有用的答案,包括对其他人问题的答案。My code://配置我们想要签名的文档$documentFileName=“/test/Docs/test.docx”//为test.pdf工作$documentName=“test.pdf”//实例化一个新的envelopeApi对象$envelopeApi=new DocuSign\eSign\Api\EnvelopesApi($apiClient);//将文档添加到信封$document=new DocuSign\eSign\Model\document()$document->setDocumentBase64(base64编码(文件获取内容(DIR.$documentFileName))$文档->设置名称($documentName);注意:您可以编辑自己的问题以添加其他信息,如代码示例欢迎使用stackoverflow!记住检查(接受)你自己问题的最佳答案。并投票选出所有有用的答案,包括对他人问题的答案。