modim1425 | Posts: 6

name cannot be null or empty

0 votes
While attempting to upload a document to a package via the following call:
https://sandbox.esignlive.ca/api/packages/9uPhYzkvKRJXmdxv4Bje_7gz9Ls=/documents 
I am presented with the following error:
POST https://sandbox.e-signlive.ca/api/packages/9uPhYzkvKRJXmdxv4Bje_7gz9Ls=/documentsresulted in a500 Internal Server Error` response:
{"code":500,"messageKey":"error.internal.default","technical":"name cannot be null or empty","message":"Unexpected error
I did manage to view the entire body of the error message and it was a generic default error message. Here is the document JSON given as an argument to the upload function:
{
  "fields": [],
  "id": "contract",
  "name": "BidSettle_Contract-268-2018-03-22",
  "size": 0,
  "index": 0,
  "description": "DOCUMENT DESCRIPTION L7",
  "approvals": [
    {
      "fields": [
        {
          "type": "INPUT",
          "top": 549,
          "left": 414,
          "width": 119,
          "height": 30,
          "subtype": "TEXTFIELD",
          "id": "location",
          "value": "",
          "validation": {
            "required": true
          },
          "page": 0,
          "extract": false
        },
        {
          "type": "INPUT",
          "top": 549,
          "left": 563,
          "width": 119,
          "height": 30,
          "name": "",
          "value": "MMMM dd, yyyy",
          "binding": "{approval.signed}",
          "subtype": "LABEL",
          "id": "YUPpJcTscHUU",
          "page": 0,
          "extract": false
        },
        {
          "type": "SIGNATURE",
          "top": 600,
          "left": 410,
          "width": 200,
          "height": 40,
          "value": "",
          "name": "",
          "subtype": "CAPTURE",
          "id": "CWcN4vO1sjo0",
          "page": 0,
          "extract": false
        },
        {
          "type": "INPUT",
          "top": 650,
          "left": 410,
          "width": 150,
          "height": 30,
          "name": "",
          "binding": "{signer.name}",
          "subtype": "LABEL",
          "id": "MNidJWwjJAY4",
          "page": 0,
          "extract": false
        },
        {
          "extract": true,
          "extractAnchor": {
            "text": "Confidentiality",
            "index": 0,
            "leftOffset": 10,
            "topOffset": 10,
            "width": 200,
            "height": 300,
            "characterIndex": 0,
            "anchorPoint": "TOPLEFT"
          },
          "name": "SIGNATURE",
          "subtype": "CAPTURE",
          "type": "SIGNATURE"
        }
      ],
      "role": "Signer1319",
      "id": "signature"
    }
  ],
  "extract": false
}
We DO have a new development environment URL. I thought that maybe the esign sandbox needs to have specific domains registered and maybe that was the cause of the error but I don't see anywhere to register a new one on the console. HELP!! PLEASE!!!

Approved Answer
harishaidary | Posts: 1812

Reply to: name cannot be null or empty

0 votes
I just ran a quick test using postman using your pdf and your exact payload and I was able to get a successful response. Below is the exact http request:
POST https://sandbox.e-signlive.ca/api/packages/rRCwylxnlW_HZHc1VJuEijeYdlw=/documents HTTP/1.1
Authorization: Basic my_api_key
Accept: text/html
cache-control: no-cache
Postman-Token: 4d660b61-2665-4e35-8e6f-868436c9580f
User-Agent: PostmanRuntime/7.1.1
Host: sandbox.e-signlive.ca
accept-encoding: gzip, deflate
content-type: multipart/form-data; boundary=--------------------------384576484415692171392150
content-length: 31976
Connection: close

----------------------------384576484415692171392150
Content-Disposition: form-data; name="payload"

{"fields":[],"id":"contract","name":"BidSettle_Contract-292-2018-03-23","size":0,"index":0,"description":"DOCUMENT DESCRIPTION L7","approvals":[{"fields":[{"type":"INPUT","top":549,"left":414,"width":119,"height":30,"subtype":"TEXTFIELD","id":"location","value":"","validation":{"required":true},"page":0,"extract":false},{"type":"INPUT","top":549,"left":563,"width":119,"height":30,"name":"","value":"MMMM dd, yyyy","binding":"{approval.signed}","subtype":"LABEL","id":"YUPpJcTscHUU","page":0,"extract":false},{"type":"SIGNATURE","top":600,"left":410,"width":200,"height":40,"value":"","name":"","subtype":"CAPTURE","id":"CWcN4vO1sjo0","page":0,"extract":false},{"type":"INPUT","top":650,"left":410,"width":150,"height":30,"name":"","binding":"{signer.name}","subtype":"LABEL","id":"MNidJWwjJAY4","page":0,"extract":false},{"extract":true,"extractAnchor":{"text":"Confidentiality","index":0,"leftOffset":10,"topOffset":10,"width":200,"height":300,"characterIndex":0,"anchorPoint":"TOPLEFT"},"name":"SIGNATURE","subtype":"CAPTURE","type":"SIGNATURE"}],"role":"Signer1319","id":"signature"}],"extract":false}
----------------------------384576484415692171392150
Content-Disposition: form-data; name="file"; filename="BidSettle_Contract-292-2018-03-23.pdf"
Content-Type: application/pdf

%PDF-1.4
1 0 obj
...... [pdf bytes]

----------------------------384576484415692171392150--
Is your request similar to the above in terms of headers? (minus of course the user-agent and postman-token). I would also advise opening a ticket with our support team if you haven't done so already. [email protected]

SamNintex | Posts: 1

Reply to: name cannot be null or empty

0 votes
I am having the same issue as modim1425. This was perviously working, and we have not made any changes in our code. In the last few days we recently just starting getting this error when testing against our Sandbox eSignLive account . Were there changes to the REST API that may impact us and result in this error?

harishaidary | Posts: 1812

Reply to: name cannot be null or empty

0 votes
@modim1425 Just to make sure, you're making the call to "https://sandbox.e-signlive.ca/api" is that correct? Because the first URL you shared should have a hyphen in "esignlive". Also, is it just the upload call that is failing? And can you send me the document you are trying to upload (if it doesn't contain any sensitive information) to [email protected] so I can run some tests? @SamNintex Can you also send me your payload and document to [email protected] so I can run some tests? And is it only the upload document call failing?

