Docusign API - Umlaut character in Recepient name - docusignapi

The recipient name has an umlaut character -> "François"
While sending the envelope to this recipient using the Docusign Rest API v2, I'm getting an error in response with
Error Code -> UNSPECIFIED_ERROR
Error Message -> An item with the same key has already been added.
If I change the recipient's name to a string with no umlaut characters, the envelope works.
Is there any way to fix this at an account level or while sending the request to Docusign?
Following is the request xml which works without the umlaut character ç in the recipient's name.
<envelopeDefinition><emailSubject>Agreement Name</emailSubject>
<status>sent</status><documents><document><name>Agreement Name</name>
<documentId>368649304</documentId><documentBase64>Document
Contents</documentBase64></document></documents><recipients><signers>
<signer><recipientId>1</recipientId><email>TestEmail</email>
<name>François Harnandez</name>
<routingOrder>1</routingOrder><tabs><signHereTabs><signHere>
<anchorString>ICLM_ExtSignature:1</anchorString></signHere></signHereTabs>
<dateSignedTabs><dateSigned><anchorString>ExtDate1</anchorString>/dateSigned>
</dateSignedTabs></tabs></signer></signers></recipients>
</envelopeDefinition>

I just tested this to see what I actually passed to the CURL request and here's what I get (json instead of xml) when I pass in Tèst User as a recipientName
Request
POST: https://{server}/restapi/v2/accounts/{accountId}/envelopes/
{
"emailSubject": "Testing",
"templateId": "{templateId}",
"status": "sent",
"templateRoles": [
{
"email": "email#domain.com",
"name": null,
"roleName": "Role 1",
"clientUserId": 12345654321
}
]
}
Response
{
"errorCode": "INVALID_USERNAME_FOR_RECIPIENT",
"message": "The user name for the recipient is invalid. The user name is invalid for recipient email email#domain.com"
}
I would expect this error message to come back if I'm passing in a null value, is your XML encoding stripping out that value? Can you see what you're actually passing to DocuSign with an entire response?

Could you try this request in JSON instead of XML ?
I have try in JSON with name "François" and I have no problem to send the request and to sign with this name : http://i.stack.imgur.com/vtWUc.png

Related

Embedded Signing - Signing from My App

I'm working on get the signing process on an iFrame to Embedded docusign on my app.
I have trying to work on this based on this tutorials:
Docusign Embedded Signing using template
https://developers.docusign.com/esign-rest-api/guides/features/embedding
Based on what I understood, if you want to embedded you have to create the "create the envelope on the fly". So you don't specify the templateId correct?
So what I don't fully get is, how I get the documentBase64 string value? I have to get it manually? Or docusing api has an endpoint that will return that?
Also I want to know, what happen to the custom fields I added to the template? I can't use them?
Right now this is the json I'm sending:
{{baseUrl}}/envelopes
{
"emailSubject":"This is a custom email subjet, look at the doc.",
"status":"sent",
"templateId":"a0847413-35ac-48ed-9ed6-9b7f96019eda",
"templateRoles":[
{
"email":"mauriciotaranto#email.com",
"name":"Mauricio T",
"clientUserId": "1234",
"roleName":"Test",
"routingOrder":"1",
"tabs": {
"textTabs": [
{
"tabLabel": "Custom",
"value": "This is a custom value"
},
{
"tabLabel": "NewCustom",
"value": "Another custom value added using API"
},
{
"tabLabel": "NewCustom1",
"value": "Last custom value added using API"
}
]
}
}
],
}
And then I go to the recipient view to get the URL:
{{baseUrl}}/envelopes/{{envelopeId}}/views/recipient
{
"returnUrl": "https://www.google.com.uy",
"authenticationMethod": "None",
"email": "mauriciotaranto#email.com",
"userName": "Mauricio T",
"clientUserId": "1234"
}
As far as I understood this way will not allow the user to sing the document.
Need to do it with the document instead.
Can you explain to me how this should work?
Thanks!
UPDATE:
Im manually parsing the bytes of the document to base64. and send this json:
"status":"sent",
"emailSubject":"Envelope with Embedded Signer",
"documents":[
{
"documentId":"1",
"name":"contract.pdf",
"documentBase64":bytes
}
],
"recipients":{
"signers":[
{
"email":"mauriciotaranto#hotmail.com",
"name":"Mauricio T",
"recipientId":"1",
"clientUserId":"1234"
}
]
}
}
I change the headers, add the accept: application/json and content-type: multipart/from-data
And this is the response I get:
{
"errorCode": "ENVELOPE_IS_INCOMPLETE",
"message": "The Envelope is not Complete. A Complete Envelope Requires Documents, Recipients, Tabs, and a Subject Line. Content-Type does not contain boundary parameter."
}
You can create envelopes in any way, either by using Templates or by passing base64 of document or both as well using Composite Template. When you send templates, then you already have added signers tabs on the document in the templates so you just need to populate the signer details like name and email in creating an envelope and/or pre-populate the DS Tabs value. But when you send document as base64, then you need to tell DocuSign how to add DS Tabs on the document, either by using
X and Y position of the tabs
AnchorString
PDF Field Transformation
Embedded Signing is a type of signing, to implement that you need to just add clientUserId in the signers details. This can be done in both ways either by using template or by passing document as base64 or both as well using Composite Template. Once you have an embedded signer by adding clientUserId then you need to generate signing URL as explained in your qs, by using Recipient View URL, as soon as URL is generated then you will open this URL in IFrame or on new tab.
In the link which you shared is having very small code snippet and it does not have complete example, check Complete Example, and you will see that they are adding DS Tabs on the document using X/Y position.

