0
votes

For requirement - Signer URL - we want to get signer URL for envelope. Calling below API and but API throw 400 bad request message.

POST /restapi/v2.1/accounts/{accountId}/envelopes/{envelopeId}/views/recipient

I tried with following both request.

{"clientUserId":"fc86d3e0-2d5c-4ebb-9765-cb8b0e011ee4","userId":"fc86d3e0-2d5c-4ebb-9765-cb8b0e011ee4","userName":"Manoj Sharma","email":"[email protected]","recipientId":"1","authenticationMethod":"None"}

OR

{"clientUserId":"fc86d3e0-2d5c-4ebb-9765-cb8b0e011ee4","email":"[email protected]","recipientId":"2","authenticationMethod":"None"}
1
Now my new request body {"clientUserId":"fc86d3e0-2d5c-4ebb-9765- cb8b0e011ee4","userName":"Manoj Sharma","email":"[email protected]", "recipientId":"1 ","returnUrl":"docuisgn.com","authenticationMethod":"Passw…"}ManojKS

1 Answers

2
votes

I've taken a look at some of your recent traffic, I see a combination of errors relating to a missing returnUrl or userName.

I don't believe the userId (not the clientUserId) is required for this call, so you may want to remove that portion as well if this doesn't work.

Try changing it to:

{
    "clientUserId": "fc86d3e0-2d5c-4ebb-9765-cb8b0e011ee4",
    "userId": "fc86d3e0-2d5c-4ebb-9765-cb8b0e011ee4",
    "userName": "Manoj Sharma",
    "email": "[email protected]",
    "recipientId": "1",
    "authenticationMethod": "None",
    "returnUrl":"https://www.docuisgn.com"
}

If the other required details in the call are present it should start working. Let us know if you still see an error message.

Edit:

The issue is two-parts.

  1. When your envelopes are being created, you're not supplying a clientUserId for the recipient. The ID can be a combination of numbers or letters, usually less than 12 characters long.

  2. When you're creating the request for the recipientViewToken, the clientUserId you're specifying is the apiUserName of the intended recipient. The apiUserName is a user-specific GUID that's assigned to a specific user on your account. In order for the recipientViewToken requests to go through, the clientUserId needs to match up between the recipient already present on the envelope and the user details you specify in the call, which is agnostic of this APIUserName.

Your example:

{
    "clientUserId": "fc86d3e0-2d5c-4ebb-9765-cb8b0e011ee4",
    "userId": "fc86d3e0-2d5c-4ebb-9765-cb8b0e011ee4",
    "userName": "Manoj Sharma",
    "email": "[email protected]",
    "recipientId": "1",
    "authenticationMethod": "None",
    "returnUrl": "https://www.docuisgn.com"
}

Will most likely work if you change it to:

{
    "userName": "Manoj Sharma",
    "email": "[email protected]",
    "recipientId": "1",
    "authenticationMethod": "None",
    "returnUrl": "https://www.docuisgn.com"
}

However, if you intend for your recipients to be captive, you just need to supply the same clientUserId in the envelope definitions that you do when requesting the token. It doesn't have to be an APIUsername, it can be as simple as 5678.