two part question:
We are trying to get a notification that the document is ready to sign (that we are not completely clear from what is indicated in the notification). We do not want to make email notifications; we want to disable them. We assume that information for embedded signing is contained in a notification other than email. Is there an easy way to send a push notification to another program that says the document is ready to be sent, and if so, is this the best way to track the notification in order to sign the POST API and request information from DocuSign?
In our testing, we managed to get an embedded signature URL with an API call, but it will lead us to a page in the signature view, where tabs are not displayed; this means that the signer cannot sign, as for other roles. The same problem is explained in this SO post, for the most part. I code in JavaScript, not PHP. I do not know if this will be relevant for answering the question, if so, please ask more questions in the comments and I can provide additional information.
This is what we get, but we should get a document with signature tabs in it
This is what we should see. We see this version when manually entering DS and clicking on a document.
We believe that the templateRoleName field may be the cause of this problem, but we tested it without it, and it does not seem to matter.
This is the JS file for calling the API, which we use from the walkthroughs.
// // to run this sample // 1. copy the file in your own directory - say, example.js // 2. change "***" to appropriate values // 3. install async and request packages // npm install async // npm install request // 4. execute // node example.js // var async = require("async"), // async module request = require("request"), // request module email = " email@email.com ", // your account email password = "password1", // your account password integratorKey = "DEEZ-010ebc24-01cc-143a-98c3-d9dbf7561cb1", // your account Integrator Key (found on Preferences -> API page) recipientName = " email@email.com ", // recipient (signer) name templateId = "1C504DBA-B03F-4E57-B6BB-FD2ABD15837C", // provide valid templateId from a template in your account templateRoleName = "Signer", // template role that exists on template referenced above baseUrl = "", // we will retrieve this envelopeId = "bc14310c-57c0-4168-91be-1fb71ea24c1c"; // created from step 2 async.waterfall( [ ////////////////////////////////////////////////////////////////////// // Step 1 - Login (used to retrieve accountId and baseUrl) ////////////////////////////////////////////////////////////////////// function(next) { var url = "https://demo.docusign.net/restapi/v2/login_information"; var body = ""; // no request body for login api call // set request url, method, body, and headers var options = initializeRequest(url, "GET", body, email, password); // send the request... request(options, function(err, res, body) { if(!parseResponseBody(err, res, body)) { return; } baseUrl = JSON.parse(body).loginAccounts[0].baseUrl; next(null); // call next function }); }, ////////////////////////////////////////////////////////////////////// // Step 2 - Send envelope with one Embedded recipient (using clientUserId property) ////////////////////////////////////////////////////////////////////// function(next) { var url = baseUrl + "/envelopes"; var body = JSON.stringify({ "emailSubject": "DocuSign API call - Embedded Sending Example", "templateId": templateId, "templateRoles": [{ "email": email, "name": recipientName, "roleName": templateRoleName, "clientUserId": "1001" // user-configurable }], "status": "sent" }); // set request url, method, body, and headers var options = initializeRequest(url, "POST", body, email, password); // send the request... request(options, function(err, res, body) { if(!parseResponseBody(err, res, body)) { return; } // parse the envelopeId value from the response envelopeId = JSON.parse(body).envelopeId; next(null); // call next function }); }, ////////////////////////////////////////////////////////////////////// // Step 3 - Get the Embedded Signing View (aka the recipient view) ////////////////////////////////////////////////////////////////////// function(next) { var url = baseUrl + "/envelopes/" + envelopeId + "/views/recipient"; var method = "POST"; var body = JSON.stringify({ "returnUrl": "http://www.docusign.com/devcenter", "authenticationMethod": "email", "email": email, "userName": recipientName, "clientUserId": "1001", // must match clientUserId in step 2! }); // set request url, method, body, and headers var options = initializeRequest(url, "POST", body, email, password); // send the request... request(options, function(err, res, body) { if(!parseResponseBody(err, res, body)) return; else console.log("\nNavigate to the above URL to start the Embedded Signing workflow..."); }); } ]); //*********************************************************************************************** // --- HELPER FUNCTIONS --- //*********************************************************************************************** function initializeRequest(url, method, body, email, password) { var options = { "method": method, "uri": url, "body": body, "headers": {} }; addRequestHeaders(options, email, password); return options; } /////////////////////////////////////////////////////////////////////////////////////////////// function addRequestHeaders(options, email, password) { // JSON formatted authentication header (XML format allowed as well) dsAuthHeader = JSON.stringify({ "Username": email, "Password": password, "IntegratorKey": integratorKey // global }); // DocuSign authorization header options.headers["X-DocuSign-Authentication"] = dsAuthHeader; } /////////////////////////////////////////////////////////////////////////////////////////////// function parseResponseBody(err, res, body) { console.log("\r\nAPI Call Result: \r\n", JSON.parse(body)); if( res.statusCode != 200 && res.statusCode != 201) { // success statuses console.log("Error calling webservice, status is: ", res.statusCode); console.log("\r\n", err); return false; } return true; }
EDIT
This is the recipients and routing section from the classic DocuSign view for this template, since it was the original posting of this question
This is the Created_RequestRecipientToken file from the query log:
POST https://demo.docusign.net:7802/restapi/v2/accounts/1037192/envelopes/deez83c9-b1fg-46ab-bo0c-e4576d952ac6/views/recipient Content-Length: 185 Connection: keep-alive Host: demo.docusign.net X-DocuSign-Authentication: {"Username":" sender@email.com ","Password":"[omitted]","IntegratorKey":"[omitted]"} X-Forwarded-For: 543.155.155.55 {"returnUrl":"http://www.docusign.com/devcenter","authenticationMethod":"email","email":" sender@email.com ","userName":" signer@email.com ","clientUserId":"1002"} 201 Created Content-Type: application/json; charset=utf-8 { "url": "https://demo.docusign.net/Signing/startinsession.aspx?t=3c06d2a3-e521-4e52-b669-01e24c81c3bf" }
This is the Created_CreateEnvelopeFromTemplateAndForms file from the query log:
POST https://demo.docusign.net:7802/restapi/v2/accounts/1037192/envelopes Content-Length: 272 Connection: keep-alive Host: demo.docusign.net X-DocuSign-Authentication: {"Username":" sender@email.com ","Password":"[omitted]","IntegratorKey":"[omitted]"} X-Forwarded-For: 143.115.155.55 {"emailSubject":"DocuSign API call - Embedded Sending Example","templateId":"9AF271E2-D38E-4E61-8083-928A3CCE056C", "templateRoles":[{"email":" sender@email.com ","name":" signer@email.com ","roleName":"Signer","clientUserId":"1002"}], "status":"sent"} 201 Created Content-Type: application/json; charset=utf-8 { "envelopeId": "deez83c9-b1fg-46ab-bo0c-e4576d952ac6", "uri": "/envelopes/deez83c9-b1fg-46ab-bo0c-e4576d952ac6", "statusDateTime": "2015-07-08T15:56:23.5930000Z", "status": "sent" }
this or this or this is not the solution to this position.