> For the complete documentation index, see [llms.txt](https://docs.flexmoney.uk/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.flexmoney.uk/documentation/draftbit/rest-services-and-endpoints.md).

# REST Services & Endpoints

The Data tab on the left-hand side of the Builder is the central location for creating and managing APIs, Services, and Endpoints.

![](https://files.readme.io/0d12933-dataservices.gif)![](https://files.readme.io/0d12933-dataservices.gif)

Here is where you can store your own REST API to be used throughout your app. Saving your API here allows you to easily re-use it throughout your app as opposed to reconfiguring requests on a screen-by-screen basis with the Fetch component.

As of now, you are able to set up a basic REST API connection. GraphQL, Airtable, Firebase and Example Data integrations will be available soon. Click the links to upvote the features on our [roadmap](https://roadmap.draftbit.com/features) which will notify you about the feature's progress.

To add a new service, click the Data button in the left-hand column of the builder. Click 'Rest API' under the `ADD A SERVICE` header. Use the configuration options below to set up your API.

![](https://files.readme.io/0aba34b-add-rest.png)![](https://files.readme.io/0aba34b-add-rest.png)

| Parameter        | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| ---------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| **Name**         | The name of the Service to be displayed in the menu.                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| **Base URL**     | *Cannot contain `/`*                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| **HTTP Mode**    | <p><code>cors</code>: Allows cross-origin requests, for example to access various APIs offered by 3rd party vendors.<br> <code>no-cors</code>: Prevents the method from being anything other than HEAD, GET or POST, and the headers from being anything other than simple headers.<br> <code>same-origin</code>: If a request is made to another origin with this mode set, the result is simply an error. You could use this to ensure that a request is always being made to your origin.</p> |
| **Credentials**  | <p><code>include</code>: Always send user credentials (cookies, basic http auth, etc..), even for cross-origin calls.<br> <code>omit</code>: Never send or receive cookies.<br> <code>same-origin</code>: Send user credentials (cookies, basic http auth, etc..) if the URL is on the same origin as the calling script.</p>                                                                                                                                                                    |
| **Fetch Policy** | <p><code>cache-and-network</code>: Keeps the cache up-to-date with what is on the server.<br> <code>cache-first</code>: The default. Uses quick response times for queries over getting the most up-to-date data<br> <code>cache-only</code>: Avoids making any network requests. If the data you are querying is not available in the cache, it will throw an error.<br> <code>network-only</code>: Shows the most up-to-date information over quick responses.</p>                             |
| **Lazy Request** | Enable so that the data loads only when requested                                                                                                                                                                                                                                                                                                                                                                                                                                                |

`Accept: application/json` and `Content-Type: application/json` are the default headers in each REST API configuration. You can also add any [Global Variables](https://docs.draftbit.com/docs/global-variables) you've saved by clicking the '+' in the top right corner, giving the Header a name, and selecting your Global Variable from the dropdown.

![](https://files.readme.io/f87661a-authorization.gif)![](https://files.readme.io/f87661a-authorization.gif)

Once you've selected the Service, click the 'Edit Service' on the right of the Service's name

![](https://files.readme.io/72841b8-Edit_Service.png)![](https://files.readme.io/72841b8-Edit_Service.png)

To delete a Service, click the three dots ("...") next to the name and click 'Delete

![](https://files.readme.io/344409e-Delete_Service.png)![](https://files.readme.io/344409e-Delete_Service.png)

After you've created a new Service, you'll be prompted to add new Endpoints for your service. Configuring endpoints in this menu will allow you to easily reference and re-use endpoints throughout your app.

An API endpoint is point of entry between an API and a server. The endpoint defines what information you're accessing from your API.

In this section, you're also able to add navigation params which are what will allow you [pass data](https://docs.draftbit.com/docs/passing-data) between screens. You can create a navigation param by enclosing the variable you'd like to pass inside of double brackets ( ex. `{{VARIABLE}}`).

To add an endpoint, simply click the 'Create new endpoint' button.

![](https://files.readme.io/ddaaf2c-new_endpoint.gif)![](https://files.readme.io/ddaaf2c-new_endpoint.gif)

| Parameter         | Description                                                                                                                    |
| ----------------- | ------------------------------------------------------------------------------------------------------------------------------ |
| **Path & Params** | Define the path of the endpoint and/or add a navigation param for [Passing Data](https://docs.draftbit.com/docs/passing-data). |

Click on the name of the endpoint in the `ENDPOINTS` section to be taken to the configuration screen.

To delete an endpoint, click the three dots ("...") next to the name and click 'Delete'

![](https://files.readme.io/134e083-Screen_Shot_2020-08-14_at_6.04.02_PM.png)![](https://files.readme.io/134e083-Screen_Shot_2020-08-14_at_6.04.02_PM.png)

[MDN Docs - Request.mode](https://developer.mozilla.org/en-US/docs/Web/API/Request/mode)\
&#x20;[MDN Docs - Request Credentials](https://developer.mozilla.org/en-US/docs/Web/API/Request/credentials)\
&#x20;[Understanding Apollo Fetch Policies](https://medium.com/@galen.corey/understanding-apollo-fetch-policies-705b5a)\
&#x20;[Endpoint – What is an API Endpoint?](https://rapidapi.com/blog/api-glossary/endpoint/)\
&#x20;[Passing parameters to routes](https://reactnavigation.org/docs/params/)

![](https://cdn.readme.io/img/book-icon.svg?1613687634098) Updated 6 months ago

* [Table of Contents](/documentation/draftbit/rest-services-and-endpoints.md)
  * &#x20;[Services](/documentation/draftbit/rest-services-and-endpoints.md#services)
    * [Adding a Service](/documentation/draftbit/rest-services-and-endpoints.md#adding-a-service)
    * [Configuration](/documentation/draftbit/rest-services-and-endpoints.md#configuration)
    * [Headers](/documentation/draftbit/rest-services-and-endpoints.md#headers)
    * [Editing a Service](/documentation/draftbit/rest-services-and-endpoints.md#editing-a-service)
    * [Deleting a Service](/documentation/draftbit/rest-services-and-endpoints.md#deleting-a-service)
  * &#x20;[Endpoints](/documentation/draftbit/rest-services-and-endpoints.md#endpoints)
    * [Adding an endpoint](/documentation/draftbit/rest-services-and-endpoints.md#adding-an-endpoint)
    * [Configuration](/documentation/draftbit/rest-services-and-endpoints.md#configuration-1)
    * [Editing an endpoint](/documentation/draftbit/rest-services-and-endpoints.md#editing-an-endpoint)
    * [Deleting an endpoint](/documentation/draftbit/rest-services-and-endpoints.md#deleting-an-endpoint)
