REST API#
The kappa_sdk.RestAPI
class enables you to perform REST API calls with Kappa-Automate APIs. It can interact with APIs from any microservice and perform PUT, POST, DELETE and GET requests.
You cannot instantiate this class directly, but you can access it in two ways:
When writing a Python script with an established connection:
rest_api = connection.rest_api
When working in a user task environment, use the services variable:
rest_api = services.rest_api
Examples#
The REST API actions are organized according to the CQRS (Command-Query Responsibility Segregation) principle, divided into Commands and Queries.
Commands#
POST: Create the data
PUT: Update the data
DELETE: Delete the data
post_response = rest_api.post(ka.ServiceEnum.field, "/v2/field", dto)
put_response = rest_api.put(ka.ServiceEnum.field, "/v2/field/{fieldId}/rename", dto)
delete = rest_api.delete(ka.ServiceEnum.field, "/v2/field/{fieldId}/delete", dto)
Queries#
GET: Get the data
response = rest_api.get(ka.ServiceEnum.field, "/v2/field/{fieldId}")
Note
The kappa_sdk.ServiceEnum
class contains the list of microservices available
Warning
We recommend avoiding direct use of this REST API, as most APIs are already covered by the SDK. If you need an API that isn’t available, please contact us at support@kappaeng.com.