Error deleting tabs in envelope - docusignapi

I'm having an issue when trying to delete a tab using the REST API which fails at the following URL:
https://demo.docusign.net/restapi/2/accounts/{accountID}/envelopes/{envelopeID}/recipients/1/tabs
DELETE with body {"checkboxTabs":[{"tabId":"168229c3-d717-436f-b6a9-5f014d1817bb"}]} gets:
{
"checkboxTabs": [
{
"selected": "false",
"requireInitialOnSharedChange": "false",
"recipientId": "1",
"tabId": "168229c3-d717-436f-b6a9-5f014d1817bb",
"errorDetails": {
"errorCode": "INVALID_TAB_OPERATION",
"message": "The Tab specified is not valid for the requested operation."
}
}
]
}
It's unclear what the problem is and I cannot find a good example of the correct usage. Is it possible that the tab wasn't found to delete?
UPDATE
I also tried an UPDATE instead of a DELETE and I got the following response body (interestingly the response shows textTabs instead of checkboxTabs):
{
"textTabs": [
{
"requireAll": "false",
"concealValueOnDocument": "false",
"disableAutoSize": "false",
"documentId": "1",
"recipientId": "1",
"tabId": "00000000-0000-0000-0000-000000000000",
"errorDetails": {
"errorCode": "INVALID_TAB_OPERATION",
"message": "The Tab specified is not valid for the requested operation. The Tab specified is not valid for the requested operation. Recipient not in state that allows correction."
}
}
]
}
However this time the error message also contained "Recipient not in state that allows correction" which means I'm attempting an invalid operation as the recipient had already signed? If someone can clarify that would help my understanding.
It would be very useful if the DELETE method also contained a similar message.

That error should appear if the tabID does not exist. I'd recommend a double check the tabID by performing a GET against the same URL.

I believe you'll get that error if ANY of the tab properties you specify are incorrect. For instance, you might be referring to the correct tabId but if the tab in question is on document 2 (for example) and you are referencing documentId = 1 in your request you'll get that error.
I recommend that right before you send the DELETE request to first do a GET on the tab and then inspect all the properties returned and verify that they all match what you are sending out in your delete request.
UPDATE
I just realized what you're probably running into. The EnvelopeTabs: delete API request you are trying to make says this for the description
"Deletes one or more tabs associated with a recipient in a draft envelope."
I believe this is only for DRAFT envelopes. Once you have sent the envelope you need to do an envelope correction if you want to change aspects about it. Your error message is also referencing this
"Recipient not in state that allows correction"

Related