harishaidary | Posts: 1812

Reply to: name cannot be null or empty

0 votes
@modim1425 Looking more closely at your JSON payload, you can only have one field of type "SIGNATURE" per approval. Hence, if you want to assign two signatures to a signer, it should be done like so:
{
  "fields": [],
  "id": "contract",
  "name": "BidSettle_Contract-268-2018-03-22",
  "size": 0,
  "index": 0,
  "description": "DOCUMENT DESCRIPTION L7",
  "approvals": [
    {
      "fields": [
        {
          "type": "INPUT",
          "top": 549,
          "left": 414,
          "width": 119,
          "height": 30,
          "subtype": "TEXTFIELD",
          "id": "location",
          "value": "",
          "validation": {
            "required": true
          },
          "page": 0,
          "extract": false
        },
        {
          "type": "INPUT",
          "top": 549,
          "left": 563,
          "width": 119,
          "height": 30,
          "name": "",
          "value": "MMMM dd, yyyy",
          "binding": "{approval.signed}",
          "subtype": "LABEL",
          "id": "YUPpJcTscHUU",
          "page": 0,
          "extract": false
        },
        {
          "type": "SIGNATURE",
          "top": 600,
          "left": 410,
          "width": 200,
          "height": 40,
          "value": "",
          "name": "",
          "subtype": "CAPTURE",
          "id": "CWcN4vO1sjo0",
          "page": 0,
          "extract": false
        },
        {
          "type": "INPUT",
          "top": 650,
          "left": 410,
          "width": 150,
          "height": 30,
          "name": "",
          "binding": "{signer.name}",
          "subtype": "LABEL",
          "id": "MNidJWwjJAY4",
          "page": 0,
          "extract": false
        }
      ],
      "role": "Signer1319",
      "id": "signature1"
    },
    {
      "fields": [
        {
          "extract": true,
          "extractAnchor": {
            "text": "Confidentiality",
            "index": 0,
            "leftOffset": 10,
            "topOffset": 10,
            "width": 200,
            "height": 300,
            "characterIndex": 0,
            "anchorPoint": "TOPLEFT"
          },
          "name": "SIGNATURE",
          "subtype": "CAPTURE",
          "type": "SIGNATURE"
        }
      ],
      "role": "Signer1319",
      "id": "signature2"
    }
  ],
  "extract": false
}

modim1425 | Posts: 6

Reply to: name cannot be null or empty

0 votes
Yes, all of the calls do have the hyphen. This is the exact call that failed with what appears to be a generic default error message from esign servers:
https://sandbox.e-signlive.ca/api/packages/-6OQViWG43OxbVfJ4UB0I9WkNcg=/documents
I can't send you a pdf because they are dynamically created and destroyed by the system.

modim1425 | Posts: 6

Reply to: name cannot be null or empty

0 votes
Thanks for helping. I am loathe to start making changes to the structure of the JSON because this exact same code is working perfectly in production to esignlive. As others have also been having this issue would it not be prudent to update that error message with something a little bit more informative?

harishaidary | Posts: 1812

Reply to: name cannot be null or empty

