dounue1965 2017-01-06 08:13
浏览 92
已采纳

docusign api不上传docx或doc文件

I am using a demo account. I am connecting through Rest API using PHP to sign documents.

When I am uploading a pdf document it is working fine but when I upload any other type of document it is giving error. Can anyone confirm if the error is due to demo account.

Error I am receiving is:

Fatal error: Uncaught exception 'DocuSign\eSign\ApiException' with message 
[400] Error connecting to the API

I have used the codes displayed in the developer pages.

My code:

// 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);
  • 写回答

1条回答 默认 最新

  • dongli5785 2017-01-07 22:09
    关注

    For file types other than pdf, you need to explicitly set the file type. This is done with the fileExtension field

    Try adding

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

    See docs for the list of supported file types.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥40 复杂的限制性的商函数处理
  • ¥15 程序不包含适用于入口点的静态Main方法
  • ¥15 素材场景中光线烘焙后灯光失效
  • ¥15 请教一下各位,为什么我这个没有实现模拟点击
  • ¥15 执行 virtuoso 命令后,界面没有,cadence 启动不起来
  • ¥50 comfyui下连接animatediff节点生成视频质量非常差的原因
  • ¥20 有关区间dp的问题求解
  • ¥15 多电路系统共用电源的串扰问题
  • ¥15 slam rangenet++配置
  • ¥15 有没有研究水声通信方面的帮我改俩matlab代码