Fixed-Schema Connectors
- 2 Minutes to read
- DarkLight
Fixed-Schema Connectors
- 2 Minutes to read
- DarkLight
Article summary
Did you find this summary helpful?
Thank you for your feedback
Fixed-schema connectors provide a set of dataset templates which typically represents an definition of a call to API endpoint and transformation pipeline expression. The examples of such connectors is Shopify, ExactOnline, Xero, Stripe or Semrush.
Prerequisites
- You have the link to API endpoint documentation.
- You have successfuly created an Authorizer to the desired service.
Implementation
Fixed-schema connectors require the following workflow:
- Call the /connectors/{connectorId}/actions/authorization endpoint for obtain the list of active authorizers. If none is available create a new one. ID of the authorizer is passed as oAuthId parameter in the next stages.
- Call the /connectors/{connectorId}/templates endpoint to acquire the list of available templates. Use ID of the template to obtain template details by calling /connectors/{connectorId}/templates/{id}. Each template consist of request object with url, header, body, method, transformation and emitter attributes. You will need those in the following steps.
- Check API endpoint documentation for availability of /actions/* endpoints. This indicate that there are additional parameters that needs to be supplied.
- Check attributes in the request object (i.e. url, header, transformation) if containing placeholders with double curly brackets (e.g. {{subdomain}}). If, so this indicates that such param need to be supplied in parameters attribute.
- As an example, if request.url has the value https://{{subdomain}}.shopify.com you will need to pass the attribute subdomain with your value as part of the parameters object.
- Send the full payload to the /preview endpoint to test the functionality of the payload. If successful, you can create the source by calling /create-source endpoint.
Payload schema
Use this schema when calling /preview and /create-source endpoints for testing the payload and creating the source. The payload structure is common for all fixed-schema connectors.
{
"connectorId":"CONNECTOR_ID",
"templateId":"TEMPLATE_ID",
"label":"My Test",
"type":"CONNECTOR_ID",
"oAuthId":"1234",
"request": {
"url":"",
"header":[],
"method":"GET",
"body":"",
"transformation":"[]",
"emitter":"[]"
},
"parameters":{},
"syncFrequency":"custom",
"hour":"3",
"minute":"25",
"dayOfWeek":"*",
"dayOfMonth":"*",
"month":"*",
"timezone":"UTC",
"strategy":"clean"
}
Param | Type | Description |
---|---|---|
connectorId | STRING | Use same identifier as in URL. |
templateId | STRING | Use the template ID used for obtaining the request object. |
label | STRING | Use any value for the description of the newly created source. |
type | STRING | Use the same value as for connectorId. |
oAuthId | STRING | ID of the authorizer to be used. Call /authorization endpoint to obtain the list of authorizers. |
request | OBJECT | Object containing of url, header, method, body, transformation and emitter attributes. Obtain it by calling /connectors/{connectorId}/templates/{id} method. |
request.url | STRING | URL of an api endpoint. |
request.header | ARRAY | HTTP headers of the API call. Authozation headers are automatically added. |
request.method | STRING | HTTP method of the API call. |
request.body | STRING | HTTP body of the API call. |
request.transformation | STRING | Transformation pipeline expression of the call. Read more in dedicated Transformation pipeline article. |
request.emitter | STRING | Emitter expression of the call. Read more in dedicated Transformation pipeline article. |
parameters | OBJECT | Object of keys and values to replace placeholders in request object. Placeholders are strings in double brackets such as {{url}}. To do the replacement for this example, provide value with key url. |
strategy | ENUM | Default is clean. You can use incremental if you want to incrementally storing data in Dataddo SmartCache. |
timezone | STRING | Timezone name (e.g. Europe/London). Full list available in timezone list. |
syncFrequency | STRING | Use custom as value. |
minute | STRING | Minute (0 - 59). Compatible with Cron expression. |
hour | STRING | Hour (0 - 23). Compatible with Cron expression. |
dayOfWeek | STRING | Day of the week (0 - 6) (Sunday to Saturday). Compatible with Cron expression. |
dayOfMonth | STRING | Day of the month (1 - 31). Compatible with Cron expression. |
month | STRING | Month in year (1 - 12). Compatible with Cron expression. |
Was this article helpful?