Mass-Enable OPTIONS method across multiple APIs?
search cancel

Mass-Enable OPTIONS method across multiple APIs?


Article ID: 251198


Updated On:


CA API Gateway


Our API Gateway team is attempting to enable CORS in our APIs in order to enable active-testing from our internally developed API documentation portal.

As part of this, we need to enable the OPTIONS method across our whole inventory of APIs in our Broadcom API Gateway.

Unfortunately it appears OPTIONS method was not enabled by default. As such, we have a few hundred APIs on which we need to enable OPTIONS method. Doing this manually, one-by-one, via Policy Manager  will take dozens of work-hours.

Is there a restman API call or some other scripted / automated method that can enable OPTIONS method en-mass for multiple APIs at once?

If so please provide some info on implementing this.


Release : 10.1

Component : API GATEWAY


Build a Restman PUT call to update a service's policy (in this case, adding the allowed method "OPTIONS")

- the original payload has some syntax issues.

It was explained that when PUT-ing an update to a service, we must first extract only the contents of the <l7:Resource> tag

(i.e. only the lines from <l7:Service...> to </l7:Service...>) of the policy XML returned by a GET call, then use only those lines as our PUT payload.

- Additionally, a xmlns tag was required to be added to the <l7:Service...> section.


1.   LAB example:


2.  From Postman using GET

3. Copy that output on a notepad ++ and edit

On this case was deleted the following lines from Original GET Response :
Line 1

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>


Line 3 to 14





    <l7:Link rel="self" uri=""/>

    <l7:Link rel="template" uri=""/>

    <l7:Link rel="list" uri=""/>

    <l7:Link rel="dependencies" uri=""/>

    <l7:Link rel="versions" uri=""/>

    <l7:Link rel="parentFolder" uri=""/>


        <l7:Service id="5084c1dda5ce5d551c79917ab684b5e5" version="2">


Notes : - Needed to change the “Item” by “Service” on Line#2 (else will send Error Regarding Bad Request id not Allowed on element). 

           - See image Above from Notepad++ comparing the original and modified file


From : 

<l7:Item xmlns:l7="">


Changed Item” by “Service” and Also Added

id="5084c1dda5ce5d551c79917ab684b5e5" version="2">  , left  as follow line :


<l7:Service xmlns:l7="" id="5084c1dda5ce5d551c79917ab684b5e5" version="2">

** version=2 , or the version your service currently has on line ServiceDetail


Example:  Deleted the empty line#1 and now Line#2 is the first one…copy all this and go to Postman

Added (Line# 13 here)



At the Bottom/end of the XML file , was deleted

Line 278 and 279



4. In Postman , we need to execute a PUT to update the Service as needed :

Below the Postman Request completed and executed :

Response must be like the showed above:


5. Confirming from Policy Manager the “OPTIONS HTTP method” was been added to the service called “soa”