Data Providers
REST

Create an app using REST APIs

4min

By integrating external REST APIs into your Jigx solutions, you can significantly enrich your apps with a wide range of data and functionality from various external sources, enhancing the overall user experience.

Document image


REST concepts

  • How to define the GET, PUT, PUSH, and DELETE REST operations in functions.
  • How to define the REST parameters, headers, continuation, and body in the functions.
  • How to configure input and output transforms in functions.
  • How automatically syncs the IDs for new customers created in REST API to the local data provider. (tempId to Id - useful when the app is offline).
  • How to convert images into a format that is acceptable for REST and for .
  • How to get the image metadata using output transform.
  • How to reference the data in s (screens) and call the functions in actions.

What is created

In this section, a REST API is used to create a customer app that allows you to:

Functions & Jigs

Functionality description

View a list of customers by status.

Delete customers by swiping left.

Capture new customers in a form.

Update customer details by swiping left on the list and selecting view, which populates a form with the customer's details with an update button.

Return a list of customers in batches (continuation) and view customer details where addresses and phone are complex REST structures (jsonProperties).

View customer details, locations, and product images in a composite .

Upload product images for the customer.

High-level steps

The REST data provider is used in to integrate with REST. In this section, we follow these high-level steps:

  1. Identify the REST API to be used as your data source.
  2. Define a REST Service in a function in .
  3. Configure REST Authentication (if required).
  4. Define data operations in the function, such as GET, POST, PUT, and DELETE. For each operation, create a new function to specify the endpoint, required headers, URL parameters, input and output transforms, continuation, and body content if applicable.
  5. Reference the Jigx functions in s.
  6. Publish your solution
  7. Test the Data Provider.

When using the code and samples in this topic, remember that they are designed to function as part of a comprehensive solution. To fully benefit from the intended functionality and ensure compatibility, it is recommended that you use the entire solution rather than selecting individual components in isolation. Alternatively, you can use these samples as a guide to understand the underlying concepts and REST API, which can help you integrate similar solutions into your projects more effectively.



Updated 10 May 2024
Doc contributor
Did this page help you?
Yes
No