0
votes

First of all - all code on PHP and JS.

I took all user data (sub, base_uri, account_id ) with that documentation https://developers.docusign.com/esign-rest-api/code-examples/config-and-auth at my site using cURL

Now I need send pdf file for that I generate at my site with that access for user sign like I have understood I need that https://developers.docusign.com/esign-rest-api/code-examples/signing-from-your-app and Envelopes: create https://developers.docusign.com/esign-rest-api/reference/Envelopes/Envelopes/create#examples

I send POST request to https://demo.docusign.net/restapi/v2/accounts/{accountId}/envelopes with accountId=account_id from user data, also I send json with user data and doc data in base64 in, but there is nothing, so I don't understand:

  1. How should I call "create" method with POST to https://demo.docusign.net/restapi/v2/accounts/{accountId}/envelopes ?
  2. What Id should I use in {accountId}?
  3. At what format should I send the document for the sign?
  4. Where can I find that doc after create?

Can you show me code example or show documentation with normal examples of POST request for that method.

1
I don't knnow the answer right away - but you could compare with their postman request collection here: docusign.com/blog/dsdev-please-mr-postman - it worked like charm when I tried...Sebastian Rothbucher
Please EDIT your question to include exactly what was returned by DocuSign when you did the POST to create the envelope.Larry K

1 Answers

0
votes

If you are using a demo environment, I believe your authentication url is https://demo.docusign.net/restapi/v2/login_information. For production accounts, since the subdomain can be different you can find the correct baseUrl using a GET request to https://www.docusign.net/restapi/v2/login_information?api_password=true using Postman. This gives you the right baseUrl as well as your authentication information.

Here is how you can create a template using a base64 which is a POST call to {{baseUrl}}/templates

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

Also, if you need to generate more requests make sure you check out the Postman collection that contains different examples as Sebastian mentioned too:

DocuSign Postman Collection