Can't download Docusign document when envelope name has quotes

I'm using the Docusign API (via the ruby docusign_rest gem) and repro'd this using Postman.
I have an envelope whose name has quotes in it. When I tried to download the signed PDF, I get an error message:
https://www.docusign.net/restapi/v2/accounts/{account_id}/envelopes/{envelope_id}/documents/1
{
"errorCode": "UNSPECIFIED_ERROR",
"message": "The format of value 'file; filename=\"My filename (\"MF\") has quotes.pdf\"; documentid=\"1\"' is invalid."
}
When I list the documents, it shows the name of the envelope having quotes.
https://www.docusign.net/restapi/v2/accounts/{account_id}/envelopes/{envelope_id}/documents
{
"envelopeId": "{envelope_id}",
"envelopeDocuments": [
{
"documentId": "1",
"name": "My filename (\"MF\") has quotes.pdf",
"type": "content",
"uri": "/envelopes/{envelop_id}/documents/1",
etc...
}
}
I can change my code to prevent quotes for new documents, but I have existing signed documents that I can't download. How can I download them? Or fix them?
You will need to properly escape the quotes in your json.
The only way to know what is really happening is to see the api logs.
Added
To see the api logs, you have two choices:
See the instructions
Use the API Logging Feature of the new (still beta) Recipe tool. has a more convenient interface to the API Logger.
Using the current docusign_rest release (v0.3.1) I was able to create an envelope with a quote in the document's filename and then download that document:
client = DocusignRest::Client.new
res = client.create_envelope_from_document(email: {subject: "test email subject",body: "this is the email body and it's large!"}, signers: [{embedded: true, name: 'Joe Dimaggio', email: 'joe.dimaggio#example.org', role_name: 'Issuer',sign_here_tabs: [{anchor_string: 'sign here',anchor_x_offset: '-30',anchor_y_offset: '35'}]},], files: [{path: '/Users/tomcopeland/github.com/docusign_rest/test".pdf', name: 'test".pdf'},],status: 'sent')
client.get_document_from_envelope(envelope_id: res['envelopeId'], document_id: "1", local_save_path: "/tmp/foobar.pdf")
client.get_documents_from_envelope(envelope_id: res['envelopeId'])["envelopeDocuments"].map {|d| d["name"] }
=> ["test\".pdf", "Summary"]
Also, this latest release supports call logging so, if needed, you can extract logs client-side.

What are the values for AuthenticationMethod?

I'm making a request to /accounts/{accountId}/envelopes/{envelopeId}/views/recipient
with the JSON
{
"authenticationMethod": "userid",
"returnUrl": "http://localhost:3000/rooms/07bfcdf24f455ff14964f0e14c8d6825/finished",
"userId": "5a44ea44-02be-4926-8c3d-66cb85523799"
}
and getting the error
{
"errorCode": "INVALID_REQUEST_PARAMETER",
"message": "The request contained at least one invalid parameter. The value of AuthenticationMethod is invalid."
}
EDIT:
Another thing i failed to mention, is the envelope was created with compositeTemplates.
From the SOAP WSDL (https://www.docusign.net/api/3.0/dsapi.asmx?wsdl) - these values also work for REST (lowercase):
Password
Email
PaperDocuments
HTTPBasicAuth
SSLMutualAuth
X509Certificate
Kerberos
SingleSignOn_CASiteminder
SingleSignOn_InfoCard
SingleSignOn_MicrosoftActiveDirectory
SingleSignOn_Passport
SingleSignOn_SAML
SingleSignOn_Other
Smartcard
RSASecureID
Biometric
None
KnowledgeBasedAuth
The following values should all be valid, though note that this might not be a full list:
"None"
"Email"
"Password"
"HTTPBasicAuth"
"X509Certificate"
"KnowledgeBasedAuth"

How to add document in DocuSign

I have following request to be sent to DocuSign API,
"emailSubject": 'DocuSign API - Signature Request on Document Call',
"documents": [{
"name": test.pdf,
"documentId": 1,
}]
What I dont understand is, where should the documents name be present and what about the documentId.
I got an error as follows:
{ errorCode: 'INVALID_REQUEST_PARAMETER',
message: 'The request contained at least one invalid parameter. A document was defined without setting the \'name\' field.' }
Error calling webservice, status is: 400
I think it cannot find the pdf.
You should fill in a correct path into name field:
"name": "path/to/existing/pdf/test.pdf",

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