1

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.

jyoti
  • 101
  • 1
  • 9
  • 2
    enclose pdf name in quotes as it is a string: `"name": "test.pdf",` – Emil Condrea Sep 03 '14 at 09:27
  • Hi i have enclosed as "test.pdf" but i'm getting another error fs.js:427 return binding.open(pathModule._makeLong(path), stringToFlags(flags), mode); – jyoti Sep 03 '14 at 10:19
  • is the file `test.pdf` in the same directory with the script you are running? – Emil Condrea Sep 03 '14 at 10:21
  • its inside the same directory for now but i want to implement /public/upload/test.pdf – jyoti Sep 03 '14 at 10:48
  • you should not use absolute paths like `/public/upload/test.pdf` use a relative path: `path/to/node/script/public/upload/test.pdf`. The error from fs.js is telling you that it can not resolve the path, it does not exist – Emil Condrea Sep 03 '14 at 11:12
  • sorry this is very stupid of but i tried everything, abc/public/uploads/test.pdf this still gives same error – jyoti Sep 03 '14 at 11:36
  • Let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/60529/discussion-between-emil-condrea-and-jyoti). – Emil Condrea Sep 03 '14 at 11:41

1 Answers1

0

You should fill in a correct path into name field:

"name": "path/to/existing/pdf/test.pdf",
Emil Condrea
  • 9,705
  • 7
  • 33
  • 52
  • That shouldn't be needed in this node. It's just looking for an alias. `"documents": [{ "name": "test.pdf", "documentId": 1 }]`. There was an extra comma and no quotes around the file name. – Andrew Sep 03 '14 at 20:40
  • @AndrewWilson, if you check the comments you will see all discussion. The first thing that I suggested was to enclose the name into quotes. In javascript extra comma is allowed.`var a = {a:1,b:2,}` does not throw any error – Emil Condrea Sep 04 '14 at 05:20
  • I read the comments and his example listed above was not what he was using, which was causing the issue. – Andrew Sep 05 '14 at 19:29
  • In his comments he has `"name": test.pdf` which is not what was happening, he was attempting to call a variable that failed and that was the issue. The origional question should be edited to add that information and the answer `"name": "path/to/existing/pdf/test.pdf"` is not valid. – Andrew Sep 05 '14 at 21:05