Signer URL for an envelope - calling docusign API and getting 400 bad request error

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":"abc#xyz.com","recipientId":"1","authenticationMethod":"None"}
OR
{"clientUserId":"fc86d3e0-2d5c-4ebb-9765-cb8b0e011ee4","email":"abc1#xyz.com","recipientId":"2","authenticationMethod":"None"}
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": "manoj.sharma#ebix.com",
"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.
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.
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": "manoj.sharma#ebix.com",
"recipientId": "1",
"authenticationMethod": "None",
"returnUrl": "https://www.docuisgn.com"
}
Will most likely work if you change it to:
{
"userName": "Manoj Sharma",
"email": "manoj.sharma#ebix.com",
"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.

INVALID_TAB_OPERATION on textTabs update for a docusign recipient

I am trying to update the textTabs for a particular envelope recipient of a draft Docusign envelope.
For this I am using the PUT EnvelopeRecipientTabs endpoint. But I am always getting this error.
I intend to update the value of an existing text tab of the particular recipient.
"textTabs": [
{
"requireAll": "false",
"concealValueOnDocument": "false",
"disableAutoSize": "false",
"recipientId": "3",
"tabId": "00000000-0000-0000-0000-000000000000",
"errorDetails": {
"errorCode": "INVALID_TAB_OPERATION",
"message": "The Tab specified is not valid for the requested operation. Tab not found in envelope."
}
}
}
Are you specifying a tabId? You need to. Before your EnvelopeRecipientTabs::update call, call EnvelopeRecipientTabs::list to learn the tabId.

Pre-populating Template Tabs with REST API

Trying to pre-populate some fields before sending an envelope using a template in my account, but when the signer/recipient receives the link to the document in their email, the fields are left blank. Here's a portion of the JSON I'm using to make the request in the API:
var body = JSON.stringify({
"emailSubject": "DocuSign API call - Request Signature",
"templateId": templateId,
"templateRoles": [{
"email": recipientEmail,
"name": recipientName,
"roleName": templateRoleName,
"tabs": {
"companyTabs": [
{
"tabLabel": "\\*SignerCompany",
"value": recipientCompany
},
],
"titleTabs": [
{
"tabLabel": "\\*SignerTitle",
"value": recipientTitle
}
]
}
}],
"status": "sent", ....
So the company and title tabs with the labels "SignerCompany" and "SignerTitle" aren't being pre-filled for the recipient. I've tried changing font colors and other things and those seem to work, but somehow the value just doesn't.
I've viewed many similar problems with trying to pre-populate these templates but haven't been able to figure it out. Any help is much appreciated!
This was just asked (and answered) in another recent Stack Overflow post. The issue is that you can not set the company and title tabs in particular (they are read-only).
The system populates their data based on the user's account profile, so if no profile or no data in their profile they'll show up as blank as you're seeing.
See this post for a more detailed answer: https://stackoverflow.com/a/38009218/1968395

Is it possible to retrieve entered tag values from a signed DocuSign document

I am using the DocuSign REST API to created an embedded signing for a predefined document template using the /envelopes/{envelopeID}/views/recipient call. I know it is possible to pre-populate tag values when creating the envelope, but is it possible to retrieve the value the recipient actually provides in a given tag field for use in the application after signing is complete? If so, does anyone have an example?
Sounds like you are trying to Get Envelope Recipient Status with the optional query include_tabs
https://www.docusign.com/sites/default/files/REST_API_Guide_v2.pdf page 133
Example Request
GET https://{server}/restapi/{apiVersion}/accounts/{accountId}/envelopes/{envelopeId
}/recipients/?include_tabs=true
X-DocuSign-Authentication:
<DocuSignCredentials><Username>{name}</Username><Password>{password}</Password><Integrato
rKey>{integrator_key}</IntegratorKey></DocuSignCredentials>
Accept: application/json
Content-Type: application/json
Response
The response returns the recipient types and current routing order. The recipient types includes the
recipient name, email, ID, recipient type, routing order, authentication status (including the date/time
and result of the authentication) status (including the date/time of the status changes) and, if the
recipient status is declined and a reason is required, a decline reason added by the recipient.If the
optional query include_tabs is set to true, the
tabs associated with the recipient are returned.
The following example shows the response json body
Example Response
{
"signers": [
{
"tabs": {
"textTabs": [
{
"height": 11,
"name": "Text",
"value": "this is a test",
"width": 66,
"required": "false",
"locked": "false",
"disableAutoSize": "false",
"tabLabel": "TAB1",
"documentId": "1",
"recipientId": "ed0e8744-6243-4708-9186-0e3ccf4cb3a4",
"pageNumber": "1",
"xPosition": "93",
"yPosition": "142",
"tabId": "2c7b4d94-d958-44df-b5a7-2b530ce914ed"
}
Yes there are at least a couple of ways to retrieve tab values from the signed (completed) docs. I believe Justin's answer is one way. You can also use the Get Tab Information for a Recipient API call, which will return tabs information (values included):
URL:
/accounts/{accountId}/envelopes/{envelopeId}/recipients/{recipientId}/tabs
Method:
GET
Example from DocuSign API Docs:
GET https://{server}/restapi/{apiVersion}/accounts/{accountId}/envelopes/{envelopeId}/recipients/{recipientId}/tabs
X-DocuSign-Authentication: <DocuSignCredentials><Username>{name}</Username><Password>{password}</Password><IntegratorKey>{integrator_key}</IntegratorKey></DocuSignCredentials>
Accept: application/json
Content-Type: application/json
Sample Response:
{
"approveTabs":[{
<Tab information removed>
}],
"textTabs":[{
<Tab information removed>
}],
"signHereTabs":[{
...
}]
}

Docusign API Invalid email address error with signature from document request with inPersonSigner recipient type

I'm currently testing an API call that will ultimately allow for an agent to provide signature and another party to sign in person. In sending the call via API Explorer I continue to receive the following response:
{
"errorCode": "INVALID_EMAIL_ADDRESS_FOR_RECIPIENT",
"message": "The email address for one of the recipients is not valid."
}
I've read in the REST API guide that this needs to be enabled for my account; it may be that my demo dev account does not have this enabled. I just need to verify whether or not that I'm not omitting any essential parameters in this call. I've tried passing in my email (as the account holder) and still receive this error. Here is my request body JSON:
{
"emailBlurb": "test",
"emailSubject": "test",
"documents": [
{
"name": "ChiropractorPlusApplication.pdf",
"documentId": "1"
}
],
"recipients": {
"inPersonSigners": [
{
"hostName": "Joe Host",
"recipientId": "1",
"name": "Name",
"email": "host#gmail.com",
"signerName": "Insured"
}
]
},
"status": "sent"
}
Thanks!
I believe you have found a bug with the REST API Explorer in that it's missing at least one field for In Person Signers. If you look at the REST API documentation you'll see that there's one more required parameter for In Person Signers, which is the hostEmail
Try adding to your JSON
"hostEmail" : "host's email address",
And I have a feeling that will do the trick. See page 275 of REST API v2 PDF for info on In Person Signers recipient type. It first shows a sample request with all the options then below that it lists the required fields for this recipient type:
http://www.docusign.com/sites/default/files/REST_API_Guide_v2.pdf

Resources