Introduction

Getting started

Walkthrough Guides

CafeX Apps

Workflows

Using CafeX Collaborate App

Reporting

Managing CafeX

Integrating CafeX

Security

App Studio

CafeX Apps

Configuring an External Data Source

Modified on Thu, 21 Sep, 2023 at 11:17 AM

TABLE OF CONTENTS


If your App needs to call out to external systems to retrieve or send data, then you have to configure an External Data Source., so that your App is able to send requests to its API.  Because CafeX manages the external APIs for you, you do not have to write code to authenticate, maintain, and establish the connection. Your App needs a Data Set to interact with the External Data Source.  This article describes both of these features.

The External Data Source allows you to configure several aspects of a RESTful API.  Before you configure an External Data Source, you have to be familiar with RESTful services.

To create a new External Data Source:

  1. Go to Configure > External data sources.
  2. Select any of the External Data Sources.
  3. Click Edit data source (https://s3.amazonaws.com/cdn.freshdesk.com/data/helpdesk/attachments/production/73070276213/original/UmJbj-iKHUST99ezOg1JhMF3tEss6Z_y-A.png?1693840864).
  4. Under Configuration, is a JSON definition for the endpoint that your App uses to access the API.
  5. Schema, there is a JSON definition of information your App uses.

When you configure an External Data Source, you can use Extract Schema to have CafeX call the endpoint and parse the data object.   The response schema provides the App Studio with a definition of response objects that your App references.

Example Data Source configuration

The following API definition provides you with information about a domain name registrations


OperationURL
GEThttps://api.domainsdb.info/v1/domains/search

URL Parameters:
domain

Example URL:
https://api.domainsdb.info/v1/domains/search?domain=cafex.com

Example Response:

{			

    "domains": [{

        "domain": "cafex.com",

        "create_date": "2023-08-27T09:01:38.517344",

        "update_date": "2023-08-27T09:01:38.517347",

        "country": "US",

        "isDead": "False",

        "A": ["54.173.157.104"],

        "NS": ["ns-1284.awsdns-32.org", "ns-1733.awsdns-24.co.uk", "ns-433.awsdns-54.com", "ns-634.awsdns-15.net"],

        "CNAME": null,

        "MX": [{

            "exchange": "aspmx.l.google.com",

            "priority": 10

        }],

        "TXT": ["status-page-domain-verification=04x69wwf5683"]

    }],

    "total": 1,

    "time": "1210",

    "next_page": null

}

The following Configuration is all that this Data Source requires.

Data Source configuration can include the following attributes:

AttributeDescription
URLThe URL of the endpoint.
Use %VARIABLE% to parameterize URL fields.
methodThe Request method to use:

Typically, RESTful services use requests for the following:
POST non-idempotent—creates new objects
PUT idempotent—updates objects
GET idempotent (no change)—retrieves data
urlparameterAn array of URL parameters 
authThe Request uses authentication headers, an OAUTH2 token
payloadDefines JSON payloads for POST and PUT requests

As this is a GET request, use Extract Schema to test the endpoint and automatically generate the schema for your App to use:

Adding a Data Set for an External Data Source 

To perform operations on an External Data Source, you have to collect parameters and use them to evaluate a Data Set in your App. The Data Set provide your Apps with a consistent way to interact with data. 

For a guide that uses Components, Data Sets, and External Data Sources, see: Enhancing your App

To add a Data Set to search on:

  1. In App Studio, go to Explorer > App.
  2. On the Appearance and Configuration panel, click Configuration.
  3. Click Add Data set.
  4. Complete the form and select the appropriate Data Source. 
  5. Click Add

Your Components in your App can make use of the Data Set.


If your Data Set requires inputs, because your Data Source has URL parameters, you have to associate a new Form Component with the Data Set before you set the field on the original Data Set.

Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select at least one of the reasons
CAPTCHA verification is required.

Feedback sent

We appreciate your effort and will try to fix the article