Docusign JSON肥皂要求

发布于 2025-01-24 03:48:09 字数 1319 浏览 4 评论 0 原文

我试图了解如何使用JSON格式化数据发送肥皂请求将其发送到DocuSign。遵循本指南仅适用于PDF:

我在docusign开发人员上创建了一个模板,并下载了它,即JSON格式。

  1. 如何以这种格式发送数据?它是当前存储为DocumentBase64吗?我是否需要将数据转换为PDF,还是将文档字节设置为该值(doc.pdfbytes)?试图做梯子,给我一个肥皂错误: SOAP故障:PDF文件的验证失败。
  2. 最少从JSON退出需要哪些字段?
  3. 是的,我设置了信封,收件人和选项卡。目前,我可以按照签名来发送PDF,而不是JSON格式化的数据。

这是试图提取DocumentBase64数据并将其设置为PDFBYTES字段的示例:

string pdfbytes = json4.value("documentBase64", "oops");
doc->PDFBytes = new xsd__base64Binary();
size_t pdfSize = 0;
// Double conversion to get it to match the datatype for *PDFBytes->ptr*
const unsigned char* t = reinterpret_cast<const unsigned char *>( pdfbytes.c_str() );
unsigned char* y = const_cast<unsigned char*>(t);
doc->PDFBytes->__ptr = y;
doc->PDFBytes->__size = pdfbytes.size();

更新: 解决了我自己的问题。您将需要从DocuSign解码BASE64数据。我使用以下解码器: 更新的代码:

string pdfbytes = json4.value("documentBase64", "oops");
std::string decoded = base64_decode(pdfbytes);

I am trying to understand how to send SOAP requests with JSON formatted data to docusign. Following this guide is only for pdfs:
https://developers.docusign.com/docs/esign-soap-api/how-to/request-signature/

I created a template on docusign developer and downloaded it, which is in json format.

  1. How do I send the data in that format? Is it currently stored as documentBase64, do I need to convert it the data to a PDF, or just set the documents bytes to that value (doc.PDFBytes)? Attempting to do the ladder, gives me a soap error:
    Soap Fault: The validation of the PDF file failed.
  2. What fields are required to pull out of the json at minimum?
  3. Yes, I have the envelope, recipient and tabs set up. I currently am able to send PDFs as is to get signed, just not json formatted data.

Here is an example of attempting to pull out the documentbase64 data and set it to the pdfbytes field:

string pdfbytes = json4.value("documentBase64", "oops");
doc->PDFBytes = new xsd__base64Binary();
size_t pdfSize = 0;
// Double conversion to get it to match the datatype for *PDFBytes->ptr*
const unsigned char* t = reinterpret_cast<const unsigned char *>( pdfbytes.c_str() );
unsigned char* y = const_cast<unsigned char*>(t);
doc->PDFBytes->__ptr = y;
doc->PDFBytes->__size = pdfbytes.size();

UPDATE:
Solved my own problem. You will need to decode your base64 data from docusign. I used the following decoder:
https://renenyffenegger.ch/notes/development/Base64/Encoding-and-decoding-base-64-with-cpp/
Updated code:

string pdfbytes = json4.value("documentBase64", "oops");
std::string decoded = base64_decode(pdfbytes);

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

薄暮涼年 2025-01-31 03:48:09

除非您有充分的理由,否则我强烈建议您考虑使用 docuSign 而不是 docusign eSignature soap api api

并非每个功能都由SOAP API支持。

您可以使用 https://github.com/jgaa/restc-cpp 来自C ++代码库的调用。

另外,请记住,API中发送的文档必须是基本64编码。这是用于休息和肥皂的。

Unless you have a really good reason, I highly recommend you consider using the DocuSign eSignature REST API and not the DocuSign eSignature SOAP API.

Not every feature is supported by the SOAP API.

You could use https://github.com/jgaa/restc-cpp to make REST API calls from a C++ codebase.

Also, remember that documents sent in the API has to be base64 encoded. This goes for both REST and SOAP.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文