Defining our endpoints

We now need to describe our first endpoint. From the navigation on the left side of the API Editor, click Endpoints > New Endpoint. Fill in the required fields as follows.

We now need to add the parameters for the endpoint.

Note Take special note of how we defined operation parameter as Template. This corresponds to the template parameter in our endpoint URL: /{operation}

Click on Save Endpoint to save your changes to the API description.

P1: Using models as types

Defining models is a effective way to improve the usability of the SDK. Looking back at our endpoint, we notice that our operation parameter has a finite possible values.

We can represent the operation parameter as a model that encapsulates various operation attributes. From the side menu, select Models > New Model. For our example, the description of the model could be as follows:

Next we configure the fields of our model as shown below:

Click on Save Model to save your changes.

P2: Using models as types

Go back to where you defined your endpoint Calculate. To use the Operation Type model defined previously, we need to update our endpoint as follows:

Click on Save Endpoint to save this new change.

Congratulations! You have described your first API successfully. Lets return to the My APIs page and try generating an SDK for this API for your favourite platform.