Technology Blogs by SAP
Learn how to extend and personalize SAP applications. Follow the SAP technology blog for insights into SAP BTP, ABAP, SAP Analytics Cloud, SAP HANA, and more.
Showing results for 
Search instead for 
Did you mean: 
Have you ever created a bunch of Policies and seen that they are being repeatedly used in many of your API Proxies?

Have you ever wondered if someone could share with you their Policy solutions so that you don’t have to re-invent the wheel to solve an old problem?

Have you ever looked out for best practice recommendations on implementing solutions using Policies?

If your answer to at least one of the above is ‘yes’, then jump into using Policy Templates!

As the name suggests, Policy Templates offer you a capability to Create and Save a Policy sequence modeled in an API Proxy and Apply the same on any other API Proxy.


Create & Apply a Policy Template

 A step-by-step guide on creating your first Policy Template and applying it on API Proxies has been wonderfully explained by svenhuberti in this blog.

You can Apply as many Templates as you want to an API Proxy, the Policies get appended towards the end of the flow. You are free to modify the Policies after the Apply function. Note that the Template acts as a ‘Copy by Value’ function which means there is no reference maintained to the original Template object in the API Proxy. Hence any subsequent changes to the Template do not have any impact on the API proxies that had already made use of the Template.

Export & Import of a Policy Template

In case you need the Policy Templates created in one API Portal instance to be available for API Proxies in another instance, you can use the Export option to download a zip from the source and Import the zip as is at the target. That’s it 🙂



Policy Template Lifecycle

It is possible to delete an unwanted Policy Template from your API Portal.


In case you want to modify an existing Policy Template, open the API Proxy which is using it, perform the necessary changes to the Policies and the use the ‘Update’ option as shown below. This will overwrite the existing Template content with the content from the API Proxy.


However, the update or delete functions on a Template have no impact on the API Proxies where it has already been applied.

Pre-shipped Policy Templates from SAP

By now, you must have realized how powerful this capability is which helps you create custom Templates for your use. Now comes the icing on the cake – SAP is committed to ship Policy Templates as part of API Packages on API Business Hub! The first set of content is already published and can be accessed via the following links:

  1. Security best practices

  2. Cross Origin Resource Sharing

  3. Hybris Connectivity

  4. SAP Cloud Platform Connectivity

  5. Concur Connectivity

Apart from looking at the Template content, you can see that you have an option to Download it as a zip. This can now be imported in your API Portal and put to use in your own API Proxies.

In my next blogpost, I will show you how you could browse through the API Packages in the API Business Hub from your API Portal and easily copy the Policy Templates for your use with a single click!

So, stay tuned 🙂