Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  1. Log in to the Management Console UI (https://localhost:9443/carbon) using admin/admin credentials. Then, select Source View sub menu under the Service Bus menu.

  2. Source view contains the entire configuration of the API Gateway. You can find sequences, filters, properties, APIs etc. defined there. Search for the name of the API you want, and edit its content wrapped by the <api></api> elements.

    Note
    iconfalse

    You should not remove the default filter mediator and handler configurations in your API. They are needed for routing requests based on the throttling/security policies. If you want to add a custom mediator in the insequence path of a request, add that inside the filter mediator configuration as shown in the following example.

    Code Block
    languagehtml/xml
    <filter source="$ctx:AM_KEY_TYPE" regex="PRODUCTION">
       <then>
          <class name="org.wso2.carbon.custommediator.CustomDataMediator"/>
          ........................
       </then>
    </filter>
  3. Click Update to save your changes.

    Alternatively, you can also select the APIs sub menu under the Service Bus menu. This allows you to isolate and edit a specific API rather than viewing the entire source code.
    Image Removed
  4. The Deployed APIs page opens. From there, you can select an API and click the Edit link associated with it.
  5. The Edit API page opens. You can switch to its source view to edit its configuration code.

    Image Removed

  6. After editing the file, save and restart Restart the server.
Info
iconfalse
Instead of editing the configuration through the UI, you can directly edit the file saved in <APIM_HOME>/repository/deployment/server/synapse-configs/default/api folder as well.

Deleting an API

...