From 189f9f76d4b083d13debfc0ce7f0be2ae606fc9f Mon Sep 17 00:00:00 2001 From: Dainius Salkauskas Date: Thu, 27 Oct 2022 20:15:54 +0300 Subject: [PATCH] =?UTF-8?q?=F0=9F=8E=89=20New=20Source:=20ActiveCampaign?= =?UTF-8?q?=20(#18335)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Init source ActiveCampaign * Added documentation files * Added contacts and campaigns streams * Added deals stream * added segments stream * Added lists stream * Formatted schemas * Added references to API docs * added forms stream * Added pagination * Updated documentation * Formatted schemas * Removed unnecessary files * Added changelog * Updated base URL * Added sample config * add source seed * run format * generate uuid for activecampaign * auto-bump connector version Co-authored-by: Rytis Mickevičius Co-authored-by: marcosmarxm Co-authored-by: Octavia Squidington III --- .../resources/seed/source_definitions.yaml | 7 + .../src/main/resources/seed/source_specs.yaml | 22 + .../source-activecampaign/.dockerignore | 6 + .../source-activecampaign/Dockerfile | 38 ++ .../source-activecampaign/README.md | 79 ++++ .../source-activecampaign/__init__.py | 3 + .../acceptance-test-config.yml | 30 ++ .../acceptance-test-docker.sh | 16 + .../source-activecampaign/bootstrap.md | 13 + .../source-activecampaign/build.gradle | 9 + .../integration_tests/__init__.py | 3 + .../integration_tests/abnormal_state.json | 5 + .../integration_tests/acceptance.py | 16 + .../integration_tests/configured_catalog.json | 58 +++ .../integration_tests/invalid_config.json | 4 + .../integration_tests/sample_config.json | 4 + .../integration_tests/sample_state.json | 5 + .../connectors/source-activecampaign/main.py | 13 + .../source-activecampaign/requirements.txt | 2 + .../connectors/source-activecampaign/setup.py | 29 ++ .../source_activecampaign/__init__.py | 8 + .../source_activecampaign/activecampaign.yaml | 100 +++++ .../schemas/campaigns.json | 383 ++++++++++++++++++ .../schemas/contacts.json | 245 +++++++++++ .../source_activecampaign/schemas/deals.json | 131 ++++++ .../source_activecampaign/schemas/forms.json | 277 +++++++++++++ .../source_activecampaign/schemas/lists.json | 149 +++++++ .../schemas/segments.json | 29 ++ .../source_activecampaign/source.py | 18 + .../source_activecampaign/spec.yaml | 20 + docs/integrations/README.md | 1 + docs/integrations/sources/activecampaign.md | 38 ++ 32 files changed, 1761 insertions(+) create mode 100644 airbyte-integrations/connectors/source-activecampaign/.dockerignore create mode 100644 airbyte-integrations/connectors/source-activecampaign/Dockerfile create mode 100644 airbyte-integrations/connectors/source-activecampaign/README.md create mode 100644 airbyte-integrations/connectors/source-activecampaign/__init__.py create mode 100644 airbyte-integrations/connectors/source-activecampaign/acceptance-test-config.yml create mode 100644 airbyte-integrations/connectors/source-activecampaign/acceptance-test-docker.sh create mode 100644 airbyte-integrations/connectors/source-activecampaign/bootstrap.md create mode 100644 airbyte-integrations/connectors/source-activecampaign/build.gradle create mode 100644 airbyte-integrations/connectors/source-activecampaign/integration_tests/__init__.py create mode 100644 airbyte-integrations/connectors/source-activecampaign/integration_tests/abnormal_state.json create mode 100644 airbyte-integrations/connectors/source-activecampaign/integration_tests/acceptance.py create mode 100644 airbyte-integrations/connectors/source-activecampaign/integration_tests/configured_catalog.json create mode 100644 airbyte-integrations/connectors/source-activecampaign/integration_tests/invalid_config.json create mode 100644 airbyte-integrations/connectors/source-activecampaign/integration_tests/sample_config.json create mode 100644 airbyte-integrations/connectors/source-activecampaign/integration_tests/sample_state.json create mode 100644 airbyte-integrations/connectors/source-activecampaign/main.py create mode 100644 airbyte-integrations/connectors/source-activecampaign/requirements.txt create mode 100644 airbyte-integrations/connectors/source-activecampaign/setup.py create mode 100644 airbyte-integrations/connectors/source-activecampaign/source_activecampaign/__init__.py create mode 100644 airbyte-integrations/connectors/source-activecampaign/source_activecampaign/activecampaign.yaml create mode 100644 airbyte-integrations/connectors/source-activecampaign/source_activecampaign/schemas/campaigns.json create mode 100644 airbyte-integrations/connectors/source-activecampaign/source_activecampaign/schemas/contacts.json create mode 100644 airbyte-integrations/connectors/source-activecampaign/source_activecampaign/schemas/deals.json create mode 100644 airbyte-integrations/connectors/source-activecampaign/source_activecampaign/schemas/forms.json create mode 100644 airbyte-integrations/connectors/source-activecampaign/source_activecampaign/schemas/lists.json create mode 100644 airbyte-integrations/connectors/source-activecampaign/source_activecampaign/schemas/segments.json create mode 100644 airbyte-integrations/connectors/source-activecampaign/source_activecampaign/source.py create mode 100644 airbyte-integrations/connectors/source-activecampaign/source_activecampaign/spec.yaml create mode 100644 docs/integrations/sources/activecampaign.md diff --git a/airbyte-config/init/src/main/resources/seed/source_definitions.yaml b/airbyte-config/init/src/main/resources/seed/source_definitions.yaml index a1712cf212c3..e7e0d7e05e46 100644 --- a/airbyte-config/init/src/main/resources/seed/source_definitions.yaml +++ b/airbyte-config/init/src/main/resources/seed/source_definitions.yaml @@ -1,3 +1,10 @@ +- name: ActiveCampaign + sourceDefinitionId: 9f32dab3-77cb-45a1-9d33-347aa5fbe363 + dockerRepository: airbyte/source-activecampaign + dockerImageTag: 0.1.0 + documentationUrl: https://docs.airbyte.com/integrations/sources/activecampaign + sourceType: api + releaseStage: alpha - name: Adjust sourceDefinitionId: d3b7fa46-111b-419a-998a-d7f046f6d66d dockerRepository: airbyte/source-adjust diff --git a/airbyte-config/init/src/main/resources/seed/source_specs.yaml b/airbyte-config/init/src/main/resources/seed/source_specs.yaml index 978b14346353..829ec3c0650d 100644 --- a/airbyte-config/init/src/main/resources/seed/source_specs.yaml +++ b/airbyte-config/init/src/main/resources/seed/source_specs.yaml @@ -1,6 +1,28 @@ # This file is generated by io.airbyte.config.specs.SeedConnectorSpecGenerator. # Do NOT edit this file directly. See generator class for more details. --- +- dockerImage: "airbyte/source-activecampaign:0.1.0" + spec: + documentationUrl: "https://docs.airbyte.com/integrations/sources/activecampaign" + connectionSpecification: + $schema: "http://json-schema.org/draft-07/schema#" + title: "Activecampaign Spec" + type: "object" + required: + - "api_key" + - "account_username" + additionalProperties: true + properties: + api_key: + type: "string" + description: "API Key" + airbyte_secret: true + account_username: + type: "string" + description: "Account Username" + supportsNormalization: false + supportsDBT: false + supported_destination_sync_modes: [] - dockerImage: "airbyte/source-adjust:0.1.0" spec: documentationUrl: "https://raw.githubusercontent.com/appchoose/airbyte/feature/source-adjust/docs/integrations/sources/adjust.md" diff --git a/airbyte-integrations/connectors/source-activecampaign/.dockerignore b/airbyte-integrations/connectors/source-activecampaign/.dockerignore new file mode 100644 index 000000000000..4c58fa10a6e6 --- /dev/null +++ b/airbyte-integrations/connectors/source-activecampaign/.dockerignore @@ -0,0 +1,6 @@ +* +!Dockerfile +!main.py +!source_activecampaign +!setup.py +!secrets diff --git a/airbyte-integrations/connectors/source-activecampaign/Dockerfile b/airbyte-integrations/connectors/source-activecampaign/Dockerfile new file mode 100644 index 000000000000..1b8ff074edaa --- /dev/null +++ b/airbyte-integrations/connectors/source-activecampaign/Dockerfile @@ -0,0 +1,38 @@ +FROM python:3.9.11-alpine3.15 as base + +# build and load all requirements +FROM base as builder +WORKDIR /airbyte/integration_code + +# upgrade pip to the latest version +RUN apk --no-cache upgrade \ + && pip install --upgrade pip \ + && apk --no-cache add tzdata build-base + + +COPY setup.py ./ +# install necessary packages to a temporary folder +RUN pip install --prefix=/install . + +# build a clean environment +FROM base +WORKDIR /airbyte/integration_code + +# copy all loaded and built libraries to a pure basic image +COPY --from=builder /install /usr/local +# add default timezone settings +COPY --from=builder /usr/share/zoneinfo/Etc/UTC /etc/localtime +RUN echo "Etc/UTC" > /etc/timezone + +# bash is installed for more convenient debugging. +RUN apk --no-cache add bash + +# copy payload code only +COPY main.py ./ +COPY source_activecampaign ./source_activecampaign + +ENV AIRBYTE_ENTRYPOINT "python /airbyte/integration_code/main.py" +ENTRYPOINT ["python", "/airbyte/integration_code/main.py"] + +LABEL io.airbyte.version=0.1.0 +LABEL io.airbyte.name=airbyte/source-activecampaign diff --git a/airbyte-integrations/connectors/source-activecampaign/README.md b/airbyte-integrations/connectors/source-activecampaign/README.md new file mode 100644 index 000000000000..da82771bf434 --- /dev/null +++ b/airbyte-integrations/connectors/source-activecampaign/README.md @@ -0,0 +1,79 @@ +# Activecampaign Source + +This is the repository for the Activecampaign configuration based source connector. +For information about how to use this connector within Airbyte, see [the documentation](https://docs.airbyte.io/integrations/sources/activecampaign). + +## Local development + +#### Building via Gradle +You can also build the connector in Gradle. This is typically used in CI and not needed for your development workflow. + +To build using Gradle, from the Airbyte repository root, run: +``` +./gradlew :airbyte-integrations:connectors:source-activecampaign:build +``` + +#### Create credentials +**If you are a community contributor**, follow the instructions in the [documentation](https://docs.airbyte.io/integrations/sources/activecampaign) +to generate the necessary credentials. Then create a file `secrets/config.json` conforming to the `source_activecampaign/spec.yaml` file. +Note that any directory named `secrets` is gitignored across the entire Airbyte repo, so there is no danger of accidentally checking in sensitive information. +See `integration_tests/sample_config.json` for a sample config file. + +**If you are an Airbyte core member**, copy the credentials in Lastpass under the secret name `source activecampaign test creds` +and place them into `secrets/config.json`. + +### Locally running the connector docker image + +#### Build +First, make sure you build the latest Docker image: +``` +docker build . -t airbyte/source-activecampaign:dev +``` + +You can also build the connector image via Gradle: +``` +./gradlew :airbyte-integrations:connectors:source-activecampaign:airbyteDocker +``` +When building via Gradle, the docker image name and tag, respectively, are the values of the `io.airbyte.name` and `io.airbyte.version` `LABEL`s in +the Dockerfile. + +#### Run +Then run any of the connector commands as follows: +``` +docker run --rm airbyte/source-activecampaign:dev spec +docker run --rm -v $(pwd)/secrets:/secrets airbyte/source-activecampaign:dev check --config /secrets/config.json +docker run --rm -v $(pwd)/secrets:/secrets airbyte/source-activecampaign:dev discover --config /secrets/config.json +docker run --rm -v $(pwd)/secrets:/secrets -v $(pwd)/integration_tests:/integration_tests airbyte/source-activecampaign:dev read --config /secrets/config.json --catalog /integration_tests/configured_catalog.json +``` +## Testing + +#### Acceptance Tests +Customize `acceptance-test-config.yml` file to configure tests. See [Source Acceptance Tests](https://docs.airbyte.io/connector-development/testing-connectors/source-acceptance-tests-reference) for more information. +If your connector requires to create or destroy resources for use during acceptance tests create fixtures for it and place them inside integration_tests/acceptance.py. + +To run your integration tests with docker + +### Using gradle to run tests +All commands should be run from airbyte project root. +To run unit tests: +``` +./gradlew :airbyte-integrations:connectors:source-activecampaign:unitTest +``` +To run acceptance and custom integration tests: +``` +./gradlew :airbyte-integrations:connectors:source-activecampaign:integrationTest +``` + +## Dependency Management +All of your dependencies should go in `setup.py`, NOT `requirements.txt`. The requirements file is only used to connect internal Airbyte dependencies in the monorepo for local development. +We split dependencies between two groups, dependencies that are: +* required for your connector to work need to go to `MAIN_REQUIREMENTS` list. +* required for the testing need to go to `TEST_REQUIREMENTS` list + +### Publishing a new version of the connector +You've checked out the repo, implemented a million dollar feature, and you're ready to share your changes with the world. Now what? +1. Make sure your changes are passing unit and integration tests. +1. Bump the connector version in `Dockerfile` -- just increment the value of the `LABEL io.airbyte.version` appropriately (we use [SemVer](https://semver.org/)). +1. Create a Pull Request. +1. Pat yourself on the back for being an awesome contributor. +1. Someone from Airbyte will take a look at your PR and iterate with you to merge it into master. diff --git a/airbyte-integrations/connectors/source-activecampaign/__init__.py b/airbyte-integrations/connectors/source-activecampaign/__init__.py new file mode 100644 index 000000000000..1100c1c58cf5 --- /dev/null +++ b/airbyte-integrations/connectors/source-activecampaign/__init__.py @@ -0,0 +1,3 @@ +# +# Copyright (c) 2022 Airbyte, Inc., all rights reserved. +# diff --git a/airbyte-integrations/connectors/source-activecampaign/acceptance-test-config.yml b/airbyte-integrations/connectors/source-activecampaign/acceptance-test-config.yml new file mode 100644 index 000000000000..7543dba988ef --- /dev/null +++ b/airbyte-integrations/connectors/source-activecampaign/acceptance-test-config.yml @@ -0,0 +1,30 @@ +# See [Source Acceptance Tests](https://docs.airbyte.com/connector-development/testing-connectors/source-acceptance-tests-reference) +# for more information about how to configure these tests +connector_image: airbyte/source-activecampaign:dev +tests: + spec: + - spec_path: "source_activecampaign/spec.yaml" + connection: + - config_path: "secrets/config.json" + status: "succeed" + - config_path: "integration_tests/invalid_config.json" + status: "failed" + discovery: + - config_path: "secrets/config.json" + basic_read: + - config_path: "secrets/config.json" + configured_catalog_path: "integration_tests/configured_catalog.json" + empty_streams: [] + # TODO uncomment this block to specify that the tests should assert the connector outputs the records provided in the input file a file + # expect_records: + # path: "integration_tests/expected_records.txt" + # extra_fields: no + # exact_order: no + # extra_records: yes + # incremental: # TODO if your connector does not implement incremental sync, remove this block + # - config_path: "secrets/config.json" + # configured_catalog_path: "integration_tests/configured_catalog.json" + # future_state_path: "integration_tests/abnormal_state.json" + # full_refresh: + # - config_path: "secrets/config.json" + # configured_catalog_path: "integration_tests/configured_catalog.json" diff --git a/airbyte-integrations/connectors/source-activecampaign/acceptance-test-docker.sh b/airbyte-integrations/connectors/source-activecampaign/acceptance-test-docker.sh new file mode 100644 index 000000000000..c51577d10690 --- /dev/null +++ b/airbyte-integrations/connectors/source-activecampaign/acceptance-test-docker.sh @@ -0,0 +1,16 @@ +#!/usr/bin/env sh + +# Build latest connector image +docker build . -t $(cat acceptance-test-config.yml | grep "connector_image" | head -n 1 | cut -d: -f2-) + +# Pull latest acctest image +docker pull airbyte/source-acceptance-test:latest + +# Run +docker run --rm -it \ + -v /var/run/docker.sock:/var/run/docker.sock \ + -v /tmp:/tmp \ + -v $(pwd):/test_input \ + airbyte/source-acceptance-test \ + --acceptance-test-config /test_input + diff --git a/airbyte-integrations/connectors/source-activecampaign/bootstrap.md b/airbyte-integrations/connectors/source-activecampaign/bootstrap.md new file mode 100644 index 000000000000..a941ac39c9f8 --- /dev/null +++ b/airbyte-integrations/connectors/source-activecampaign/bootstrap.md @@ -0,0 +1,13 @@ +# ActiveCampaign + +The ActiveCampaign source connector interacts with the ActiveCampaign API, which +provides metrics for yor transactional email, email marketing, marketing automation, +sales automation, and CRM software. + +[Authentication](https://developers.activecampaign.com/reference/authentication) +is handled via a regular `Authorization` HTTP header. + +Account username is used as part of API [base URL](https://developers.activecampaign.com/reference/url). + +See the [official documentation](https://developers.activecampaign.com/reference/overview) +for details on how the API works. diff --git a/airbyte-integrations/connectors/source-activecampaign/build.gradle b/airbyte-integrations/connectors/source-activecampaign/build.gradle new file mode 100644 index 000000000000..ca76b9550daa --- /dev/null +++ b/airbyte-integrations/connectors/source-activecampaign/build.gradle @@ -0,0 +1,9 @@ +plugins { + id 'airbyte-python' + id 'airbyte-docker' + id 'airbyte-source-acceptance-test' +} + +airbytePython { + moduleDirectory 'source_activecampaign' +} diff --git a/airbyte-integrations/connectors/source-activecampaign/integration_tests/__init__.py b/airbyte-integrations/connectors/source-activecampaign/integration_tests/__init__.py new file mode 100644 index 000000000000..1100c1c58cf5 --- /dev/null +++ b/airbyte-integrations/connectors/source-activecampaign/integration_tests/__init__.py @@ -0,0 +1,3 @@ +# +# Copyright (c) 2022 Airbyte, Inc., all rights reserved. +# diff --git a/airbyte-integrations/connectors/source-activecampaign/integration_tests/abnormal_state.json b/airbyte-integrations/connectors/source-activecampaign/integration_tests/abnormal_state.json new file mode 100644 index 000000000000..52b0f2c2118f --- /dev/null +++ b/airbyte-integrations/connectors/source-activecampaign/integration_tests/abnormal_state.json @@ -0,0 +1,5 @@ +{ + "todo-stream-name": { + "todo-field-name": "todo-abnormal-value" + } +} diff --git a/airbyte-integrations/connectors/source-activecampaign/integration_tests/acceptance.py b/airbyte-integrations/connectors/source-activecampaign/integration_tests/acceptance.py new file mode 100644 index 000000000000..1302b2f57e10 --- /dev/null +++ b/airbyte-integrations/connectors/source-activecampaign/integration_tests/acceptance.py @@ -0,0 +1,16 @@ +# +# Copyright (c) 2022 Airbyte, Inc., all rights reserved. +# + + +import pytest + +pytest_plugins = ("source_acceptance_test.plugin",) + + +@pytest.fixture(scope="session", autouse=True) +def connector_setup(): + """This fixture is a placeholder for external resources that acceptance test might require.""" + # TODO: setup test dependencies if needed. otherwise remove the TODO comments + yield + # TODO: clean up test dependencies diff --git a/airbyte-integrations/connectors/source-activecampaign/integration_tests/configured_catalog.json b/airbyte-integrations/connectors/source-activecampaign/integration_tests/configured_catalog.json new file mode 100644 index 000000000000..a74ca3665f1a --- /dev/null +++ b/airbyte-integrations/connectors/source-activecampaign/integration_tests/configured_catalog.json @@ -0,0 +1,58 @@ +{ + "streams": [ + { + "stream": { + "name": "campaigns", + "json_schema": {}, + "supported_sync_modes": ["full_refresh"] + }, + "sync_mode": "full_refresh", + "destination_sync_mode": "overwrite" + }, + { + "stream": { + "name": "contacts", + "json_schema": {}, + "supported_sync_modes": ["full_refresh"] + }, + "sync_mode": "full_refresh", + "destination_sync_mode": "overwrite" + }, + { + "stream": { + "name": "deals", + "json_schema": {}, + "supported_sync_modes": ["full_refresh"] + }, + "sync_mode": "full_refresh", + "destination_sync_mode": "overwrite" + }, + { + "stream": { + "name": "segments", + "json_schema": {}, + "supported_sync_modes": ["full_refresh"] + }, + "sync_mode": "full_refresh", + "destination_sync_mode": "overwrite" + }, + { + "stream": { + "name": "lists", + "json_schema": {}, + "supported_sync_modes": ["full_refresh"] + }, + "sync_mode": "full_refresh", + "destination_sync_mode": "overwrite" + }, + { + "stream": { + "name": "forms", + "json_schema": {}, + "supported_sync_modes": ["full_refresh"] + }, + "sync_mode": "full_refresh", + "destination_sync_mode": "overwrite" + } + ] +} diff --git a/airbyte-integrations/connectors/source-activecampaign/integration_tests/invalid_config.json b/airbyte-integrations/connectors/source-activecampaign/integration_tests/invalid_config.json new file mode 100644 index 000000000000..70b3d19fe9c6 --- /dev/null +++ b/airbyte-integrations/connectors/source-activecampaign/integration_tests/invalid_config.json @@ -0,0 +1,4 @@ +{ + "api_key": "", + "account_username": "invalid_account" +} diff --git a/airbyte-integrations/connectors/source-activecampaign/integration_tests/sample_config.json b/airbyte-integrations/connectors/source-activecampaign/integration_tests/sample_config.json new file mode 100644 index 000000000000..f6c93954a7a2 --- /dev/null +++ b/airbyte-integrations/connectors/source-activecampaign/integration_tests/sample_config.json @@ -0,0 +1,4 @@ +{ + "api_key": "", + "account_username": "dainiuxazz" +} diff --git a/airbyte-integrations/connectors/source-activecampaign/integration_tests/sample_state.json b/airbyte-integrations/connectors/source-activecampaign/integration_tests/sample_state.json new file mode 100644 index 000000000000..3587e579822d --- /dev/null +++ b/airbyte-integrations/connectors/source-activecampaign/integration_tests/sample_state.json @@ -0,0 +1,5 @@ +{ + "todo-stream-name": { + "todo-field-name": "value" + } +} diff --git a/airbyte-integrations/connectors/source-activecampaign/main.py b/airbyte-integrations/connectors/source-activecampaign/main.py new file mode 100644 index 000000000000..d7e7b299c1c0 --- /dev/null +++ b/airbyte-integrations/connectors/source-activecampaign/main.py @@ -0,0 +1,13 @@ +# +# Copyright (c) 2022 Airbyte, Inc., all rights reserved. +# + + +import sys + +from airbyte_cdk.entrypoint import launch +from source_activecampaign import SourceActivecampaign + +if __name__ == "__main__": + source = SourceActivecampaign() + launch(source, sys.argv[1:]) diff --git a/airbyte-integrations/connectors/source-activecampaign/requirements.txt b/airbyte-integrations/connectors/source-activecampaign/requirements.txt new file mode 100644 index 000000000000..0411042aa091 --- /dev/null +++ b/airbyte-integrations/connectors/source-activecampaign/requirements.txt @@ -0,0 +1,2 @@ +-e ../../bases/source-acceptance-test +-e . diff --git a/airbyte-integrations/connectors/source-activecampaign/setup.py b/airbyte-integrations/connectors/source-activecampaign/setup.py new file mode 100644 index 000000000000..b7d4d4645db4 --- /dev/null +++ b/airbyte-integrations/connectors/source-activecampaign/setup.py @@ -0,0 +1,29 @@ +# +# Copyright (c) 2022 Airbyte, Inc., all rights reserved. +# + + +from setuptools import find_packages, setup + +MAIN_REQUIREMENTS = [ + "airbyte-cdk~=0.1", +] + +TEST_REQUIREMENTS = [ + "pytest~=6.1", + "pytest-mock~=3.6.1", + "source-acceptance-test", +] + +setup( + name="source_activecampaign", + description="Source implementation for Activecampaign.", + author="Airbyte", + author_email="contact@airbyte.io", + packages=find_packages(), + install_requires=MAIN_REQUIREMENTS, + package_data={"": ["*.json", "*.yaml", "schemas/*.json", "schemas/shared/*.json"]}, + extras_require={ + "tests": TEST_REQUIREMENTS, + }, +) diff --git a/airbyte-integrations/connectors/source-activecampaign/source_activecampaign/__init__.py b/airbyte-integrations/connectors/source-activecampaign/source_activecampaign/__init__.py new file mode 100644 index 000000000000..c350061c7a62 --- /dev/null +++ b/airbyte-integrations/connectors/source-activecampaign/source_activecampaign/__init__.py @@ -0,0 +1,8 @@ +# +# Copyright (c) 2022 Airbyte, Inc., all rights reserved. +# + + +from .source import SourceActivecampaign + +__all__ = ["SourceActivecampaign"] diff --git a/airbyte-integrations/connectors/source-activecampaign/source_activecampaign/activecampaign.yaml b/airbyte-integrations/connectors/source-activecampaign/source_activecampaign/activecampaign.yaml new file mode 100644 index 000000000000..71ab72c835ea --- /dev/null +++ b/airbyte-integrations/connectors/source-activecampaign/source_activecampaign/activecampaign.yaml @@ -0,0 +1,100 @@ +version: "0.1.0" + +definitions: + selector: + extractor: + # API Docs: https://developers.activecampaign.com/reference/schema + field_pointer: ["{{ options['name'] }}"] + + requester: + # API Docs: https://developers.activecampaign.com/reference/url + url_base: "https://{{ config['account_username'] }}.api-us1.com/api/3" + http_method: "GET" + authenticator: + type: ApiKeyAuthenticator + header: "Api-Token" + api_token: "{{ config['api_key'] }}" + + retriever: + record_selector: + $ref: "*ref(definitions.selector)" + + # API Docs: https://developers.activecampaign.com/reference/pagination + paginator: + type: DefaultPaginator + url_base: "*ref(definitions.requester.url_base)" + page_size_option: + inject_into: "request_parameter" + field_name: "limit" + pagination_strategy: + type: "OffsetIncrement" + page_size: 20 + page_token_option: + inject_into: "request_parameter" + field_name: "offset" + + requester: + $ref: "*ref(definitions.requester)" + + base_stream: + retriever: + $ref: "*ref(definitions.retriever)" + + # API Docs: https://developers.activecampaign.com/reference/list-all-campaigns + campaigns_stream: + $ref: "*ref(definitions.base_stream)" + $options: + name: "campaigns" + primary_key: "id" + path: "/campaigns" + + # API Docs: https://developers.activecampaign.com/reference/list-all-contacts + contacts_stream: + $ref: "*ref(definitions.base_stream)" + $options: + name: "contacts" + primary_key: "id" + path: "/contacts" + + # API Docs: https://developers.activecampaign.com/reference/list-all-deals + deals_stream: + $ref: "*ref(definitions.base_stream)" + $options: + name: "deals" + primary_key: "id" + path: "/deals" + + # API Docs: https://developers.activecampaign.com/reference/retrieve-all-lists + lists_stream: + $ref: "*ref(definitions.base_stream)" + $options: + name: "lists" + primary_key: "id" + path: "/lists" + + # API Docs: https://developers.activecampaign.com/reference/list-all-segments + segments_stream: + $ref: "*ref(definitions.base_stream)" + $options: + name: "segments" + primary_key: "id" + path: "/segments" + + # API Docs: https://developers.activecampaign.com/reference/forms-1 + forms_stream: + $ref: "*ref(definitions.base_stream)" + $options: + name: "forms" + primary_key: "id" + path: "/forms" + +streams: + - "*ref(definitions.campaigns_stream)" + - "*ref(definitions.contacts_stream)" + - "*ref(definitions.lists_stream)" + - "*ref(definitions.deals_stream)" + - "*ref(definitions.segments_stream)" + - "*ref(definitions.forms_stream)" + +check: + stream_names: ["campaigns"] diff --git a/airbyte-integrations/connectors/source-activecampaign/source_activecampaign/schemas/campaigns.json b/airbyte-integrations/connectors/source-activecampaign/source_activecampaign/schemas/campaigns.json new file mode 100644 index 000000000000..569f22f47dbb --- /dev/null +++ b/airbyte-integrations/connectors/source-activecampaign/source_activecampaign/schemas/campaigns.json @@ -0,0 +1,383 @@ +{ + "type": "object", + "properties": { + "type": { + "type": "string" + }, + "userid": { + "type": "string" + }, + "segmentid": { + "type": "string" + }, + "bounceid": { + "type": "string" + }, + "realcid": { + "type": "string" + }, + "sendid": { + "type": "string" + }, + "threadid": { + "type": "string" + }, + "seriesid": { + "type": "string" + }, + "formid": { + "type": "string" + }, + "basetemplateid": { + "type": "string" + }, + "basemessageid": { + "type": "string" + }, + "addressid": { + "type": "string" + }, + "source": { + "type": "string" + }, + "name": { + "type": "string" + }, + "cdate": { + "type": "string" + }, + "mdate": { + "type": "string" + }, + "sdate": { + "type": ["string", "null"] + }, + "ldate": { + "type": ["string", "null"] + }, + "send_amt": { + "type": "string" + }, + "total_amt": { + "type": "string" + }, + "opens": { + "type": "string" + }, + "uniqueopens": { + "type": "string" + }, + "linkclicks": { + "type": "string" + }, + "uniquelinkclicks": { + "type": "string" + }, + "subscriberclicks": { + "type": "string" + }, + "forwards": { + "type": "string" + }, + "uniqueforwards": { + "type": "string" + }, + "hardbounces": { + "type": "string" + }, + "softbounces": { + "type": "string" + }, + "unsubscribes": { + "type": "string" + }, + "unsubreasons": { + "type": "string" + }, + "updates": { + "type": "string" + }, + "socialshares": { + "type": "string" + }, + "replies": { + "type": "string" + }, + "uniquereplies": { + "type": "string" + }, + "status": { + "type": "string" + }, + "public": { + "type": "string" + }, + "mail_transfer": { + "type": "string" + }, + "mail_send": { + "type": "string" + }, + "mail_cleanup": { + "type": "string" + }, + "mailer_log_file": { + "type": "string" + }, + "tracklinks": { + "type": "string" + }, + "tracklinksanalytics": { + "type": "string" + }, + "trackreads": { + "type": "string" + }, + "trackreadsanalytics": { + "type": "string" + }, + "analytics_campaign_name": { + "type": "string" + }, + "tweet": { + "type": "string" + }, + "facebook": { + "type": "string" + }, + "survey": { + "type": "string" + }, + "embed_images": { + "type": "string" + }, + "htmlunsub": { + "type": "string" + }, + "textunsub": { + "type": "string" + }, + "htmlunsubdata": { + "type": ["string", "null"] + }, + "textunsubdata": { + "type": ["string", "null"] + }, + "recurring": { + "type": "string" + }, + "willrecur": { + "type": "string" + }, + "split_type": { + "type": "string" + }, + "split_content": { + "type": "string" + }, + "split_offset": { + "type": "string" + }, + "split_offset_type": { + "type": "string" + }, + "split_winner_messageid": { + "type": "string" + }, + "split_winner_awaiting": { + "type": "string" + }, + "responder_offset": { + "type": "string" + }, + "responder_type": { + "type": "string" + }, + "responder_existing": { + "type": "string" + }, + "reminder_field": { + "type": "string" + }, + "reminder_format": { + "type": ["string", "null"] + }, + "reminder_type": { + "type": "string" + }, + "reminder_offset": { + "type": "string" + }, + "reminder_offset_type": { + "type": "string" + }, + "reminder_offset_sign": { + "type": "string" + }, + "reminder_last_cron_run": { + "type": ["string", "null"] + }, + "activerss_interval": { + "type": "string" + }, + "activerss_url": { + "type": ["string", "null"] + }, + "activerss_items": { + "type": "string" + }, + "ip4": { + "type": "string" + }, + "laststep": { + "type": "string" + }, + "managetext": { + "type": "string" + }, + "schedule": { + "type": "string" + }, + "scheduleddate": { + "type": ["string", "null"] + }, + "waitpreview": { + "type": ["string", "null"] + }, + "deletestamp": { + "type": ["string", "null"] + }, + "replysys": { + "type": "string" + }, + "links": { + "type": "object", + "properties": { + "user": { + "type": "string" + }, + "automation": { + "type": "string" + }, + "campaignMessage": { + "type": "string" + }, + "campaignMessages": { + "type": "string" + }, + "links": { + "type": "string" + }, + "campaignLists": { + "type": "string" + } + }, + "required": [ + "user", + "automation", + "campaignMessage", + "campaignMessages", + "links", + "campaignLists" + ] + }, + "id": { + "type": "string" + }, + "user": { + "type": "string" + }, + "automation": { + "type": ["string", "null"] + } + }, + "required": [ + "type", + "userid", + "segmentid", + "bounceid", + "realcid", + "sendid", + "threadid", + "seriesid", + "formid", + "basetemplateid", + "basemessageid", + "addressid", + "source", + "name", + "cdate", + "mdate", + "sdate", + "ldate", + "send_amt", + "total_amt", + "opens", + "uniqueopens", + "linkclicks", + "uniquelinkclicks", + "subscriberclicks", + "forwards", + "uniqueforwards", + "hardbounces", + "softbounces", + "unsubscribes", + "unsubreasons", + "updates", + "socialshares", + "replies", + "uniquereplies", + "status", + "public", + "mail_transfer", + "mail_send", + "mail_cleanup", + "mailer_log_file", + "tracklinks", + "tracklinksanalytics", + "trackreads", + "trackreadsanalytics", + "analytics_campaign_name", + "tweet", + "facebook", + "survey", + "embed_images", + "htmlunsub", + "textunsub", + "htmlunsubdata", + "textunsubdata", + "recurring", + "willrecur", + "split_type", + "split_content", + "split_offset", + "split_offset_type", + "split_winner_messageid", + "split_winner_awaiting", + "responder_offset", + "responder_type", + "responder_existing", + "reminder_field", + "reminder_format", + "reminder_type", + "reminder_offset", + "reminder_offset_type", + "reminder_offset_sign", + "reminder_last_cron_run", + "activerss_interval", + "activerss_url", + "activerss_items", + "ip4", + "laststep", + "managetext", + "schedule", + "scheduleddate", + "waitpreview", + "deletestamp", + "replysys", + "links", + "id", + "user", + "automation" + ] +} diff --git a/airbyte-integrations/connectors/source-activecampaign/source_activecampaign/schemas/contacts.json b/airbyte-integrations/connectors/source-activecampaign/source_activecampaign/schemas/contacts.json new file mode 100644 index 000000000000..346253e3a5da --- /dev/null +++ b/airbyte-integrations/connectors/source-activecampaign/source_activecampaign/schemas/contacts.json @@ -0,0 +1,245 @@ +{ + "type": "object", + "properties": { + "cdate": { + "type": "string" + }, + "email": { + "type": "string" + }, + "phone": { + "type": "string" + }, + "firstName": { + "type": "string" + }, + "lastName": { + "type": "string" + }, + "orgid": { + "type": "string" + }, + "orgname": { + "type": "string" + }, + "segmentio_id": { + "type": "string" + }, + "bounced_hard": { + "type": "string" + }, + "bounced_soft": { + "type": "string" + }, + "bounced_date": { + "type": ["string", "null"] + }, + "ip": { + "type": "string" + }, + "ua": { + "type": ["string", "null"] + }, + "hash": { + "type": "string" + }, + "socialdata_lastcheck": { + "type": ["string", "null"] + }, + "email_local": { + "type": "string" + }, + "email_domain": { + "type": "string" + }, + "sentcnt": { + "type": "string" + }, + "rating_tstamp": { + "type": ["string", "null"] + }, + "gravatar": { + "type": "string" + }, + "deleted": { + "type": "string" + }, + "anonymized": { + "type": "string" + }, + "adate": { + "type": ["string", "null"] + }, + "udate": { + "type": "string" + }, + "edate": { + "type": ["string", "null"] + }, + "deleted_at": { + "type": ["string", "null"] + }, + "created_utc_timestamp": { + "type": "string" + }, + "updated_utc_timestamp": { + "type": "string" + }, + "created_timestamp": { + "type": "string" + }, + "updated_timestamp": { + "type": "string" + }, + "created_by": { + "type": ["string", "null"] + }, + "updated_by": { + "type": ["string", "null"] + }, + "email_empty": { + "type": "boolean" + }, + "mpp_tracking": { + "type": "string" + }, + "scoreValues": { + "type": "array", + "items": { + "type": "string" + } + }, + "accountContacts": { + "type": "array", + "items": { + "type": "string" + } + }, + "links": { + "type": "object", + "properties": { + "bounceLogs": { + "type": "string" + }, + "contactAutomations": { + "type": "string" + }, + "contactData": { + "type": "string" + }, + "contactGoals": { + "type": "string" + }, + "contactLists": { + "type": "string" + }, + "contactLogs": { + "type": "string" + }, + "contactTags": { + "type": "string" + }, + "contactDeals": { + "type": "string" + }, + "deals": { + "type": "string" + }, + "fieldValues": { + "type": "string" + }, + "geoIps": { + "type": "string" + }, + "notes": { + "type": "string" + }, + "organization": { + "type": "string" + }, + "plusAppend": { + "type": "string" + }, + "trackingLogs": { + "type": "string" + }, + "scoreValues": { + "type": "string" + }, + "accountContacts": { + "type": "string" + }, + "automationEntryCounts": { + "type": "string" + } + }, + "required": [ + "bounceLogs", + "contactAutomations", + "contactData", + "contactGoals", + "contactLists", + "contactLogs", + "contactTags", + "contactDeals", + "deals", + "fieldValues", + "geoIps", + "notes", + "organization", + "plusAppend", + "trackingLogs", + "scoreValues", + "accountContacts", + "automationEntryCounts" + ] + }, + "id": { + "type": "string" + }, + "organization": { + "type": "null" + } + }, + "required": [ + "cdate", + "email", + "phone", + "firstName", + "lastName", + "orgid", + "orgname", + "segmentio_id", + "bounced_hard", + "bounced_soft", + "bounced_date", + "ip", + "ua", + "hash", + "socialdata_lastcheck", + "email_local", + "email_domain", + "sentcnt", + "rating_tstamp", + "gravatar", + "deleted", + "anonymized", + "adate", + "udate", + "edate", + "deleted_at", + "created_utc_timestamp", + "updated_utc_timestamp", + "created_timestamp", + "updated_timestamp", + "created_by", + "updated_by", + "email_empty", + "mpp_tracking", + "scoreValues", + "accountContacts", + "links", + "id", + "organization" + ] +} diff --git a/airbyte-integrations/connectors/source-activecampaign/source_activecampaign/schemas/deals.json b/airbyte-integrations/connectors/source-activecampaign/source_activecampaign/schemas/deals.json new file mode 100644 index 000000000000..0b180501de0e --- /dev/null +++ b/airbyte-integrations/connectors/source-activecampaign/source_activecampaign/schemas/deals.json @@ -0,0 +1,131 @@ +{ + "type": "object", + "properties": { + "owner": { + "type": ["string", "null"] + }, + "contact": { + "type": ["string", "null"] + }, + "organization": { + "type": ["string", "null"] + }, + "group": { + "type": ["string", "null"] + }, + "stage": { + "type": ["string", "null"] + }, + "title": { + "type": ["string", "null"] + }, + "description": { + "type": ["string", "null"] + }, + "percent": { + "type": ["string", "null"] + }, + "cdate": { + "type": ["string", "null"] + }, + "mdate": { + "type": ["string", "null"] + }, + "nextdate": { + "type": ["string", "null"] + }, + "nexttaskid": { + "type": ["string", "null"] + }, + "nextTask": { + "type": ["string", "null"] + }, + "value": { + "type": ["string", "null"] + }, + "currency": { + "type": ["string", "null"] + }, + "winProbability": { + "type": ["integer", "null"] + }, + "winProbabilityMdate": { + "type": ["string", "null"] + }, + "status": { + "type": ["string", "null"] + }, + "activitycount": { + "type": ["string", "null"] + }, + "nextdealid": { + "type": ["string", "null"] + }, + "edate": { + "type": ["string", "null"] + }, + "links": { + "type": "object", + "properties": { + "dealActivities": { + "type": ["string", "null"] + }, + "contact": { + "type": ["string", "null"] + }, + "contactDeals": { + "type": ["string", "null"] + }, + "group": { + "type": ["string", "null"] + }, + "nextTask": { + "type": ["string", "null"] + }, + "notes": { + "type": ["string", "null"] + }, + "account": { + "type": ["string", "null"] + }, + "customerAccount": { + "type": ["string", "null"] + }, + "organization": { + "type": ["string", "null"] + }, + "owner": { + "type": ["string", "null"] + }, + "scoreValues": { + "type": ["string", "null"] + }, + "stage": { + "type": ["string", "null"] + }, + "tasks": { + "type": ["string", "null"] + }, + "dealCustomFieldData": { + "type": ["string", "null"] + } + } + }, + "id": { + "type": "string" + }, + "hash": { + "type": ["string", "null"] + }, + "isDisabled": { + "type": ["boolean", "null"] + }, + "account": { + "type": ["string", "null"] + }, + "customerAccount": { + "type": ["string", "null"] + } + }, + "required": ["id"] +} diff --git a/airbyte-integrations/connectors/source-activecampaign/source_activecampaign/schemas/forms.json b/airbyte-integrations/connectors/source-activecampaign/source_activecampaign/schemas/forms.json new file mode 100644 index 000000000000..195e03258de9 --- /dev/null +++ b/airbyte-integrations/connectors/source-activecampaign/source_activecampaign/schemas/forms.json @@ -0,0 +1,277 @@ +{ + "$id": "root", + "$schema": "http://json-schema.org/draft-07/schema#", + "type": "object", + "properties": { + "name": { + "type": ["string", "null"], + "examples": ["Testing"] + }, + "action": { + "type": ["string", "null"] + }, + "actiondata": { + "type": "object", + "properties": { + "actions": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type": { + "type": ["string", "null"], + "examples": ["subscribe-to-list"] + }, + "email": { + "type": ["string", "null"], + "examples": ["johndoe@example.com"] + }, + "list": { + "type": ["string", "null"], + "examples": ["1"] + } + } + } + } + } + }, + "submit": { + "type": ["string", "null"], + "examples": ["show-thank-you"] + }, + "submitdata": { + "type": "object", + "properties": { + "url": { + "type": ["string", "null"] + } + } + }, + "url": { + "type": ["string", "null"] + }, + "layout": { + "type": ["string", "null"], + "examples": ["inline-form"] + }, + "title": { + "type": ["string", "null"] + }, + "body": { + "type": ["string", "null"] + }, + "button": { + "type": ["string", "null"], + "examples": ["Submit"] + }, + "thanks": { + "type": ["string", "null"], + "examples": ["Thanks for signing up!"] + }, + "style": { + "type": "object", + "properties": { + "background": { + "type": ["string", "null"], + "examples": ["FFFFFF"] + }, + "dark": { + "type": ["boolean", "null"], + "examples": [true, false] + }, + "fontcolor": { + "type": ["string", "null"], + "examples": ["000000"] + }, + "layout": { + "type": ["string", "null"], + "examples": ["normal"] + }, + "border": { + "type": "object", + "properties": { + "width": { + "type": ["integer", "null"], + "examples": [0] + }, + "style": { + "type": ["string", "null"], + "examples": ["solid"] + }, + "color": { + "type": ["string", "null"], + "examples": ["B0B0B0"] + }, + "radius": { + "type": ["integer", "null"], + "default": 0, + "examples": [0] + } + } + }, + "width": { + "type": ["integer", "null"], + "examples": [500] + }, + "ac_branding": { + "type": ["boolean", "null"], + "examples": [true, false] + }, + "button": { + "type": "object", + "properties": { + "padding": { + "type": ["integer", "null"], + "examples": [10] + }, + "background": { + "type": ["string", "null"], + "examples": ["333333"] + }, + "fontcolor": { + "type": ["string", "null"], + "examples": ["FFFFFF"] + }, + "border": { + "type": "object", + "properties": { + "radius": { + "type": ["integer", "null"], + "examples": [4] + }, + "color": { + "type": ["string", "null"], + "examples": ["333333"] + }, + "style": { + "type": ["string", "null"], + "examples": ["solid"] + }, + "width": { + "type": ["integer", "null"], + "examples": [0] + } + } + } + } + } + } + }, + "options": { + "type": "object", + "properties": { + "blanks_overwrite": { + "type": ["boolean", "null"], + "examples": [true, false] + }, + "confaction": { + "type": ["string", "null"], + "examples": ["show-message"] + }, + "sendoptin": { + "type": ["boolean", "null"], + "examples": [true, false] + }, + "optin_id": { + "type": ["integer", "null"], + "examples": [1] + }, + "optin_created": { + "type": "boolean", + "default": true, + "examples": [true, false] + }, + "confform": { + "type": ["string", "null"], + "examples": ["2"] + } + } + }, + "cfields": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type": { + "type": ["string", "null"], + "examples": ["header"] + }, + "header": { + "type": ["string", "null"], + "examples": ["Subscribe for Email Updates"] + }, + "class": { + "type": ["string", "null"], + "examples": ["_x41699710"] + } + } + } + }, + "parentformid": { + "type": ["string", "null"], + "examples": ["0"] + }, + "userid": { + "type": ["string", "null"], + "examples": ["1"] + }, + "addressid": { + "type": ["string", "null"], + "examples": ["0"] + }, + "cdate": { + "type": ["string", "null"], + "examples": ["2018-08-17T13:47:31-05:00"] + }, + "udate": { + "type": ["string", "null"], + "examples": ["2018-08-17T13:47:38-05:00"] + }, + "entries": { + "type": ["string", "null"], + "examples": ["0"] + }, + "aid": { + "type": ["string", "null"], + "default": "0", + "examples": ["0"] + }, + "defaultscreenshot": { + "type": ["string", "null"], + "default": "http://img-us1.com/default-form.gif", + "examples": ["http://img-us1.com/default-form.gif"] + }, + "recent": { + "type": "array" + }, + "contacts": { + "type": "integer", + "default": 0, + "examples": [0] + }, + "deals": { + "type": "integer", + "default": 0, + "examples": [0] + }, + "links": { + "type": "object", + "properties": { + "address": { + "type": ["string", "null"], + "default": "https://:account.api-us1.com/api/3/forms/1/address", + "examples": ["https://:account.api-us1.com/api/3/forms/1/address"] + } + } + }, + "id": { + "type": "string", + "default": "1", + "examples": ["1"] + }, + "address": { + "type": ["string", "null"] + } + }, + "required": ["id"] +} diff --git a/airbyte-integrations/connectors/source-activecampaign/source_activecampaign/schemas/lists.json b/airbyte-integrations/connectors/source-activecampaign/source_activecampaign/schemas/lists.json new file mode 100644 index 000000000000..9baba34c9f62 --- /dev/null +++ b/airbyte-integrations/connectors/source-activecampaign/source_activecampaign/schemas/lists.json @@ -0,0 +1,149 @@ +{ + "type": "object", + "properties": { + "stringid": { + "type": ["string", "null"] + }, + "userid": { + "type": ["string", "null"] + }, + "name": { + "type": ["string", "null"] + }, + "cdate": { + "type": ["string", "null"] + }, + "p_use_tracking": { + "type": ["string", "null"] + }, + "p_use_analytics_read": { + "type": ["string", "null"] + }, + "p_use_analytics_link": { + "type": ["string", "null"] + }, + "p_use_twitter": { + "type": ["string", "null"] + }, + "p_use_facebook": { + "type": ["string", "null"] + }, + "p_embed_image": { + "type": ["string", "null"] + }, + "p_use_captcha": { + "type": ["string", "null"] + }, + "send_last_broadcast": { + "type": ["string", "null"] + }, + "private": { + "type": ["string", "null"] + }, + "analytics_domains": { + "type": ["string", "null"] + }, + "analytics_source": { + "type": ["string", "null"] + }, + "analytics_ua": { + "type": ["string", "null"] + }, + "twitter_token": { + "type": ["string", "null"] + }, + "twitter_token_secret": { + "type": ["string", "null"] + }, + "facebook_session": { + "type": ["string", "null"] + }, + "carboncopy": { + "type": ["string", "null"] + }, + "subscription_notify": { + "type": ["string", "null"] + }, + "unsubscription_notify": { + "type": ["string", "null"] + }, + "require_name": { + "type": ["string", "null"] + }, + "get_unsubscribe_reason": { + "type": ["string", "null"] + }, + "to_name": { + "type": ["string", "null"] + }, + "optinoptout": { + "type": ["string", "null"] + }, + "sender_name": { + "type": ["string", "null"] + }, + "sender_addr1": { + "type": ["string", "null"] + }, + "sender_addr2": { + "type": ["string", "null"] + }, + "sender_city": { + "type": ["string", "null"] + }, + "sender_state": { + "type": ["string", "null"] + }, + "sender_zip": { + "type": ["string", "null"] + }, + "sender_country": { + "type": ["string", "null"] + }, + "sender_phone": { + "type": ["string", "null"] + }, + "sender_url": { + "type": ["string", "null"] + }, + "sender_reminder": { + "type": ["string", "null"] + }, + "fulladdress": { + "type": ["string", "null"] + }, + "optinmessageid": { + "type": ["string", "null"] + }, + "optoutconf": { + "type": ["string", "null"] + }, + "deletestamp": { + "type": ["string", "null"] + }, + "udate": { + "type": ["string", "null"] + }, + "links": { + "type": "object", + "properties": { + "contactGoalLists": { + "type": ["string", "null"] + }, + "user": { + "type": ["string", "null"] + }, + "addressLists": { + "type": ["string", "null"] + } + } + }, + "id": { + "type": "string" + }, + "user": { + "type": ["string", "null"] + } + }, + "required": ["id"] +} diff --git a/airbyte-integrations/connectors/source-activecampaign/source_activecampaign/schemas/segments.json b/airbyte-integrations/connectors/source-activecampaign/source_activecampaign/schemas/segments.json new file mode 100644 index 000000000000..3ac3ece26b10 --- /dev/null +++ b/airbyte-integrations/connectors/source-activecampaign/source_activecampaign/schemas/segments.json @@ -0,0 +1,29 @@ +{ + "type": "object", + "properties": { + "name": { + "type": ["string", "null"], + "examples": ["Segment of Automation 1"] + }, + "logic": { + "type": ["string", "null"], + "examples": ["and"] + }, + "hidden": { + "type": ["string", "null"], + "examples": ["0"] + }, + "seriesid": { + "type": ["string", "null"], + "examples": ["1"] + }, + "links": { + "type": ["array", "null"] + }, + "id": { + "type": "string", + "examples": ["1"] + } + }, + "required": ["id"] +} diff --git a/airbyte-integrations/connectors/source-activecampaign/source_activecampaign/source.py b/airbyte-integrations/connectors/source-activecampaign/source_activecampaign/source.py new file mode 100644 index 000000000000..5ef118e94175 --- /dev/null +++ b/airbyte-integrations/connectors/source-activecampaign/source_activecampaign/source.py @@ -0,0 +1,18 @@ +# +# Copyright (c) 2022 Airbyte, Inc., all rights reserved. +# + +from airbyte_cdk.sources.declarative.yaml_declarative_source import YamlDeclarativeSource + +""" +This file provides the necessary constructs to interpret a provided declarative YAML configuration file into +source connector. + +WARNING: Do not modify this file. +""" + + +# Declarative Source +class SourceActivecampaign(YamlDeclarativeSource): + def __init__(self): + super().__init__(**{"path_to_yaml": "activecampaign.yaml"}) diff --git a/airbyte-integrations/connectors/source-activecampaign/source_activecampaign/spec.yaml b/airbyte-integrations/connectors/source-activecampaign/source_activecampaign/spec.yaml new file mode 100644 index 000000000000..8ad5244c2cc7 --- /dev/null +++ b/airbyte-integrations/connectors/source-activecampaign/source_activecampaign/spec.yaml @@ -0,0 +1,20 @@ +documentationUrl: https://docs.airbyte.com/integrations/sources/activecampaign +connectionSpecification: + $schema: http://json-schema.org/draft-07/schema# + title: Activecampaign Spec + type: object + required: + - api_key + - account_username + + additionalProperties: true + + properties: + api_key: + type: string + description: API Key + airbyte_secret: true + + account_username: + type: string + description: Account Username diff --git a/docs/integrations/README.md b/docs/integrations/README.md index 578fd492e152..b81b6a10c8b2 100644 --- a/docs/integrations/README.md +++ b/docs/integrations/README.md @@ -17,6 +17,7 @@ For more information about the grading system, see [Product Release Stages](http | Connector | Product Release Stage| Available in Cloud? | |:--------------------------------------------------------------------------------------------| :------------------- | :------------------ | | [3PL Central](sources/tplcentral.md) | Alpha | No | +| [ActiveCampaign](sources/activecampaign.md) | Alpha | No | | [Adjust](sources/adjust.md) | Alpha | No | | [Airtable](sources/airtable.md) | Alpha | Yes | | [AlloyDB](sources/alloydb.md) | Generally Available | Yes | diff --git a/docs/integrations/sources/activecampaign.md b/docs/integrations/sources/activecampaign.md new file mode 100644 index 000000000000..186544d5bdb7 --- /dev/null +++ b/docs/integrations/sources/activecampaign.md @@ -0,0 +1,38 @@ +# ActiveCampaign + +## Sync overview + +This source can sync data from the [ActiveCampaign API](https://developers.activecampaign.com/reference/overview). At present this connector only supports full refresh syncs meaning that each time you use the connector it will sync all available records from scratch. Please use cautiously if you expect your API to have a lot of records. + +## This Source Supports the Following Streams + +* campaigns +* contacts +* lists +* deals +* segments +* forms + +### Features + +| Feature | Supported?\(Yes/No\) | Notes | +| :--- | :--- | :--- | +| Full Refresh Sync | Yes | | +| Incremental Sync | No | | + +### Performance considerations + +The connector has a rate limit of 5 requests per second per account. + +## Getting started + +### Requirements + +* ActiveCampaign account +* ActiveCampaign API Key + +## Changelog + +| Version | Date | Pull Request | Subject | +|:--------|:-----------| :----------- |:-----------------------------------------------------------| +| 0.1.0 | 2022-10-25 | [18335](https://github.com/airbytehq/airbyte/pull/18335) | Initial commit | \ No newline at end of file