4

We are currently experiencing some technical difficulties whilst developing an integrated web solution using docusign. Can you advise on the following please:

  1. How do we assign an order of signing to recipients on a document based rest api call? Can we have a json example?

  2. We are currently unable to retrieve a signing url for a user that has been added to a created envelope. This code was previously working for Template based envelope creation but does not work for ones based on using PDFs.

The call and response to the docusign API (with the password removed) is shown below. Two kinds of authentication method have been tried which failed. Retrieval via either of the emails found in the envelope also fails.

POST \\https://demo.docusign.net/restapi/v2/accounts/426142/envelopes/3b2d7418-27d3-4a80-8969-d875b6fb9548/views/recipient HTTP/1.1 
X-DocuSign-Authentication: {"Username":"18f90756-70b1-4f5f-b360-48b198a17215","Password":"*REMOVED*","IntegratorKey":"*REMOVED*"} 
Accept: application/json, application/xml, text/json, text/x-json, text/javascript, text/xml  
Content-Type: application/json 
Host: demo.docusign.net<http://demo.docusign.net> 
Content-Length: 128 
Accept-Encoding: gzip, deflate 

{
    "authenticationMethod": "email",
    "userName": "Simon",
    "email": "test@email",
    "returnUrl": "http://www.google.com"
} 

HTTP/1.1 400 Bad Request 
Cache-Control: no-cache 
Content-Length: 274 
Content-Type: application/json; charset=utf-8 
Date: Fri, 24 Jan 2014 12:11:38 GMT 
Strict-Transport-Security: max-age=7776000; includeSubDomains 

{ 
"errorCode": "UNKNOWN_ENVELOPE_RECIPIENT", 
"message": "The recipient you have identified is not a valid recipient of the specified envelope. Envelope recipient could not be determined. 'clientUserId', 'email', or 'userName' in request and envelope may not match." 
} 
janw
  • 8,758
  • 11
  • 40
  • 62
WTP API
  • 546
  • 3
  • 16

1 Answers1

9

First, regarding specifying order of recipients, this is simply done by setting the routingOrder property for each recipient. For example, this sample JSON shows a recipients structure that specifies John should receive the Envelope first (routingOrder=1) and Jane should receive the Envelope second (routingOrder=2):

"recipients": {
    "signers": [
        {
            "name": "John Doe",
            "email": "johnsemail@outlook.com",
            "recipientId": "1",
            "routingOrder": "1",
        },
        {
            "name": "Jane Smith",
            "email": "janesemail@outlook.com",
            "recipientId": "2",
            "routingOrder": "2",
        }
    ]
}

The "UNKNOWN_ENVELOPE_RECIPIENT" error message that you're receiving in response to the POST Recipient View request simply means that the recipient information you're supplying doesn't (exactly/completely) match info for any of the recipients in the Envelope you're specifying.

First, keep in mind that if you're wanting to use the POST Recipient View call to retrieve the URL that can be used to launch the recipient's signing session, then BOTH the Create Envelope request AND the POST Recipient View request must include the (same) clientUserId property value for the recipient. (The request JSON you posted doesn't include clientUserId.)

If including the clientUserId property in the POST Recipient View request doesn't resolve your issue, then to troubleshoot further, I'd suggest that you execute a Get Recipients call for the same Envelope, and compare the recipient properties in the response with the property values that you're supplying in your (unsuccessful) POST Recipient View call. The GET Recipients request is simply:

GET /accounts/{accountId}/envelopes/{envelopeId}/recipients

Kim Brandl
  • 13,125
  • 2
  • 16
  • 21
  • Thanks Kim! I was missing the "clientUserId" in the creation of my envelope. – WTP API Jan 27 '14 at 22:28
  • How to get clientUserID. I created an envelope in Docusign console. Added a recipient, giving name and email. When I get the recipient details for that envelope, I got the recipient details back including name and email. But there was no clientUserID. If I create Envelope from Docusign website GUI, how can I set clientUserID? – Krishnabhadra Feb 26 '15 at 12:17
  • 2
    You can only set clientUserID if/when you create the Envelope using the API -- you cannot set it when creating the Envelope via the GUI. – Kim Brandl Mar 05 '15 at 15:06