1
votes

I'm using embedded signing. To get the signing ceremony URL, I call the POST Recipient View method. The method takes some combination of info to match on a signer in that envelope to generate the URL. On the email and userName fields, the documentation states that:

You can use either email and userName or userId to identify the recipient.

On the userId field, the documentation states that:

You can use with userId or email and userName to identify the recipient. If userId is used and a clientUserId is provided, the userId must match a recipientId (which can be retrieved with a GET recipients call) for the envelope. If userId is used and a clientUserId is not provided, the userId match the userId of the authenticating user.

I assume there is a typo in that second paragraph where it should say "clientUserId" instead of "userId." Either way, the gist seems to be that if I want to use userId and can match it up to the recipient GUID on the envelope, I should be able to do that instead of email/username.

However, when I try this, it does not work. I get this error:

{
  "errorCode": "INVALID_REQUEST_PARAMETER",
  "message": "The request contained at least one invalid parameter. A value was not found for parameter 'userName'."
}

This error appears as soon as I start passing userId, and it's thrown regardless of whether or not I actually pass userName in the body or if I just pass it in as a empty string. Here's my request body:

{
    "authenticationMethod": "email",  
    "returnUrl": "<my URL>", 
    "clientUserId": "<my client userId>",
    "userId" : "<xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx>"
}

I've verified that userId does match the recipient's Guid (I get a different error if it doesn't). I've tried adding email and username to the body in all sorts of different ways, and nothing makes a difference. How in the world can I get the URL with userId and clientUserId?

My main reason for wanting to do this instead of using email/username is that we've discovered that when people change their name in the "Adopt Your Signature" prompt (ex: adding a middle initial), it changes the "signatureName" field behind the scenes. And that signatureName field is apparently what's actually used to compare against "username." This means if I'm always sending one thing for "username" (which is the name I have for them in my own system) but DocuSign has saved their signature name as something different (that name with a middle initial), they'll never match, which means DocuSign will always see it as a new user, and they will be forced to re-adopt that signature for every doc, which makes for a really bad experience in our use case of having to sign several docs in a row.

The only workaround I can think of is to do a GET on the envelope to retrieve the signatureName, but that is clunky for multiple reasons, not least of which that it's not currently built into the API library version I'm using.

I've seen various other questions that hit on this, but so far I haven't seen anyone doing it successfully. It seems like most people revert to just using the email/username combination.

Has anyone out there been able to successfully get this call to work with this combination?

EDIT: Here's what the GET request looks like for that envelope. Note that I've tried using both recipientID and userId in the userID POST call, and neither works.

{
  "signers": [
    {
      "signatureInfo": {
        "signatureName": "John A. Smith",
        "signatureInitials": "JAS",
        "fontStyle": "docusign7"
      },
      "isBulkRecipient": "false",
      "name": "John Smith",
      "email": "[email protected]",
      "recipientId": "1",
      "recipientIdGuid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxb4f4",
      "requireIdLookup": "false",
      "userId": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxx8dc3",
      "clientUserId": "JSMITH",
      "routingOrder": "1",
      "note": "",
      "roleName": "Employee",
      "status": "delivered",
      "deliveredDateTime": "2016-03-13T16:08:58.9100000Z"
    }
  ],
  "agents": [],
  "editors": [],
  "intermediaries": [],
  "carbonCopies": [],
  "certifiedDeliveries": [],
  "inPersonSigners": [],
  "recipientCount": "1",
  "currentRoutingOrder": "1"
}
2

2 Answers

3
votes

I created an envelope with an embedded signer and used the GET request for envelopes/{envelopeID}/recipients/ and it returned the userId for my recipient, the body of my POST recipient view was

{
  "clientUserId":"1",
  "authenticationMethod": "email",
  "returnUrl":"http://google.com",
  "userId":"{userId guid from GET} ,
}

and got the URL back correctly.

0
votes

I got it working by starting over with a new envelope. I think my problem was initially not realizing userId was unique to each envelope. And that fact doesn't solve my original problem, which was needing a way to repeatedly identify a signer outside of their name, which apparently changes if they alter the default signature when prompted. No matter how you slice that, if they change the default signature, that new name becomes the one that's tied to that modified signature, and that's the name you need to send for future docs if you want them to be able to use that same signature without having to re-adopt it.

So with that in mind, I have another solution. When the person modifies the default signature name and signs their first doc, I'm going to query that envelope afterwards and check to see if the name changed from what I have in our system. If it's different, I'll store the one they used so I can then send that along for any future docs they sign so they can reuse it.