This is a simple example of a REST-API client developed in python, users can use this code as a boilerplate to integrate with Ayyeka's FAI platform, example code only works with version 2.0 of REST-API.
When running the code the following steps will be executed:
- Authentication using a specified API Key, Secret in order to acquire an access token.
- Fetch and print out metadata (sites, samples).
- A loop that fetches new samples from the FAI Rest-API every 15min.
- Follow the instructions at Ayyeka Developer Portal to generate the API Key,Secret.
- Update the Program.cs with generated the API Key,Secret.
API_KEY = "API-KEY-HERE";
API_SECRET = "API-SECRET-HERE";
- We used python 3.10 with VScode.
- We used swagger-codegen to generate the API client in python.
- We used openapi3.json openapi3.0 spec file Ayyek REST-API
-
Download the swagger-codegen jar from https://swagger.io/docs/open-source-tools/swagger-codegen/
-
Run the following command:
java -jar .\swagger-codegen-cli.jar generate -i .\openapi3.json -l python -o .\gen
- In gen folder run the following command that will install the swagger_client:
python .\setup.py install