1
votes

I'm new to both DocuSign and the Rest API. I'm attempting to familiarize myself with how DocuSign connects and downloads using a custom listener (in PHP) with the API Walkthrough located at http://iodocs.docusign.com/APIWalkthrough/getEnvelopeDocuments. I see that it downloads the PDF and the Certificate, but not the XML. I did a var_dump on the $data in the curl_exec and saw that it was all returned in a string with the XML present. My question is what's the best way to extract the XML data and why doesn't it download the XML file also? I apologize for any ignorance on my part. Thanks for any help and/or direction.

EDIT: My assumption is that it's returning a combined PDF, instead separate files (which is what we want). Is the index "envelopeDocuments" set in the RequestPDF function? In the API code I can't find this.

1
Are you using DocuSign's REST API or the SOAP API? You started your question mentioning REST and you also link to the REST API Walkthroughs, but in your edit you reference the RequestPDF() call, which is from SOAP. - Ergin
Also, you can definitely download the documents individually or in combined fashion. The API Walkthrough that you've linked to does exactly that, is it not working for you? - Ergin

1 Answers

0
votes

The REST API Walkthrough that you have referenced is not related to DocuSign Connect at all. In the DocuSign platform there are two ways to get information about your envelopes - you can pull envelope data every so often, or you can have the envelope data pushed to you as they are completed, declined, etc. The walkthrough that you've referenced is the first method (i.e. it shows how to pull envelope data when you want). DocuSign Connect works in the reverse in that, based on how you configure it, it sends you data as events happen.

For starters, to configure Connect settings login to your account at demo.docusign.net, click your profile icon in the top right, and go to

Preferences -> Connect

On that page you will be able to select on of your Connect configurations (or create one if needed) and then configure for which users you want data pushed, on what events, and other settings.

In terms of setting up your listener, you can use any language that can successfully listen for http events (so your choice of PHP should be fine) but there's just a couple of things you'll need to ensure. For starters, you need to make sure you are listening or the proper port. In the DEMO system you can test on http (port 80) or https (port 443), but please note that in production (www.docusign.net) only https is allowed. Also note that you will not be able to test using a localhost URL. You need a real URL that can be reached from the outside world.

Your best bet for info and getting started is the page from the DocuSign Dev Center which describes Connect and links to it's guide. Please see here for more info:

http://www.docusign.com/developer-center/explore/connect