How to download a file using REST service

Hello,

one of the REST webservice returns the file. is there any way I can download that in knowledge center and show the link on SAIL form ?

Have anyone implemented this kind of solution ?

Thanks,

Tushar

  Discussion posts and replies are publicly visible

Parents
  • 0
    Certified Lead Developer

    Hi  a quick question here:

    Is this REST API defined in Appian using WEB-API or in some Third-Party system and you are trying to consume it and want to download the document as part of this activity?

    Scenario - 1 (When an API is defined in Appian and you are expecting some third-party system to push the data into it)

    • Define a Web-API having it's method as POST
    • Notify third party system to push the data in JSON format into it's body, where the body will contain the file URL identified with a key
    • Start a process in Appian and pass the body as a parameter to this process
    • Parse the File URL inside the process
    • Use HTTP File Download OOTB Smart Service to download this file and store it into the KC (provide the authentication, if required)
    • Once you have the document available, you should be able to show the link over SAIL

    Scenario - 2 (When there is an API defined by some third party system and Appian need to consume it)

    • You can ask the service provider to enable a GET API to return a JSON response which should include their file url 
      • This depends upon, whether the service provider agrees to enable a GET API for you or not
    • Consume this API using an Integration Object / by any other preferred way(provide the authentication, if required)
    • Parse the response and find the document URL
    • Call this integration object in a process and use HTTP File Download OOTB Smart Service to download this file and store it into the KC (provide the authentication, if required)
    • Once you have the document available, you should be able to show the link over SAIL

    Out of interest, why do you want store these documents into Appian? As you know that Appian is not a Content Management System and hence i would not recommend you to store huge volume of documents into KC, because this may result into server performance slowness. 

    You should consider any content management system (if possible) such as Alfreso, Sharepoint or Azure and use their unique link generated against each document upload, to shown it on Appian SAIL UI.

    Hope this will help.

Reply
  • 0
    Certified Lead Developer

    Hi  a quick question here:

    Is this REST API defined in Appian using WEB-API or in some Third-Party system and you are trying to consume it and want to download the document as part of this activity?

    Scenario - 1 (When an API is defined in Appian and you are expecting some third-party system to push the data into it)

    • Define a Web-API having it's method as POST
    • Notify third party system to push the data in JSON format into it's body, where the body will contain the file URL identified with a key
    • Start a process in Appian and pass the body as a parameter to this process
    • Parse the File URL inside the process
    • Use HTTP File Download OOTB Smart Service to download this file and store it into the KC (provide the authentication, if required)
    • Once you have the document available, you should be able to show the link over SAIL

    Scenario - 2 (When there is an API defined by some third party system and Appian need to consume it)

    • You can ask the service provider to enable a GET API to return a JSON response which should include their file url 
      • This depends upon, whether the service provider agrees to enable a GET API for you or not
    • Consume this API using an Integration Object / by any other preferred way(provide the authentication, if required)
    • Parse the response and find the document URL
    • Call this integration object in a process and use HTTP File Download OOTB Smart Service to download this file and store it into the KC (provide the authentication, if required)
    • Once you have the document available, you should be able to show the link over SAIL

    Out of interest, why do you want store these documents into Appian? As you know that Appian is not a Content Management System and hence i would not recommend you to store huge volume of documents into KC, because this may result into server performance slowness. 

    You should consider any content management system (if possible) such as Alfreso, Sharepoint or Azure and use their unique link generated against each document upload, to shown it on Appian SAIL UI.

    Hope this will help.

Children
No Data