GET /: returns app informationPOST /validate: performs validation of the accountPOST /api/v1/synchronizer/config: returns synchronizer configurationPOST /api/v1/synchronizer/schema: returns synchronizer schemaPOST /api/v1/synchronizer/data: returns data
GET /logo: returns an image/svg+xml representation of the application’s logoPOST /api/v1/synchronizer/datalist: returns possible options for filter fieldsPOST /api/v1/synchronizer/filter/validate: performs filter fields validationPOST /api/v1/synchronizer/resource: returns files those behind security wallPOST /api/v1/synchronizer/webhooks: setting up webhookPOST /api/v1/synchronizer/webhooks/pre-process: verify and process incoming eventPOST /api/v1/synchronizer/webhooks/transform: convert event payload into data that can be handled by Fibery
GET /
GET ”/” endpoint is the main one which returns information about the app. You can find response structure in App configuration. Response example:authentication object includes all account schema information. It informs the Fibery front-end how to build forms for the end-user to provide required account information. This property is required, even if your application does not require authentication. At least one authentication object must be provided within array.
In case when application doesn’t require authentication, the fields array must be omitted.
Read more about fields in Custom App: Fields.
oauth and oauth2 for OAuth v1 and OAuth v2, respectively.
Check Custom App: OAuth.
POST /validate
This endpoint performs account validation when setting up an account for the app and before any actions that uses the account. The incoming payload includes information about the account type to be validated and all fields required: If the account is valid, the app should return HTTP status 200 with a JSON object containing a friendly name for the account: Incoming body:POST /api/v1/synchronizer/config
The endpoint returns information about synchronization possibilities based on input parameters. It instructs Fibery about:- Available types
- Available filters
- Available functionalities
| Name | Type | Description |
|---|---|---|
| account | object | selected account’s fields |
| Name | Type | Description |
|---|---|---|
| types | [{id: string, name: string}] | supported types list with id and display name |
| filters | Array of filters | it is used to help the user to exclude non-required data. |
| webhooks | {enabled: true, type: 'ui'} | Optional fields that indicates that webhook functionality is supported |
Filter information
Thefilter object is used to help the user to exclude non-required data. Just like other field-like objects, the filter object is not required. If nothing is provided, users will not be able to filter out data received from the app.
For more information about filters, please refer to App configuration and Fields.
POST /api/v1/synchronizer/schema
Integration app must provide data schema in advance so Fibery will be able to create approriate types and relations and then be able to maintain them. It should provide a schema for all requested types. Each type must containname and id field. In additional there is a reserved field __syncAction that should be added to the schema if delta synchronization with possibility of removing items should be supported.
Request
Request contains:
types- an array of selected type idsfilter- currently configured filteraccount- selected account
| field | description | type |
|---|---|---|
| id | Field id | string |
| ignore | Is field visible in fields catalog | boolean |
| name | Field name | string |
| description | Field description | string |
| readonly | Disable modify field name and type | boolean |
| type | Type of field | ”id”, “text” ,“number” , “date”, “array[text]” Learn more in Integration Schema types |
| relation | Relation between types | see relations section |
| subType | Optional Fibery sub type | ”url” , “integer”, “email”, “boolean”,“html”, “md”, “files”, “date-range” Learn more in Integration Schema types |
Relations
relation field provides a possibility to create a relation between entities in Fibery. It contains following fields:
| field | description | type |
|---|---|---|
| cardinality | Type of relation | ”many-to-one”, “many-to-many”, “one-to-one” |
| name | Name of the field on source side | string |
| targetType | Id of target type | string |
| targetName | Field name of target side | string |
| targetFieldId | Find relation by value from field | string |
- Pull Requests - Array
- Repository Id - string - this field will be hidden from end user
- Repository - Repository
__syncAction
Sync action is reserved field that won’t be visible for end user. The field is used for delta synchronization when entity should be deleted.
POST /api/v1/synchronizer/data
Data endpoint performs actual data retrieving for the specified integration settings. Data retrieving is run by each type independently. Data synchronization supports:- pagination
- delta synchronization
types- array of selected type idsrequestedType- currently fetching typeaccount- account on behalf of data should be fetchedfilter- currently configured filterslastSynchronizedAt- OPTIONAL field that indicated when last successful synchronization was runpagination- OPTIONAL field includes pagination settings that was returned from previous data requestschema- current integration schema
Response
Outboud payload includes:items- REQUIRED array of fetched data rowspagination- OPTIONAL parameter that includes information about paginationhasNext- boolean attribute that indicates that there are more pages availablenextPageConfig- object that will be passed inpaginationrequest body parameter with next page requestsynchronizationType- OPTIONAL parameter with possible valuesdeltaorfull. It indicates how data will be handled on Fibery side. Ifdeltais set then only provided changes will be applied. Fibery will be looking for__syncActionfield to identify whether row should be set or removed. If__syncActionequalREMOVEthen corresponding entity will be removed. Iffullis set then unsynced data will be removed (if keep unsynced is unchecked).
Errors
If something goes wrong then integration app should respond with corresponding error HTTP status code and error message. Sample of error about sync failure:tryLater flag with value true. Fibery will retry this particular page later on.
Sample of error about limits
GET /logo
OPTIONAL
The /logo endpoint is used to provide a SVG representation of a connected application’s logo. This endpoint is entirely optional. Valid responses are a HTTP 200 response with a image/svg+xml content type, a HTTP 204 (No Content) response if there is no logo, or a 302 redirect to another URI containing the logo. If no logo is provided, or an error occurs, the application will be represented with our default app logo.
POST /api/v1/synchronizer/datalist
OPTIONAL
Request
The inbound payload includes:
types- an array of selected type idsaccount- selected accountfield- name of requested fielddependsOn- object that contains filter key-value pairs of dependant fields
datalist flag.
Response
The response from your API should include items that is a JSON-serialized list of name-value objects: The title in each object is what is displayed to the end-user for each value in a combobox and the value is what is stored with the filter and what will be passed with subsequent requests that utilize the user-created filter.
Response sample:
POST /api/v1/synchronizer/filter/validate
OPTIONAL
This endpoint performs filter validation. It can be useful when app doesn’t know about what filter value looks like. For example, if your app receives sql query as filter you may want to check is that query is valid.
Request
Request body contains:
types- array of selected type idsaccount- account on behalf of data should be fetchedfilter- currently configured filters
POST /api/v1/synchronizer/resource
OPTIONAL
This endpoint is used to access files that require authentication. For example, if the schema contains a files field and the files are not accessible by direct link then this route can be used to download files by specifying a url as app://resource?url=:url&value=1. As a result the route will be called with url and value params. The resource endpoint is called with all query parameters specified in app://resource url.
Request
Request body contains:
types- array of selected type idsaccount- account on behalf of data should be fetchedfilter- currently configured filtersparams- list of parameters.
POST /api/v1/synchronizer/webhooks
OPTIONAL
The endpoint is responsible for installing, updating or reinstalling a webhook based on provided parameters. It’s the place where webhook based configuration starts.
Request. It accepts following parameters:
types- an array of selected types idsfilter- currently configured filteraccount- authenticated external accountwebhook- OPTIONAL. If it’snullthen a new webhook is going to be installed, otherwise it will contain current webhook configuration (that is returned by THIS endpoint)
id- some random idworkspaceId- 3rd party workspace id linked to webhook/synchronization (e.g. slack workspace, intercom workspace, gitlab organization)- any other data that you want to receive on reinstall event.
POST /api/v1/synchronizer/webhooks/pre-process
OPTIONAL
The route is responsible for initial pre processing of request. Data that is received by this route is the same as 3rd party service sends without any changes (almost). It’s done to be able to calculate request signature properly.
Goals of the service:
- verify incoming request (usually it means that service should verify signature based on 3rd party system chosen algorithm, e.g. hubspot webhook verification)
- response with data that should be sent to 3rd party caller and list of workspace ids this event will work for. HTTP status code of the response will also be forwarded to 3rd party system
reply- data will be send as a response to 3rd party callerworkspaceIds- array of workspace ids this event can be applied on. Array can be empty
POST /api/v1/synchronizer/webhooks/transform
OPTIONAL
This route is responsible for converting event payload into data that can be handled by Fibery. Data is applied by delta synchronization rules.
Request
Request payload includes:
params- event headers that comes from external system.payload- event body that comes from external system.types- an array of selected type idsfilter- currently configured filteraccount- selected account
data object that is a map of data arrays by type id.