This topic contains 9 replies, has 2 voices, and was last updated by  Duo_Liang 2 months ago.

  • Author
    Posts
  • Participant
    kartik_shivhare
    Newbie
    Member since: 20.02.2018
    Number of posts: 9

    Hi , i am trying to create a package using the rest API with sandbox url : https://sandbox.esignlive.com/api/packages. I am getting an error response.
    {“technical”:””,”entity”:null,”packageId”:null,”messageKey”:”http.status.400″,”messageLanguage”:null,”message”:”Validation Error”,”parameters”:{},”code”:400,”name”:”Validation Error”}

    I am unable to get what exactly is the problem. Please reply soon.
    I have a query if payload json needs indentation.

    Sample requests are as :

    Sample 1

    ——WebKitFormBoundary1bNO60n7FqP5WO4t
    Content-Disposition: form-data; name=”file”; filename=”download.pdf”
    Content-Type: application/pdf

    filedata

    ——WebKitFormBoundary1bNO60n7FqP5WO4t
    Content-Disposition: form-data; name=”payload”
    {
    “documents”:[
    {
    “name”:”Test package”
    }
    ]
    }
    ——WebKitFormBoundary1bNO60n7FqP5WO4t–

    Sample 2

    –WebKitFormBoundary9ee44645-3603-4c93-be15-e5858198b9f8

    Content-Disposition: form-data; name=”payload”

    {
    “type”: “PACKAGE”,
    “language”: “en”,
    “name”: “Test package”,
    “documents”: [
    {
    “approvals”: [
    {
    “role”: “Customer”,
    “name”: “CustomerSignature”,
    “id”: “CustomerSignature”,
    “fields”: [
    {
    “name”: “APR”,
    “id”: “APR”,

    “extract”: true,
    “type”: “INPUT”,
    “subtype”: “TEXTFIELD”
    },
    {
    “name”: “CustomerSignature”,
    “id”: “CustomerSignature”,
    “extract”: true,
    “type”: “SIGNATURE”,
    “subtype”: “FULLNAME”
    }
    ]
    },
    {
    “role”: “Customer”,
    “name”: “Agent”,
    “id”: “Agent”,
    “fields”: [
    {
    “name”: “Agent”,
    “id”: “Agent”,
    “extract”: true,
    “type”: “SIGNATURE”,
    “subtype”: “FULLNAME”
    }
    ]
    }
    ],
    “extract”: true,
    “index”: 0,
    “name”: “Test Document1”
    }
    ],
    “roles”: [
    {
    “type”: “SIGNER”,
    “id”: “Customer”,
    “signers”: [
    {
    “signature”: null,
    “firstName”: “role”,
    “lastName”: “one”,
    “email”: “ben34king@gmail.com”,
    “id”: “Customer”
    }
    ],
    “name”: “Customer”
    }
    ]
    }

    ——WebKitFormBoundary7MA4YWxkTrZu0gW
    Content-Disposition: form-data; name=”file”; filename=”download.pdf”
    Content-Type: application/pdf

    filedata

    –WebKitFormBoundary9ee44645-3603-4c93-be15-e5858198b9f8–

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

    Score

    0

    Hi kartik,

    If you are encountering 400 “Validation Error”, it’s most likely that your request construction is not valid.
    From your request samples, I guess it could because of the multipart_boundary you are using is not in consistent and the last line of the request should be like "--" + boundary + "--"(with two dashes instead of one)
    The attachment is a picture shows you the standard http request which you can check with your owns or you can kindly refer to my blog for more information.

    Hope this could help you!
    Duo


    Duo Liang
    OneSpan Junior Technical Evangelist
    Attachments:
    You must be logged in to view attached files.
    Participant
    kartik_shivhare
    Newbie
    Member since: 20.02.2018
    Number of posts: 9

    Score

    0

    My Request has two dashes which have got ommitted in the submitted request .
    as per the sample provided in your rest api , package can be created with the basic request . Please find below my request .
    But i am still getting error . Please specify if we can create a package with this basic request or no.
    It is the editor in which you see my sample which is modifying the dashes . i am attaching the document

    Header

    POST https://sandbox.esignlive.com/api/packages
    Content-Type: multipart/form-data; boundary=——–WebKitFormBoundaryd80d6bd2cc5e4c2aaaeac1075d9d67b0
    Accept: application/json
    Authorization: Basic MyApiKEY

    Body as follows

    ——–WebKitFormBoundaryd80d6bd2cc5e4c2aaaeac1075d9d67b0
    Content-Disposition: form-data; name=”payload”

    {
    “name”: “Test package”
    }

    ——–WebKitFormBoundaryd80d6bd2cc5e4c2aaaeac1075d9d67b0–

    Participant
    kartik_shivhare
    Newbie
    Member since: 20.02.2018
    Number of posts: 9

    Score

    -1

    Please find below attached request.

    Participant
    kartik_shivhare
    Newbie
    Member since: 20.02.2018
    Number of posts: 9

    Score

    0

    Text file is not supported , there is no upfront validation , hence , the file is not visible in the previous post.
    i am attaching the png file now.Please respond

    Attachments:
    You must be logged in to view attached files.
    Participant
    kartik_shivhare
    Newbie
    Member since: 20.02.2018
    Number of posts: 9

    Score

    0

    My Recent request is as follows . I am not calling documets api , instead i am calling packages api
    Dashes are omitted by your editor . When i use the same input from an webpage , it is working but if i use it from C# library and call that
    library from an NUNit , i am getting the same issue.Please help me as i am stuck . I can email you the request if you want , i am stuck on this.

    POST : https://sandbox.esignlive.com/api/packages
    Content-Type: multipart/form-data; boundary=—-WebKitFormBoundary88a792097f774b98a7cef06db25a2718
    Accept: application/json
    Authorization: Basic ApiKey

    —-WebKitFormBoundary88a792097f774b98a7cef06db25a2718
    Content-Disposition: form-data; name=”payload”

    {
    “type”: “PACKAGE”,
    “language”: “en”,
    “name”: “Test package”,
    “documents”: [
    {
    “approvals”: [
    {
    “role”: “Customer”,
    “name”: “CustomerSignature”,
    “id”: “CustomerSignature”,
    “fields”: [
    {
    “name”: “APR”,
    “id”: “APR”,

    “extract”: true,
    “type”: “INPUT”,
    “subtype”: “TEXTFIELD”
    },
    {
    “name”: “CustomerSignature”,
    “id”: “CustomerSignature”,
    “extract”: true,
    “type”: “SIGNATURE”,
    “subtype”: “FULLNAME”
    }
    ]
    },
    {
    “role”: “Customer”,
    “name”: “Agent”,
    “id”: “Agent”,
    “fields”: [
    {
    “name”: “Agent”,
    “id”: “Agent”,
    “extract”: true,
    “type”: “SIGNATURE”,
    “subtype”: “FULLNAME”
    }
    ]
    }
    ],
    “extract”: true,
    “index”: 0,
    “name”: “Test Document1”
    }
    ],
    “roles”: [
    {
    “type”: “SIGNER”,
    “id”: “Customer”,
    “signers”: [
    {
    “signature”: null,
    “firstName”: “role”,
    “lastName”: “one”,
    “email”: “ben34king@gmail.com”,
    “id”: “Customer”
    }
    ],
    “name”: “Customer”
    }
    ]
    }

    —-WebKitFormBoundary88a792097f774b98a7cef06db25a2718
    Content-Disposition: form-data; name=”file”; filename=”download.pdf”
    Content-Type: application/pdf

    %PDF-1.3
    1 0 obj
    <</Type /XObject /Subtype /Image /Name /Im1 /Width 2200 /Height 1700 /Length 299197/ColorSpace /DeviceRGB /BitsPerComponent 8 /Filter [ /DCTDecode ] >> stream
    ÿØÿà

    —-WebKitFormBoundary88a792097f774b98a7cef06db25a2718–

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

    Score

    0

    Hi kartik,

    From your txt file, did you put extra two dashes in the front of your boundary? For example, your boundary has 8 dashes in the beginning, so all your separators should include 10 dashes in the beginning and the last line includes another two dashes in the end.

    Duo


    Duo Liang
    OneSpan Junior Technical Evangelist
    Participant
    kartik_shivhare
    Newbie
    Member since: 20.02.2018
    Number of posts: 9

    Score

    0

    Hi Duo ,

    I completely understand that , dashes in the beginning are consistent for all the boundary tags and there are only two dashes in the end.It the editor which is not showing it properly .Please help me . I

    Participant
    kartik_shivhare
    Newbie
    Member since: 20.02.2018
    Number of posts: 9

    Score

    0

    Hi Duo ,

    I have also attached another request as an image.

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

    Score

    0

    Hi Kartik,

    Can you send your code to developer@esignlive.com so that I can have a closer look at that?

    Duo


    Duo Liang
    OneSpan Junior Technical Evangelist

You must be logged in to reply to this topic.