# URL

## Introduction

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

<div align="left"><figure><img src="/files/ST615KL83Z1EYoqDdJ9u" alt=""><figcaption></figcaption></figure></div>

## Endpoint URL

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

<div align="left"><figure><img src="/files/TC43Rv7BTB6szSo6wzJq" alt=""><figcaption></figcaption></figure></div>

...and then add the required `URL`:

<div align="left"><figure><img src="/files/xSsshUDOZDbEMbHXApQz" alt=""><figcaption></figcaption></figure></div>

{% hint style="warning" %}
The maximum number of characters for an endpoint URL is 255. If you require a longer URL, consider defining elements as [parameters](#endpoint-parameters).
{% endhint %}

## Endpoint parameters

You can define two types of parameters:

* [Required](#required-parameters) parameters are added as key pairs and are always applied for the endpoint, whenever it is used. Use the top panel to add the required parameters.
* [Optional](#optional-parameters) parameters are displayed as [connection shape](/product-documentation/process-flows/building-process-flows/process-flow-shapes/standard-shapes/connector-shape.md) filters, so users can apply their own values when using this endpoint as a data source in [process flows](/product-documentation/process-flows/about-process-flows.md). Use the lower panel to add optional parameters.

Any parameters you add (to either panel) here are **automatically** appended to the existing [endpoint URL](/product-documentation/developer-hub/connector-builder/building-your-own-connector/4-endpoints.md#configuring-an-endpoint) as a query parameter when this endpoint is used in [process flows](/product-documentation/process-flows/about-process-flows.md).

### Required parameters

If you have parameters that must always be passed in the endpoint request URL, add them to the top panel. Any `required` (i.e. 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](/product-documentation/process-flows/about-process-flows.md).

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`:

<div align="left"><figure><img src="/files/dc8FFBBJG5QcDkzlEVkJ" alt=""><figcaption></figcaption></figure></div>

By adding this as a `required` parameter for the endpoint, this query will be applied whenever this endpoint is added to [process flows](/product-documentation/process-flows/about-process-flows.md) (via a [connection shape](/product-documentation/process-flows/building-process-flows/process-flow-shapes/standard-shapes/connector-shape.md)). So, for our example, the actual endpoint used will be:

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

{% hint style="info" %}
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?](#what-if-i-want-to-force-users-to-enter-their-required-value-for-a-url-parameter)
{% endhint %}

### Optional parameters

`Optional` parameters are available for your users to update with their own required values, in process flows.&#x20;

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](/product-documentation/process-flows/about-process-flows.md) includes a [connection shape](/product-documentation/process-flows/building-process-flows/process-flow-shapes/standard-shapes/connector-shape.md) which is configured to use this endpoint, users can see/update filter fields for any `optional` URL parameters defined for the endpoint. For example, let's add an optional parameter for `product_type`:

<div align="left"><figure><img src="/files/dcGNzvpAsWX4gFwW4FKy" alt=""><figcaption></figcaption></figure></div>

<details>

<summary><img src="/files/VDlwYFR9Br2ScHUDewYv" alt="" data-size="line"> What does the 'use as default' option do?</summary>

If you toggle the `use as default option` to `on`, this parameter will be displayed for users to see/update when they access a saved [connector shape](/product-documentation/process-flows/building-process-flows/process-flow-shapes/standard-shapes/connector-shape.md) - for example:

![](/files/wAQS118xH12YrtNPfXxf)

If this option is `off`, users won't see the parameter in connector shapes unless they select the `add filter` button and select it - for example:\
\
![](/files/BgvvmnBMem2QzQl8ehSh)

</details>

Now, if we configure a [process flow connection shape](/product-documentation/process-flows/building-process-flows/process-flow-shapes/standard-shapes/connector-shape.md) with this endpoint, a `product_type` filter option is available, so the person running this flow can choose to use it if they wish:

<figure><img src="/files/mpYmjCTGh1lBefLnXK37" alt=""><figcaption></figcaption></figure>

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.&#x20;

{% hint style="info" %}
These are optional parameters - users are not required to provide a value for the associated connection shape in process flows.&#x20;
{% endhint %}

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

[Optional URL parameters](#optional-parameters) are just that - [process flow](/product-documentation/process-flows/about-process-flows.md) 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 follow the steps below.

{% stepper %}
{% step %}
**Add a required endpoint variable**

Add a 'required' [endpoint variable](/product-documentation/developer-hub/connector-builder/building-your-own-connector/4-endpoints/endpoint-options/endpoint-variables.md) for the field that you want to force users to update in process flows.

<details>

<summary><img src="/files/JOYoP4EdSu7WJ3CMdAAS" alt="" data-size="line"> Show me</summary>

![](/files/eVOnArf5hcKgSiwVrAXg)

</details>
{% endstep %}

{% step %}
**Update the endpoint URL**

Update the [endpoint URL](/product-documentation/developer-hub/connector-builder/building-your-own-connector/4-endpoints.md#configuring-an-endpoint) to include a query for this variable.

<details>

<summary><img src="/files/JOYoP4EdSu7WJ3CMdAAS" alt="" data-size="line"> Show me</summary>

![](/files/X9bCGj9olQJ75l8vs6Gn)

</details>
{% endstep %}

{% step %}
**Add a default URL parameter**

Add a [default URL parameter](#default-parameters), specifying your endpoint variable (added in step 1) as the parameter value.

<details>

<summary><img src="/files/JOYoP4EdSu7WJ3CMdAAS" alt="" data-size="line"> Show me</summary>

![](/files/9U3Ox0cGDLKJTbsu7bkS)

</details>

Now, when a user adds this endpoint to a [connection shape](/product-documentation/process-flows/building-process-flows/process-flow-shapes/standard-shapes/connector-shape.md) in a [process flow](/product-documentation/process-flows/about-process-flows.md), they must update this variable field before proceeding.

<details>

<summary><img src="/files/JOYoP4EdSu7WJ3CMdAAS" alt="" data-size="line"> Show me</summary>

![](/files/lfrpKW7hI49U5kugiOWF)

</details>
{% endstep %}
{% endstepper %}

## More information

Techniques for adding URL parameters are the same as all other types of parameters that you may encounter in the connector builder. For information, please see [Working with parameters](/product-documentation/developer-hub/connector-builder/building-your-own-connector/techniques-for-working-with-variables-and-parameters/working-with-parameters.md).


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://doc.wearepatchworks.com/product-documentation/developer-hub/connector-builder/building-your-own-connector/4-endpoints/endpoint-options/url.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
