This topic contains 2 replies, has 2 voices, and was last updated by  dreamspaceinteriors 2 months, 3 weeks ago.

  • Author
    Posts
  • Participant
    dreamspaceinteriors
    Newbie
    Member since: 20.02.2019
    Number of posts: 4

    Hi! I’m getting error when uploading package with postman.
    Request:
    POST /api/packages/WZhzAq7Kg94hKye2vaF7X6PAW2U=/documents HTTP/1.1
    Host: apps.e-signlive.ca
    Authorization: Basic MYAPIKEY
    Accept: text/html
    cache-control: no-cache
    Postman-Token: 259c64f4-5ffe-4fb0-a7ae-13448cafa44f
    Content-Disposition: form-data; name=”payload”; filename=”./upload/estimates/18/New.pdf
    Content-Disposition: form-data; name=”name”
    test
    Content-Disposition: form-data; name=”description”
    test
    Content-Disposition: form-data; name=”id”
    test1
    ——WebKitFormBoundary7MA4YWxkTrZu0gW–

    Responce
    {
    “messageKey”: “error.validation.invalidJson”,
    “technical”: “Unexpected character (‘%’ (code 37)): expected a valid value (number, String, array, object, ‘true’, ‘false’ or ‘null’)\n at [Source: (StringReader); line: 1, column: 2]”,
    “message”: “Invalid JSON.”,
    “code”: 400,
    “name”: “Validation Error”
    }

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

    Score

    0

    Hi there,

    For the first glance, it seems your form-data name has some mismatch, please make sure that your JSON payload is with the name of “payload” and your document file is with the name of “file”(if you want to upload multiple documents at the same time, name them all “file”, and they will be uploaded in order)

    The minimal payload example would be like below:

    {
      "name": "Example Document",
      "id": "Document1"
    }

    The two screenshots in attachment show you how to configure the API call in postman.

    Hope this could help!
    Duo


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

    Score

    0

    Thanks, now it works

You must be logged in to reply to this topic.