For holidays, we have a Sync public holidays from Google Calendar native integration, if you need it.
Getting Started
All communication between an integration application and Fibery services is done via standard hypertext protocols, whether that be HTTP or HTTPS. Please check out the full documentation starting from the Integrations overview. The choice of underlying technologies used to develop integration applications is up to the individual developer. We are going to implement all required endpoints in web app step by step. We will use Node.js for implementing this integration app.The source code can be found here.
App configuration endpoint
Every integration should have the configuration which describes what the app is doing and the authentication methods. The app configuration should be accessible at GET ”/” endpoint and should be publicly available. For example, we used Heroku to host the app. This is the endpoint implementation.All properties are required. Find the information about all properties here.
Note that case matters.
Validate
This endpoint is responsible for app account validation. It is required to be implemented. Let’s just send back the name of account without any authentication since we are creating an app with public access. POST /validateSync configuration endpoint
The way data is synchronised should be described. The endpoint is POST /api/v1/synchronizer/configFind information about filters in App configuration.
Datalist
Endpoint POST /api/v1/synchronizer/datalist should be implemented if synchronizer filters has dropdown marked as “datalist”: true. Since we have countries multi drop down which should contain countries it is required to implement the mentioned endpoint as well.For this app, only the list of countries is returned since our config has only one data list. In the case where there are several data lists then we will need to retrieve “field” from request body which will contain an id of the requested list. The response should be formed as an array of items where every element contains title and value properties.
Schema
POST /api/v1/synchronizer/schema endpoint should return the data schema of the app. In our case it should contain only one root element “holiday” named after the id of holiday type in sync configuration above.Every schema type should have
id and name elements defined.Data
The data endpoint is responsible for retrieving data. Check the documentation on how request body looks. There is no paging needed in case of our app, so the data is returned according to selected countries and years interval. The source code can be found here. POST /api/v1/synchronizer/data First, a small helper that resolves the year range from filter values (defaulting to last year through this year):Testing custom integration app
- It is recommended to create integration tests before adding your custom app to Fibery apps gallery. Check some tests I created for holidays app here.
- It is possible to run your app on local machine and make the app’s url publicly available by using tools like ngrok.
An integration sync could cleanup (delete) entities which is potentially quite dangerous, since restoration is not super easy. However, integration entities with ANY schema modifications will not be deleted during sync.This applies if:
- At least one custom field has been added by an admin.
- The entity has any rich text field.
deleted in source with values yes and no. If an entity is deleted in the source, the value will be set to yes. Admins can then manually delete these entities if needed (manually or via automation).FAQ
Where can I ask questions regarding API & Integrations?
The best place is to ping us in chat or in our community.Is there any way to pass batches of entity data to an external action?
No, there are no batch actions availableHowever, batch actions can be implemented in a custom app by accumulating incoming items into app storage and performing actions on them as a batch.
Please, note that the Automation API calls custom actions for Entities one by one in queue. That means, that the whole execution will be stopped if the first action fails.
Community examples:
- Toggl integration from Reify academy
- Zotero from Seaotternerd