This example shows you how to use the ilicop API with FME.
- FME Desktop 2020.1.3.0 was used.
- Download Workbench file
Use the POST Upload endpoint to submit a xtf-file for validation. Use a HTTPCaller transformer with the following options:
HTTP Client Options are as followed:
- Save Cookies: No
- Follow Redirects: No - do not follow redirects
- Verify SSL certificates: No
- Connection Timeout Length (seconds): 60
- Transfer Timeout Length (seconds): 90
File Upload - MIME Type: application/octet-stream
Use a JSONExtractor Transformer to get the jobid as followed:
The validation starts as soon as the Interlis file was uploaded. Use the GET Status endpoint to check status of the validation. Bigger files take some time to validate. Use a custom Loop transformer to check status as long as it is still beeing processed.
Use a Decelerator transformer to get a request every 5 seconds:
- Processing Slowdown Method: Per Feature Delay
- Delay Per Feature (Seconds): 5
Use a HTTPCaller transfomer to request job status:
- Request URL: https://ilicop.ch/api/v1/status/@Value(jobid)
- HTTP Method: GET
Use a JSONExtractor transformer to receive status as followed: '''json["status"]'''
Eventually use a Tester transformer to loop as long as status is 'processing'.
Now use a tester transformer to check if data is valid. If status is 'completed' proceed with valid data e.g. publication. If status is 'completedWithErrors' download log files to detect errors and stop process with a Terminator transformer:
Use a HTTPCaller transfomer to download log files: