Adding Resources and Methods

A REST API is built around the concept of resources. A resource is any information that can be named such as a document or an image, a temporary service such as today’s weather in Los Angeles, a collection of other resources, a non-virtual object, and so on. In REST, a resource is always associated with a set of methods that operate it. The supported methods are GET, DELETE, PUT, and POST.

After adding the API, you can model the API by adding resources and methods to it.

To add resources and methods, complete these steps:

  1. In the left Resource section, click Add Resource.
  2. In the displayed Add a resource and methods dialog, enter a resource path that starts with a slash, and select one or more methods. Click Save.

  3. (Optional) In the left Resource section, click an added method and click to add a tag for the operation.

    Tags can be used for logical grouping of operations by resources or any other qualifier. By default, no tag is added for each operation.

  4. (Optional) In the Method Information section, click the Add an operation description link to add a description for the selected operation.

Editing Resources

Use the following options to edit an added resource:

  • Move the mouse pointer over the resource and click Edit to change the resource path. Ensure that the resource path is unique.

  • Move the mouse pointer over the resource and click to delete the resource.

  • Click the plus icon to add a method.

Editing Methods

Use the following options to edit an added method:

  • Move the mouse pointer over the method and click Change method to change the method. The method that is grayed out indicates that the method is already added.
  • Move the mouse pointer over the method and click to delete the method.

What to Do Next

Adding and Editing Request Parameters