This topic contains 11 replies, has 2 voices, and was last updated by  Duo_Liang 5 days, 18 hours ago.

  • Author
    Posts
  • Participant
    nweese
    Newbie
    Member since: 06.11.2018
    Number of posts: 8

    Is it possible? Has anyone done this?

    Keymaster
    Duo_Liang
    Guru
    Member since: 14.06.2018
    Number of posts: 469

    Score

    0

    Hi there,

    Yes! You can use OneSpan Sign REST API with NodeJs, here’s a blog on this and you can find the source code using in this blog here.

    Hope this could help!
    Duo


    Duo Liang
    OneSpan Junior Technical Evangelist
    Participant
    nweese
    Newbie
    Member since: 06.11.2018
    Number of posts: 8

    Score

    0

    This gives me a good direction to head in but unfortunately downloading and running the code does not work.
    I ‘npm i’ to install all the node modules, inserted my api_key, node server.js to run the server, and live-server for the front end.

    Server is saying “TypeError [ERR_INVALID_ARG_TYPE]: The “path” argument must be of type string”

    • This reply was modified 6 days, 18 hours ago by  nweese.
    Keymaster
    Duo_Liang
    Guru
    Member since: 14.06.2018
    Number of posts: 469

    Score

    0

    Hi there,

    In file ESLPackageCreation.js, line 34, if I directly use this json as formData, it works:

    formData: 
    { "file": document, 
     "payload": jsonPayload } 

    Hope this could help!
    Duo


    Duo Liang
    OneSpan Junior Technical Evangelist
    Participant
    nweese
    Newbie
    Member since: 06.11.2018
    Number of posts: 8

    Score

    0

    Thank you Duo! That got me farther but still not working. My response body is now

    body {“messageKey”:”error.validation.sendPackage.noApprovals”,”message”:”Cannot send package without approvals.”,”code”:400,”name”:”Validation Error”}

    I am using the api_key I retreived from sandbox. Is this wrong?

    Keymaster
    Duo_Liang
    Guru
    Member since: 14.06.2018
    Number of posts: 469

    Score

    0

    Hi there,

    “error.validation.sendPackage.noApprovals” is an error sent from OneSpan Sign, so if you are receiving this error, it means your API key and instance endpoint are correct.

    For the error, did you changed the pdf included in the folder? Because in this example, it’s using Document Extraction Feature to locate all approvals, it seems that OneSpan Sign can’t find the automated injected fields in your pdf.

    Duo


    Duo Liang
    OneSpan Junior Technical Evangelist
    Participant
    nweese
    Newbie
    Member since: 06.11.2018
    Number of posts: 8

    Score

    0

    Ok, so how do I use a custom form?

    Is it possible to create the template via UI and use that document, and if so, how do I retreive the packageId?

    Keymaster
    Duo_Liang
    Guru
    Member since: 14.06.2018
    Number of posts: 469

    Score

    0

    Hi nweese,

    For first question. Sure, the example only gives you an idea of how the whole process works with OneSpan Sign. To customize your pdf, and to locate your fields/approvals, you can use following extraction ways:
    1.Document Extraction
    Use PDF forms to tell OneSpan Sign where and what the size you want your field(signature field/date field/text field, etc) to be on the document. The property name of the PDF form should follow esl grammar so that OneSpan Sign can know which type of fileds you want and which signer/approval you want this field to be bound to.
    The “extract”:true is added to the document level.

    2.Text Tags Extraction
    Text Tags Extraction achieves the same goal with Document Extraction, only difference is you don’t use a pdf form. You direct embed esl grammar(including size) into your document and OneSpan Sign can recognize that snippet.
    The “extract”:true is also added to the document level.

    3.Position Extraction
    Position Extraction is a simplified document extraction, you just tell OneSpan Sign where and the size of the field, the type and other info still includes in the request payload.
    Since position extraction is refined to the field, “extract”:true is added to a field level.(which field you need position extraction, you need to add a extract=true)

    4. Text Anchor
    Text Anchor follows the same idea with Position Extraction. By given the specific snippet of your document word, OneSpan Sign can locate to the position and you need extra info in the request payload to specify the type and other info.
    The extract should be set to false:”extract”:false on field level just like position extraction.

    5.Field Injection
    Field Injection is different to those four. You would use PDF form with property name to locate the field, and inject values(text) to these fields. What you injected would become a part to the document before signers start to sign. Pretty like what you can done with these open source PDF libraries.
    The “extract”:true is added to the document level.

    For second question. If you want to use UI to create a template, normally it’s suggested to partially integrate this into your own application, and here’s the workflow you may follow:
    1.create a template programmatically, so that you can receive the package/template id
    2.call API to get a Designer session (guide here), and embed Designer view into an iFrame (in a modal most cases)
    3.make packages from template(guide here)

    Hope this could help you!
    Duo


    Duo Liang
    OneSpan Junior Technical Evangelist
    Participant
    nweese
    Newbie
    Member since: 06.11.2018
    Number of posts: 8

    Score

    0

    https://github.com/nicoleweese/Abacus-Form-Upload

    Please let me know why the package will not clone.

    Error:
    source.on(‘error’, function() {});
    TypeError: source.on is not a function
    at Function.DelayedStream.create (/home/niko/Downloads/nodejs/node_modules/request/node_modules/combined-stream/node_modules/delayed-stream/lib/delayed_stream.js:33:10)
    at FormData.CombinedStream.append (/home/niko/Downloads/nodejs/node_modules/request/node_modules/combined-stream/lib/combined_stream.js:43:37)
    at FormData.append (/home/niko/Downloads/nodejs/node_modules/request/node_modules/form-data/lib/form_data.js:68:3)

    Keymaster
    Duo_Liang
    Guru
    Member since: 14.06.2018
    Number of posts: 469

    Score

    0

    Hi nweese,

    The package with id of “-xarvqdcc5R4IqsfnqkOVFEA05o=” is a “package” instead of a “template”, that’s why you can’t create packages from this one.
    BTW, for test purpose, you can retrieve your template ID from url.

    Duo


    Duo Liang
    OneSpan Junior Technical Evangelist
    • This reply was modified 5 days, 17 hours ago by  Duo_Liang.
    Participant
    nweese
    Newbie
    Member since: 06.11.2018
    Number of posts: 8

    Score

    0

    Is there any sort of live technical support I can contact?

    • This reply was modified 5 days, 18 hours ago by  nweese.
    Keymaster
    Duo_Liang
    Guru
    Member since: 14.06.2018
    Number of posts: 469

    Score

    0

    Sure, you can find contact information of our technical support in this webpage.

    Duo


    Duo Liang
    OneSpan Junior Technical Evangelist
    • This reply was modified 5 days, 18 hours ago by  Duo_Liang.

You must be logged in to reply to this topic.