# Local REST Calls

The REST provider populates list data or performs other REST methods using a third-party REST service.

By default, a REST function will split processing between the mobile app (local) and the Jigx REST service (remote). The mobile app wraps the REST call and sends it to the remote Jigx REST function that, in turn, calls the third-party service. Results are returned to the mobile app from the third-party REST service via the remote Jigx REST function. When using the remote Jigx REST service, the size of the data is limited to 6Mb. OAuth, which is configured in Jigx Management is only processed in the remote Jigx REST service. **Remote REST function** calls are helpful when:

* OAuth needs to secure.
* The calling IP addresses on the third-party service need to be allowlisted.

A **local REST function** call allows the mobile app to perform all the processing locally and call the third-party service directly. As a result, data is only transferred between the mobile app and the third-party REST service. The third-party REST service is the only limit to data size when using a local REST function. **Local REST function** calls are useful when:

* There is a requirement not to send any data through the AWS infrastructure
* The third-party REST service has a limit larger than 6Mb on the amount of data that can be transferred

### Considerations

* Only **OAuth** authentication can be used with local REST calls.
* Setting `useLocal: false` limits support for REST robustness and `@ctx` features, and may slow down data syncing between the device and the remote system.

### Example

Adding the `useLocalCall: true` property to a REST function directs the function call to use local execution. Leaving the property out of the definition or setting it to `useLocalCall: false` directs the function call to use remote execution.

```yaml
provider: DATA_PROVIDER_REST
url: https://api.weather.gov/alerts/active
useLocalCall: true
parameters:
  area:
    type: string
    location: query
    required: true
    value: WA
```

For examples using Remote REST functions, see [REST Authentication](/building-apps-with-jigx/data/data-providers/rest/rest-authentication.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://docs.jigx.com/building-apps-with-jigx/data/data-providers/rest/local-rest-calls.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.
