Hi Team,
We have a requirement to get files from external system along with some input parameters to our process model via a web api.
The web api which starts a process would upload the file to the target folder and write/update data in respective appian DB tables.
How can we achieve this?
Request format :
document - type (document/file)
id - type int
name - type text etc
This request can either be in form or json format.
Appian version used is 21.1
Discussion posts and replies are publicly visible
I think this is what you are looking for:
docs.appian.com/.../passing-a-web-api-document-into-a-process-model.html
Hi Dimitris,
Thanks for your reply. Is there no way like I can send the files as well the input parameters as a json input or form input instead of passing input parameters inside query parameters.Also I have one more question : Can't we authorize our web api for the above action with Appian key authorization? I was trying to call the web api from postman I get 403 error while using Appian key.
I guess you can do that and inside the Process Model that the API will initiate, you can then parse the json and export the document (transcript data) and the rest of your variables.
Will it be possible for you to share some sample codes if you have any?And for passing the input as json, I can create a web api using startprocess template right?
Did you go through the link I've attached? That contains pretty much everything you need including examples on how to build the API, how to initiate the PM and how to pass the process variables into it.
Simply, on the given example the http!request.body will be your json message which you have to pass into the Process Model in a pv. For example:
a!startProcess( processModel: cons!UPLOAD_STUDENT_TRANSCRIPT, processParameters: { jsonData: http!request.body },
The jsonData should be a process variable of type text in the PM.
For parsing the jsonData and getting your information from it, use the a!fromJson() function in an expression rule.