TECHcommunity_SAG's Blog


TECHcommunity_SAG's Blog


Using the API Gateway Archive REST APIs to search for and download assets

TECHcommunity_SAG's photo
·Mar 2, 2023·

2 min read

products versions - API Gateway versions 10.x and up


The webMethods API Gateway provides a number of REST APIs for managing assets and the gateway itself. Among those is the Archive API, which exposes two resources to export and import an archive:

GET /rest/apigateway/archive: Retrieves the archive, which is a ZIP file that contains the selected assets and its dependent assets.

POST /rest/apigateway/archive: Imports the API Gateway archive as well as exports the assets as an archive.

The POST resource is pretty straightforward. Likewise, the GET resource, by default, takes a query string of the assets you want to archive, along with their associated options. This is all well and good, if you know the names of all the assets you want to archive. Fortunately, there is a way to use the same criteria from the Search API to create and download an archive in a single step.

Executing the GET resource using POST and the x-HTTP-Method-Override header

The API Gateway uses the x-HTTP-Method-Override header to execute a resource other than the one matching the HTTP method of the request. This allows you to, for example, execute the GET resource of a REST API while sending a payload using the POST method.


The payload

As previously mentioned, the Archive API takes the exact same search criteria in the payload as the Search API. So, for instance, if you want to download all of the threat protection policies from the gateway, you could specify it in the payload this way:

    "types": [
    "scope": {
        "attributeName": "stageKey",
        "keyword": "threatProtection"

Similarly, to download all APIs the begin with “My” you could use this payload:

    "types": ["api"],
    "condition": "and",
    "scope": [{
        "attributeName": "apiName",
        "keyword": "My.*"

As you can see, using search criteria can add a lot of flexibility to the Archive API.

Next steps

If you would like to learn more about using Gateway APIs, our YouTube channel has a short video tutorial. If you haven’t already, sign up for a fully functional free trial. See for yourself why Software AG has been named a Leader in the 2022 Gartner® Magic Quadrant™ for Full Life Cycle API Management for the fifth consecutive year.

To help you get started, here are the Archive Service and Sear Service Postman collections.

Archive API:

Search API:

Read full topic

Share this