How to read JSON files from FTP server (General question)

Hi Team,

How to read JSON files from the FTP server to create a ticket serverless event?

Thank you,
Siva

Hey Siva,

Can you help me understand the use case? Is it that you want to read a file when the app receives an ‘onTicketCreate’ event? Or perhaps you are trying to poll the FTP server JSON files to create a ticket? If you can explain your use case, the team can suggest you solutions on how to proceed :slightly_smiling_face:

3 Likes

Hi @prithvijit-dasgupta,

Thanks for picking up this request, and the customer requirement is given below.

The customer will upload a set of JSON files to an FTP server.
Whenever a new JSON file is uploaded to the FTP server the Freshdesk custom app should get the data from the JSON file and create a ticket in the customer Freshdesk account.

For this requirement, our approach is to use the polling option to get the JSON from the FTP server, then download the JSON file to the app location and read the content and create a Freshdesk ticket.

In the above approach, we facing the FTP server timeout and performance issue and also cannot read the JSON file in the FTP location itself.

I hope this information will suffice for you and please let me know if you need any other details.

Thank you,
Siva

1 Like

Hi @Siva

This is a very interesting scenario.

Considering the 5 sec timeout that we have in serverless apps, batch processing and polling of large numbers of files seems to be an odd approach.

My initial suggestion would be to run a scheduled event to poll a certain number of file data and then to asynchronously trying to send the request to Freshdesk APIs (if the result of the operation is not needed).

My second approach to the problem would be to somehow use the external events feature . You could try setting up a ‘event posting middleware’ (basically, whenever a file is placed in the server the data can be read by this middleware and the data can be pushed to Marketplace External Events hook). Instead of a polling the FTP server, this would ensure that the pushing of data is controlled by the FTP server + middleware and also, it would solve the issue of timeout in serverless apps.

I would like to know more about what you mean by

In the above approach, we facing the FTP server timeout and performance issue and also cannot read the JSON file in the FTP location itself.

2 Likes

Hi @prithvi,

Thanks for the approach, we will check and let you know.

Thanks again.
Siva

This topic was automatically closed after 13 days. New replies are no longer allowed.