Add an operation

In this topic, you learn how to add an operation to an API.

In each operation, you define a method to interact with the data of the API. You can define multiple operations with different methods and parameters for requests.

Prerequisites

Procedure

  1. In the Operations tab, select the button to add an operation.

  2. In Path, enter a slash and the name of an end path for the external API, for example, /planets.

  3. In Method, select a method from the list, for example GET:

    GET

    Read and retrieve data from the resource.

    PUT

    Update existing data in the resource.

    POST

    Add new data to the resource.

    DELETE

    Delete data from the resource.

    HEAD

    Read and retrieve data without the response body. Unlike GET, HEAD retrieves the response header only.

    OPTIONS

    Read and retrieve all operations and content types that are available without retrieving specific data.

    PATCH

    Apply partial changes to an operation. Unlike PUT, PATCH changes only part of the data instead of replacing it entirely.

  4. In Pre-Request Hook Script, you can select a script that will trigger each time the operation is called.

  5. In Endpoint Override, you can define a new endpoint that overrides the system’s endpoint.

  6. In Restrict Access, you can define which role or roles can access the API.

    You can only restrict access if you have defined roles before with the Role service.
  7. Enter a short Summary and a longer Description to provide context information about the operation.

  8. In Tags, enter keywords that describe the resource. In this way, you can categorize your operations by tags.

  9. Activate any of the following:

    Trace Operations

    Trace request you or others make to the API in API Trace.

    Save Request Body

    When you trace operations, the request details are traced, too.

    Send Credentials (cookie)

    Send cookie information with the API call.

    Use Example Data

    Use example data to run an unfinished API in the App Designer. Example data is not traced in API Trace or API Client.

  10. Select Save.

Results

  • You have added an operation with a method.