Hi Andrey,
The second part of the Routing is only applicable if you have selected the options
override template policy. By Default the template (encapsulation) in your case is Standard Template API Key will be applied. and your response will be on a successful run.
You will have to add an additional parameter in the input to pass input to MySQL from
e.g. if you want to use a variable in API key in you MySQL template you expose it as an Output variable in API Key Encapsulation and use the same variable as input in the MySQL template.
Did you also take a look at PAPI metric API as it can be called for billing purpose
Portal Metric Api
------------------------------
Pre-Sales Consultant
CA Southern Africa
------------------------------
Original Message:
Sent: 05-07-2020 09:12 AM
From: Andrey Malakeev
Subject: Policy allocation on API deployment
Hi colleagues!
We prepare a demo for our customer on API monetisation with Layer 7 API Gateway. We created an included policy fragment (Store to MySQL) to store data from API response to DB. The idea is to demonstrate capability to form data for billing. Then we set it as a Portal publishable fragment and created encapsulated assertion from it. Now it is available in Portal as a template policy and we can deploy API with it. When API is deployed this policy is placed in top part of service definition. That is before the API call assertion (Route via HTTP …). But our fragment is to work with request results. The question is - how to place our policy AFTER the API call. Is it possible to manage the place where policy is placed in service definition on API deployment?
A notice - if Standard policy Template -API key is also included before our Template - everything works cause the "Route via HHTP" assertion is executed inside Standard policy Template
Bet regards
Andrey