0 votes
Sorry for the inconvenience. Is there any chance for you to save a copy of the PDF? Because that would help accelerate in resolving the error. Just as an FYI, the production environment is on version 11.11.2 where as sandbox has been recently updated to 11.12. There might be an issue with the latest update. Regarding the error messages, there have been requests for this and we are currently working on improving them.

modim1425 | Posts: 6

Reply to: name cannot be null or empty

0 votes
@Haris Hi, has there been any movement on this? Any further advice? Our CTO is now opening talking about switching from esign to an alternative platform because of this issue. I'd rather not have to implement a whole new platform but we need to be able to run tests against the sandbox. Any updates would be appreciated.

harishaidary | Posts: 1812

Reply to: name cannot be null or empty

0 votes
Hi there, I do apologize for the late reply. I missed your email notification. I will test with the pdf you sent and get back to you shortly.

modim1425 | Posts: 6

Reply to: name cannot be null or empty

1 votes
For anyone coming looking with the same problem, it appears that file upload to the sandbox requires filename set in
Content-Disposition
. I was missing the filename set like so:
Content-Disposition: form-data; name="file"; filename="my_file.pdf"

asingla | Posts: 19

Reply to: name cannot be null or empty

0 votes
Hi, I am trying to send pdf document and JSON request to eSignLive using RestEasy library. But if I use below code, I end up with error {"messageKey":"error.internal.default","technical":"name cannot be null or empty","code":500,"name":"Unhandled Server Error","message":"Unexpected error. We apologize for any inconvenience this may have caused you, please try again. If the problem persists, please contact our support team."}
String basicAuthentication = "Basic API Key";
        String boundary = Long.toHexString(System.currentTimeMillis());
        ClientRequest cr = new ClientRequest("https://sandbox.esignlive.com/api/packages/")
                .header(HttpHeaders.AUTHORIZATION, basicAuthentication);
        cr.accept(MediaType.APPLICATION_JSON_TYPE);

MultipartFormDataOutput mro = new MultipartFormDataOutput();
OutputPart filePart = mro.addFormData("file", new FileInputStream("C:\\esign\\My File_Edit.pdf"), MediaType.APPLICATION_OCTET_STREAM_TYPE);
mro.addFormData("payload", eSignLivePackage, MediaType.APPLICATION_JSON_TYPE);
       
        cr.body("multipart/form-data",mro);
And if I use code,
String basicAuthentication = "Basic API Key";
        String boundary = Long.toHexString(System.currentTimeMillis());
        ClientRequest cr = new ClientRequest("https://sandbox.esignlive.com/api/packages/")
                .header(HttpHeaders.AUTHORIZATION, basicAuthentication);
        cr.accept(MediaType.APPLICATION_JSON_TYPE);

MultipartFormDataOutput mro = new MultipartFormDataOutput();
OutputPart filePart = mro.addFormData("file", new FileInputStream("C:\\esign\\My File_Edit.pdf"), MediaType.APPLICATION_OCTET_STREAM_TYPE);
filePart.getHeaders().add("Content-Disposition: ", "form-data; name=\"file\"; filename=\""+ "My File_Edit.pdf");
mro.addFormData("payload", eSignLivePackage, MediaType.APPLICATION_JSON_TYPE);
       
        cr.body("multipart/form-data",mro);
then get error: "technical":"Number of uploaded files does not match number of documents specified in package.","messageKey":"error.validation.package.wrongNumberOfFiles","message":"Number of uploaded files does not match number of documents specified in package.","code":400,"name":"Validation Error"} Please help me figure out whats missing here.

harishaidary | Posts: 1812

Reply to: name cannot be null or empty

0 votes
Hi there, Can you send me the json payload to [email protected] so I can have a look? Thanks,

asingla | Posts: 19

Reply to: name cannot be null or empty

0 votes
Thanks for the quick reply. I figured out the problem. I was missing
+"\""
from the end of filename for future reference of others it should be
 filePart = mro.addFormData("file", new FileInputStream("C:\\esign\\My_test.pdf"), MediaType.APPLICATION_OCTET_STREAM_TYPE);
            filePart.getHeaders().add("Content-Disposition", "form-data; name=\"file\"; filename=\"" +"My_test.pdf" +"\"");
            OutputPart filePart1 = mro.addFormData("file1", new FileInputStream("C:\\esign\\PDFFile.pdf"), MediaType.APPLICATION_OCTET_STREAM_TYPE);
            filePart1.getHeaders().add("Content-Disposition", "form-data; name=\"file\"; filename=\"PDFFile.pdf\"");
            mro.addFormData("payload", eSignLivePackage, MediaType.APPLICATION_JSON_TYPE);

Hello! Looks like you're enjoying the discussion, but haven't signed up for an account.

When you create an account, we remember exactly what you've read, so you always come right back where you left off