Webapi with document upload and json in the body

Good morning,

We need to have a webApi that receives a document and a json input with other data in the body. I have been reviewing the document upload template of the webApi and in the body it only lets you add the document.
Does anyone know if what I need to do is possible?

Greetings and thank you

  Discussion posts and replies are publicly visible

  • 0
    Certified Lead Developer

    Hi Sandra, 

    What you are required is a case of request with body of type multipart/form-data.

    I am not sure if Appian supports it currently.

    I can think of 2 other potential solutions

    1. Doc gets received as Binary Data:

    If you need to get minor details, along with the document, you can get them in headers / path of your request and the body can be the binary document

    2. Doc gets received as base64 string

    In case you would want data and document both to be in body, then you can send the document as a base64 string.

    And use relevant plugins to convert a base64 string into a document in Appian while you process the remaining data as usual

  • Hello Agam,

    What we are currently doing is option 2 that you mention, we receive a json input with various data in addition to base64 and then with the plugin  convertbase64todoc we get the document, what we are investigating is an alternative way to do it since we are going to migrate the appian version and not we have the option of being able to check if the operation of the plugin that converts the base64 to appian document is still the same.

    Regards, and thank you very much

  • 0
    Certified Lead Developer
    in reply to sandrap845

    Hi Sandra,

    You can ask about plugin compatibility on the plugin page as well.

    Is your plugin - 'Base64 Document Database Integration' and what appian version are you migrating from / to?

    If you are unable to test in the version you are migrating to due to cost / time issues (I don't see technical reasons behind it), you can also split up your request into 2 calls, one for the document and one for the data part.

    The request where you receive document can have an identifier in the header to know it corresponds to which request.