START Component

Using the START component.

The START component is always the first component and is the entry into the service. The START component defines the service name (endpoint) and any inputs into the service. The component is configured via the Properties view when the component is selected.

Service

In this section, you define the service name, HTTP method, and description.

URI template

The URI template is the name (endpoint) of the service. For example, if the service you are building buys ice cream, then you can name it icecream.

HTTP method

Then you can select the HTTP service method the service will perform. API Express supports the following HTTP methods:

  • GET
  • POST
  • PUT
  • DELETE
  • PATCH

Description

You can also enter an optional description for the service. We recommend to enter a short description. The description will be displayed on the main API page.

Request Path Parameters

Request path parameters are part of the URL and are entered using the {...} brackets. To create one path parameter, update the URI template with the parameter inside the brackets. For example:

icecream/{id}

When you update the URL like this, the Request Path Parameters will be automatically parsed. You can enter any number of such parameters. Here is an example with two parameters:

icecream/{id}/{topping}

You can also specify the type for the path parameter. You can set the type value to String (default), Number or Boolean.

Request Query Parameters

Request query parameters are entered at the end of the URL after the ?-mark. Here is an example:

icecream?flavor=vanila&cone=yes

This example defines two request query parameters so you need to enter two parameters under the Request Query Parameters section. You can enter any number of parameters you want the service to expect.

If this is your final service, then the service URL would look like this:

https://api.appery.io/rest/1/apiexpress/api/icecream?apiKey=2bc377f7...&flavor=vanila&cone=yes

Request Header Parameters

You can specify request header parameters that the service would expect. Custom header parameters are usually named with X-header-param-name format.

Request Body

For HTTP methods POST, PUT and PATCH you can also specify a request body. The default type is JSON but you can also set it to String or x-www-form-urlencoded.

Service Component Data

The service flow makes a number of pre-built objects available that you can access from any component. Go to Components Data section to learn about these objects and how to use them.

Default Values

It's possible to set a default value for Request Path Parameters, Request Query Parameters and Request Header Parameters.

446

Default values.

When testing the service (via the Test button), any default values will be pre-filled on the test page.

If a parameter is included in a request but set to blank (empty), then the blank value will be used and it will replace the default value. To use the default value when running the service, don't include the parameter in the request.