URL

Introduction

The endpoint URL page is used to define the HTTP method and URL to be used, and any required URL parameters:

Endpoint URL

To add an endpoint URL, you must select the appropriate HTTP method:

...and then add the required URL:

Endpoint parameters

You can define two types of parameter:

  • Required parameters are added as key pairs and are always applied for the endpoint, whenever it is used. Use the top panel to add required parameters.

  • Optional parameters are displayed as connection shape filters, so users can apply with their own values when using this endpoint as a data source in process flows. Use the lower panel to add optional parameters.

Any parameters that you add (to either panel) here are automatically appended to the existing endpoint URL as a query parameter when this endpoint is used in process flows.

Required parameters

If you have parameters that must always be passed in the endpoint request URL, add them to the top panel. Default parameters are added as key pairs, and are passed straight into requests - users are never asked to provide values for these in process flows.

In the example below, our endpoint URL is set to GET all products, but we are adding a default URL parameter to add a query which will only retrieve products with a product_type of snowboard:

By adding this as a default URL parameter for the endpoint, this query will be applied whenever this endpoint is added to process flows (via a connection shape). The actual endpoint used will be:

https://parseapi.back4app.com/classes/product?product_type=snowboards

You can define static values for a default URL parameter, or use a variable. For an example of where variables might be useful here, see What if I want to force users to enter their required value for a URL parameter?

Optional parameters

Optional parameters are available for your users to update with their own required values, in process flows.

If we consider the example above - we are always restricting our 'GET all products' endpoint to return only products with a product_type of snowboard. But suppose we wanted to allow users to choose a product_type at the point they are running a process flow?

When a process flow includes a connection shape which is configured to use this endpoint, users can see/update filter fields for any optional URL parameters that have been defined for the endpoint. For example, let's add an optional parameter for product_type:

Now if we configure a process flow connection shape with this endpoint, a product_type filter option is available, so the person running this flow can choose to use it if they wish:

When a process flow runs for this connector, associated API requests are injected with the user-provided URL parameter value wherever a {{product_type}} parameter is found.

These are optional parameters - users are not required to provide a value for the associated connection shape in process flows.

What if I want to force users to enter their required value for a URL parameter?

Optional URL parameters are just that - process flow users can choose to add a parameter value if they wish. If a user doesn't choose to update an optional URL parameter field, then no query is applied.

However, there may be scenarios where you need to ensure that a URL parameter is always provided by users running a process flow. For this, a slightly different approach is needed - in this case, you would:

Step 1 Add a 'required' endpoint variable for the field that you want to force users to update in process flows.

Step 2 Update the endpoint URL to include a query for this variable.

Step 3 Add a default URL parameter, specifying your endpoint variable (added in step 1) as the parameter value.

Step 4 Now when a user adds this endpoint to a connection shape in a process flow, they must update this variable field before proceeding.

More information

Techniques for adding URL parameters are same as all other types of parameters that you may encounter in the connector builder. For information about these options please see the Working with parameters page.

Last updated