Software AG Products 10.5 | Using API Gateway | REST APIs in API Gateway | Transaction Data
 
Transaction Data
API Gateway provides the capability to query the API transactions. API Transactions are generated (as events) every time an API invocation happens. API Transactions may contain the details about the invocation such as request and response headers, request and response payloads, consumer applications and so on. API Provider may choose to store these events to one or more destinations by using Log Invocation Policy. API Gateway provides different destination options to the API Provider (like API Gateway's own data store, relational databases, Elasticsearch, and so on) where the events can be stored. By default, API Gateway is chosen as a storage destination for these events. This REST API queries for the transactions data only from the API Gateway's default datastore. There are multiple use cases where you can use this transactions data. For instance, you can integrate this API with your billing system wherein this transactional data can be used to compute the usage history of your API for different consumers for monetization usecases. In other scenarios, the data extracted from this service can be used for custom report generation.
API Gateway provides the following REST API and the resources to retrieve the transaction events data:
*GET/rest/apigateway/transactionEvents/_search: Retrieves the transaction events for a given API, Application, Plan or Package for a specific period of time. Multiple request parameters of this method provide options to specify the request criteria to match the expected result and most of these input parameters support regular expression in their values. Along with the mandatory parameters, fromDate and toDate, any one of the other filter criteria should be passed in the request.
*GET/rest/apigateway/transactionEvents/_count: Retrieves the number of transaction events for a given API, Application, Plan or Package for a specific period of time. Multiple request parameters of this method provide options to specify the request criteria to match the expected result and most of these input parameters support regular expression in their values. Along with the mandatory parameters , fromDate and toDate, any one of the other filter criteria should be passed in the request.
For details about the REST API, see the APIGatewayTransactionDataService.json at Install directory/IntegrationServer/instances/default/packages/WmAPIGateway/resources/apigatewayservices.
For sample payloads, see https://github.com/SoftwareAG/webmethods-api-gateway/blob/master/apigatewayservices/postmancollections/apis/transaction-data-service/TransactionDataService.json.