Each connector is built using a set of ready-made components that are configured based on how the data source API behaves. Below you can find a list of the main components, what they’re responsible for, and when and how to use them.
Component | JSON object | Purpose | When and how to use it | Documentation |
|---|---|---|---|---|
Authentication |
| Defines how the authentication flow of the connector behaves. | If a data source API requires authentication, it’s advised to use an authentication component to configure a correct authentication flow to ensure tokens are encrypted and stored securely instead of using them as plain text within the request. If the data source API is public (no credentials required), you don’t need to configure the authentication component. | |
Data source user |
| Data source user defines how the authentication token and other user information received from the user during the authentication flow (like username or ID) is stored. | Use data source user component to store all the user information needed when doing a request to the API, and use the information stored in data source user via placeholders when configuring a request to the API. If the connector does not have an authentication component defined, you don’t need to configure data source user component. | |
Account fetchers |
| The account fetcher is used to automatically retrieve a list of accounts to which the token has access from the data source API. For example, all the different ad accounts Meta Ads or Google Ads user has access to, or all the Google Analytics properties Google Analytics user has access to. | Use account fetchers when an authenticated user can have access to multiple different accounts, and the API has an endpoint to fetch a list of available accounts. When using the account fetcher, accounts fetched from the API are stored, and you can use stored properties as parameters in API requests. Configuring account fetchers is optional. | |
Report types |
| Report types are the main components of a connector and define
| Use report types to define what data is fetched from the data source API and you want to have available in the connector. A connector can have one or multiple report types, and one report type typically requests data from a one endpoint. If you have multiple endpoints you need data from, you can add multiple report types to the connector. Each connector needs to have at least one report type defined. | |
Default response handler |
| Default response handler allows you to define how different error responses from the API are handled – ie. if certain failed requests are automatically retried or how those are translated to error messages in Supermetrics products. | Configuring the response default response handler is optional. If you encounter periodic errors from the API, you can use the default response handler to define the behaviour of the connector once an error occurs. This allows you to overcome occasional errors with retries, or provide actionable instructions to end user. |