OAS:OpenAPI Editor/Callbacks/Add Callback

From Remain Software

Add Callback

In OpenAPI 3 specs, you can define callbacks – asynchronous, out-of-band requests that your service will send to some other service in response to certain events. This helps you improve the workflow your API offers to clients. A typical example of a callback is subscription functionality – users subscribe to certain events of your service and receive a notification when this or that event occurs. For example, an e-shop can send a notification to the manager on each purchase. These notifications will be “out-of-band”, that is, they will go through a connection other than the connection through which a visitor works, and they will be asynchronous, as they will be out of the regular request-response flow. In OpenAPI 3, you can define the format of the “subscription” operation as well as the format of callback messages and expected responses to these messages. This description will simplify communication between different servers and will help you standardize the use of webhooks in your API.

Add Global Callback

To add a global callback, select the Paths tab at the bottom. Select the tab Global Callbacks then click the addition button (+) in the local (top-right) toolbar.

Oas3 add global callback.png


Add Method Callback

You can define a new callback or refer to an existing global one to use it within a method.

To add a callback, click the the addition button (+) or New Callback from the drop-down menu. To refer to a global one, select the Refer to Global Callback from the drop-down menu. Oas3 add callback.png


Add Callback Path

To add a callback path, click the Add Callback Path link from the local menu within the callbacks tab.


Oas3 add callback path.png