FTP Based Trip Integration

Purpose: The client should be able to create / close trips by uploading csv data templates to Freight Tiger's FTP server (without directly hitting any FT apis)

Service: FTP Services https://gitlab.com/ft-neo/ftp-services

Setup Steps: (Devops Guide)

  1. Devops to create a dedicated folder on FTP server for the client

  2. Create directory structure in the newly created folder as below

  1. create an FTP account for the client say rilftp (Assume, Reliance India Ltd is the client) & with a strong password

  2. Following are the sample account details (username / passwords will change client to client)

host:sftp.freighttiger.com

port:22

username:rilftp

password: ***********************

  1. Complete access to the directory created (in step 2) will be given to the account created 

  2. Add following configuration to ftp-service-config.yaml

"rilftp": "{\"host\": \"sftp.freighttiger.com\", \"port\": \"22\", \"username\": \"rilftp\", \"pwd\": \"****password******\",  \"companyId\": \"123456\"}",

 

Note: companyId in above configuration is the actual company ID from TransDB->Company table

 

FTP Service in action (Assuming above 2 setup details are followed & completed)

  1. Client needs to create a uniquely named file (Eg: CREATE_TRIP_20200514_112200.csv) with one or more trip details & upload it to following directory on FTP server (Refer templates)

/open_requests/create_trip

  1. Client can upload such files time to time as soon as they have trip creation data  (Preferably every  5 to 15 mins)

  2. The job set up in part 2, will keep on scanning for new files every 10 mins & try to process them.

  3. Processing involves reading files, validating & generating payloads which are internally sent to FT apis for trip creation.

  4. During pre-processing / post-processing if any error occurs due to exception or validation, a new file with the exact same name is generated under the following directory with trip details of only faulty trips & respective failure reasons.

/erred_requests/create_trip/20200514/CREATE_TRIP_20200514_112200.csv

Note: /20200514/ is auto generated folder as per current date (YYYYMMDD)

  1. If trip(s) is/are generated successfully with a response containing tripId(s), a new file with the exact same name is generated under the following directory with trip details of only successful trips & respective feed Unique Ids (if provided in template)

/processed_requests/create_trip/20200514/CREATE_TRIP_20200514_112200.csv

Note: /20200514/ is auto generated folder as per current date (YYYYMMDD)

  1. Also post file processing, irrespective of success / failure of the trips, a duplicate dump of the file will stored in below directory as a backup.

 

/archived_requests/20200514/CREATE_TRIP_20200514_112200.csv  Current

 

/archived_requests/create_trip/20200514/CREATE_TRIP_20200514_112200.csv (we        

             will be changing to this path during the in next development cycle)

  1. Client may poll over any of the directories if it needs to pull the processed / errored files & use / process at his end.

  2. Exact process is followed for trip closure. Just that we do not need a separate job for trip closure. After the job processes the create-trip files, it picks up the close-trip files & process.

 

 

Post your questions in the comment box to get answers from the experts who watch this page.

For engineering support: visit FT Support