Hi all,
I would like to integrate that Python code into OutSystems API.
In the Python code, we have to login to reach the UI end point before we upload files to it. The API should respone an filepath after a file is uploaded. (e.g. [/tmp/gradio/xxxxxxxxxxx/Test.pdf])
However, how can I do this in OutSystems for the upload files part (i.e. under the #API section)?
I have searched online but it seems they don't help much for my case, as I am posting a list with both string and binary, instead of solely a binary.
(FYI, the "pdf_value" in line109 can actually be replaced by a string instead, and the API will still provide a filepath for me. Idk whether this is useful though)
Thanks.
Hi @Kwan Yat MOK
You can check this links:
https://www.outsystems.com/forums/discussion/76788/integrating-python-output-with-outsystems/
https://www.outsystems.com/forums/discussion/91321/is-it-possible-to-call-a-python-script-within-my-outsystems-app/
I hope this helps
Thanks
Thanks @Rupesh Patil
Integrating Python with OutSystems would be a good idea, but as we would like to use OutSystems solely so all things can be maintained in one system, I am afraid that this method may not be a solution for us.
Thanks a lot.
Just to make it clear, so you upload your file using Outsystems application and want the path to be consume in python ?
Hi @Toto ,
Sorry for not expressing clearly in my post previously.
I would like to automate the whole process in OutSystems only with no Python used.
(i.e. from generating pdf --> login to UI end point --> upload files to the end point --> receive the file path --> use the file path in another API --> output the response in OutSystems).
Thanks for your reply.
Ok,
I don't know if this will works or not, but Outsystems have PostRequest_Submit Action from dependencies HTTPRequestHandler, you can try this action to trigger the post request.
As to automate this, you can try to put the logic in the timer, so timer will trigger this automatically.
I am trying on it, but it seems that it cannot do a basic authentication, nor uploading other inputs.
I would like to input the cookies (act as authentication), as well as the binary file to the API.
Can the action do this?
I suggest you check the documentation https://success.outsystems.com/documentation/11/reference/outsystems_apis/httprequesthandler_api/#PostRequest_Submit
Also there is recommended plugin for calling HTTP programatically :
https://www.outsystems.com/forge/component-discussions/427/ardoHTTP
Maybe you can try this ?
Hi Kwan,
I don't know Python at all, but looking at the specification of "files" in the POST, I assume it's an end point expecting a multipart/form-data payload. Can you confirm that? Do you have an API description of the end point?