Skip to content

REST Service Invocation

Backendless Console provides a visual interface for invoking service operations via the generated REST interface. To invoke a service operation, click its name. Console renders operation arguments based on the argument type information from the service code.

Important

Backendless Console uses the generated REST API when invoking service methods. As a result, you can also see the details of an invocation using the Network tab in the browser's developer tools.

HTTP GET operations

Parameters for the HTTP GET operations must be sent as URL's query params. Consider the following example:

public String getGreeting( String guestName )
{
  // skipped for brevity
}

Since the method name starts with "get", Backendless will generate an HTTP GET route for the operation. When the method is selected in console, the parameter is rendered as shown below:get-method-java-v4.zoom90

HTTP POST|PUT|DELETE operations

Parameters for POST`PUT\DELETE` operations must be sent in the payload/body of an HTTP request. Console renders the parameters based on the operation's formal argument list. Consider the following example:

public void postNote( String message, boolean important )
{
  // skipped for brevity
}
Backendless creates a REST route based on the method name. Method name starts with "add" and per the REST Routes rules, Backendless will generate an HTTP POST route for the operation. For methods with more than one argument, Backendless combines them into a JSON object on the request side:

invoke-post-method-v4

Clicking the body schema area copies its contents into the body field where it can be edited. To invoke the method click the INVOKE button which sends a service invocation request to Backendless.