【问题标题】:POST request to Envelopes:create method对 Envelopes:create 方法的 POST 请求
【发布时间】:2018-06-19 10:17:34
【问题描述】:

首先 - PHP 和 JS 上的所有代码。

我使用 cURL 在我的站点上使用该文档 https://developers.docusign.com/esign-rest-api/code-examples/config-and-auth 获取了所有用户数据(sub、base_uri、account_id)

现在我需要发送我在我的站点上生成的 pdf 文件,该文件具有用户签名的访问权限,就像我理解的那样,我需要 https://developers.docusign.com/esign-rest-api/code-examples/signing-from-your-app 和信封:创建 https://developers.docusign.com/esign-rest-api/reference/Envelopes/Envelopes/create#examples

我从用户数据向https://demo.docusign.net/restapi/v2/accounts/{accountId}/envelopes 发送带有 accountId=account_id 的 POST 请求,我还发送带有用户数据的 json 和 base64 中的 doc 数据,但是什么都没有,所以我不明白:

  1. 我应该如何使用 POST 调用“create”方法到 https://demo.docusign.net/restapi/v2/accounts/{accountId}/envelopes ?
  2. 我应该在 {accountId} 中使用什么 ID?
  3. 我应该以什么格式发送标志文件?
  4. 创建后在哪里可以找到该文档?

您能否向我展示代码示例或带有该方法的 POST 请求的普通示例的文档。

【问题讨论】:

  • 我不知道答案 - 但你可以在这里与他们的邮递员请求集合进行比较:docusign.com/blog/dsdev-please-mr-postman - 当我尝试时它就像魅力一样......
  • 请编辑您的问题,以准确包含 DocuSign 在您执行 POST 创建信封时返回的内容。

标签: docusignapi


【解决方案1】:

如果您使用的是演示环境,我相信您的身份验证 url 是https://demo.docusign.net/restapi/v2/login_information。对于生产帐户,由于子域可能不同,您可以使用 Postman 对 https://www.docusign.net/restapi/v2/login_information?api_password=true 的 GET 请求找到正确的 baseUrl。这将为您提供正确的 baseUrl 以及您的身份验证信息。

以下是使用 base64 创建模板的方法,该模板是 POST{{baseUrl}}/templates 的调用

{
  "documents": [
    {
      "documentBase64": "<insert encoded base64 here",
      "documentId": "1",
      "name": "blank1.pdf"
    }
  ],
  "envelopeTemplateDefinition": {}
}

此外,如果您需要生成更多请求,请务必查看包含 Sebastian 提到的不同示例的 Postman 集合:

DocuSign Postman Collection

【讨论】:

  • 嗨@Payf1 如果使用 OAuth 身份验证,您的答案不正确。如果使用 OAuth 身份验证,则从 API 调用OAuth::UserInfo 获取用户的 accountId 和基本路径
  • 是的。如果您使用的是旧式标头身份验证,则此方法有效
猜你喜欢
  • 1970-01-01
  • 2019-06-27
  • 1970-01-01
  • 2017-03-07
  • 2023-04-02
  • 2019-05-07
  • 2017-11-03
相关资源
最近更新 更多