I am trying to retrieve the recipient view for an envelope using the REST API, and I am getting the INVALID_USERID error code in my response.
Request:
POST https://demo.docusign.net/restapi/v2/accounts/<redacted>/envelopes/<redacted>/views/recipient HTTP/1.1
Authorization: bearer <redacted>
Content-Type: application/json
Host: demo.docusign.net
Content-Length: 124
Expect: 100-continue
{"authenticationMethod":"userId","clientUserId":"2","returnUrl":"<redacted>","userId":"1"}
Response:
HTTP/1.1 400 Bad Request
Cache-Control: no-cache
Content-Length: 70
Content-Type: application/json; charset=utf-8
Date: Fri, 11 Apr 2014 13:48:42 GMT
Strict-Transport-Security: max-age=7776000; includeSubDomains
{
"errorCode": "INVALID_USERID",
"message": "Invalid UserId."
}
As you can see, I am trying to authenticate the recipient view request using the option to provide the clientUserId and userId (since they are an embedded signer) sent in original POST to create the envelope as opposed to using the email/username method. The API documentation does not indicate what authenticationMethod value to use to indicate that I am doing this; it only lists that "email" should be used for the email/username method. Therefore, I'm making my best guess and using "userId" for that value.
I have verified that the clientUserId and userId (recipientId from the envelope request) match what I'm sending in here.
Envelope Request:
POST https://demo.docusign.net/restapi/v2/accounts/<redacted>/envelopes HTTP/1.1
Authorization: bearer <redacted>
Content-Type: multipart/form-data; boundary="AAA"
Host: demo.docusign.net
Content-Length: 309312
Expect: 100-continue
Connection: Keep-Alive
--AAA
Content-Type: application/json; charset=utf-8
Content-Disposition: form-data
{"documents":[{"name":"EOS.pdf","documentId":"1","order":1}],"emailBlurb":null,"emailSubject":"Subject","recipients":{"signers":[{**"clientUserId":"2"**,"email":"[email protected]",**"recipientId":"1"**,"Name":"John Doe","Tabs":{"signHereTabs":[{"anchorString":"Anchor","anchorIgnoreIfNotPresent":true,"anchorUnits":null,"anchorXOffset":-10,"anchorYOffset":-15}]}}]},"status":"sent"}
--AAA
Content-Type: application/pdf
Content-Disposition: file; filename=EOS.pdf; documentid=1
<snip>
--AAA--
Is there anything I need to do to the request to get it to submit correctly?