All our REST services are documented using the OpenAPI spec + Swagger.
- Data - endpoints for managing Sample data.
- User - endpoints for managing users and permissions.
- Billing - endpoints for calculating costs.
Using an OpenAPI client generator, it is possible to generate client libraries for many common programming languages.
First, open the relevant REST API browser by clicking a service above. In this scenario we will open the Data service. Then, click on the
swagger.json link to download the OpenAPI document.
Alternatively you can use the CLI to download an OpenAPI document:
$ wget https://api.splashback.io/data/swagger/v1/swagger.json
To install the OpenAPI generator CLI and generate a Python client, run the following commands:
$ npm install @openapitools/openapi-generator-cli -g$ npx @openapitools/openapi-generator-cli generate -i swagger.json -g python --package-name splashback_data -o splashback_data
swagger.json with the path to the OpenAPI document you downloaded.
-g python option selects the generator. For example, to generate a PHP client library, use
-g php instead.
-o splashback_data option sets the output path.
--package-name splashback_data option should be set to whatever you would like to call the library. This will show up in your codebase.