Integrate with external systems
Most applications, and business applications in particular, will need to communicate with one or more other systems such as CRM, ERP, or Accounting systems. Appfarm offers built-in components for setting up integrations towards external systems, as well as running server-side jobs or setting up API endpoints.
In general, there are main categories of integrations:
From Appfarm to a third-party system
From a third-party system to Appfarm
Integrate from Appfarm to a third-party system
This means that the integration initiates from Appfarm, meaning a request (GET, POST etc) is sent from Appfarm to the external third-party system.
You may fetch data from, or push data to external APIs, by using the Web Request Action Node. It may be used both from your Apps (for example get
or post
some data when clicking a button), or from Services (for example, get new and updated orders every 5 minutes).
Integrate from a third-party system to Appfarm
This means that the integration initiates from the third-party system. In this case, the third-party system cannot send that request to our App, since our App only lives in the local browser client side. We need an endpoint that lives server-side. In Appfarm, this is either a Service Endpoint or a GraphQL Endpoint.
Service Endpoint
A Service Endpoint for receiving data (an incoming POST request) may be set up with a mapping of the incoming Body Data towards your data model (similar to the Result Mapping of the Web Request), and the Service Endpoint can trigger an action for processing these data.
A Service Endpoint for sending data back (an incoming GET request), can be set up with a mapping of Query Parameters. An action may read the data to be returned, and the Service Endpoint defines which data sources or JSON structure to send back once the action is completed.
Accessing a Service Endpoint
URL: https://
SOLUTION-HOSTNAME
/api/services/SERVICE-ALIAS-SLUG
/READABLE-ID
Authorization:
Option 1 (Recommended): Add a header entry with key
Authorization
and valueBearer <API-KEY-HERE>
.Option 2: Add the API key as a URL parameter named
token
, resulting in a URL such as https://SOLUTION-HOSTNAME
/api/services/SERVICE-ALIAS-SLUG
/READABLE-ID
?token=<API-KEY-HERE>.
GraphQL Endpoint
By turning on GraphQL for an object class, Appfarm generates this API for you, based on your Data Model. Appfarm's security layer will always be on top of your data so that the users without required permissions are not able to use these APIs to fetch data they should not have access to.
Accessing a GraphQL Endpoint
You may access the GraphQL editor of your environment by clicking the Explore GraphQL button in the top bar of the Global Data Model in Create.
URL: https://
SOLUTION-HOSTNAME
/api/graphql?query=YOUR-GRAPHQL-QUERY-HERE
Authorization:
Option 1: Add a header entry with key
x-af-api-token
and the API key as valueOption 2: Add the API key as a URL parameter named
token
, resulting in a URL such as https://SOLUTION-HOSTNAME
/api/graphql/?token=API-KEY-HERE
&query=YOUR-GRAPHQL-QUERY-HERE
Last updated