Skip to content

Commit

Permalink
source-smartreach contribution from ombhardwajj (#48095)
Browse files Browse the repository at this point in the history
  • Loading branch information
ombhardwajj authored Nov 8, 2024
1 parent 18f13b9 commit affd12e
Show file tree
Hide file tree
Showing 6 changed files with 435 additions and 0 deletions.
35 changes: 35 additions & 0 deletions airbyte-integrations/connectors/source-smartreach/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# Smartreach
This directory contains the manifest-only connector for `source-smartreach`.

Smartreach is a sales engagement platform.
Using this connector we extract data from two streams : campaigns and prospects.
Docs : https://smartreach.io/api_docs#smartreach-api

## Usage
There are multiple ways to use this connector:
- You can use this connector as any other connector in Airbyte Marketplace.
- You can load this connector in `pyairbyte` using `get_source`!
- You can open this connector in Connector Builder, edit it, and publish to your workspaces.

Please refer to the manifest-only connector documentation for more details.

## Local Development
We recommend you use the Connector Builder to edit this connector.

But, if you want to develop this connector locally, you can use the following steps.

### Environment Setup
You will need `airbyte-ci` installed. You can find the documentation [here](airbyte-ci).

### Build
This will create a dev image (`source-smartreach:dev`) that you can use to test the connector locally.
```bash
airbyte-ci connectors --name=source-smartreach build
```

### Test
This will run the acceptance tests for the connector.
```bash
airbyte-ci connectors --name=source-smartreach test
```

Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# See [Connector Acceptance Tests](https://docs.airbyte.com/connector-development/testing-connectors/connector-acceptance-tests-reference)
# for more information about how to configure these tests
connector_image: airbyte/source-smartreach:dev
acceptance_tests:
spec:
tests:
- spec_path: "manifest.yaml"
connection:
bypass_reason: "This is a builder contribution, and we do not have secrets at this time"
discovery:
bypass_reason: "This is a builder contribution, and we do not have secrets at this time"
basic_read:
bypass_reason: "This is a builder contribution, and we do not have secrets at this time"
incremental:
bypass_reason: "This is a builder contribution, and we do not have secrets at this time"
full_refresh:
bypass_reason: "This is a builder contribution, and we do not have secrets at this time"
30 changes: 30 additions & 0 deletions airbyte-integrations/connectors/source-smartreach/icon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
290 changes: 290 additions & 0 deletions airbyte-integrations/connectors/source-smartreach/manifest.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,290 @@
version: 6.1.0

type: DeclarativeSource

description: >-
Smartreach is a sales engagement platform.
Using this connector we extract data from two streams : campaigns and
prospects.
Docs : https://smartreach.io/api_docs#smartreach-api
check:
type: CheckStream
stream_names:
- campaigns

definitions:
streams:
campaigns:
type: DeclarativeStream
name: campaigns
primary_key:
- id
retriever:
type: SimpleRetriever
requester:
$ref: "#/definitions/base_requester"
path: campaigns
http_method: GET
request_parameters:
team_id: "{{ config['teamid'] }}"
record_selector:
type: RecordSelector
extractor:
type: DpathExtractor
field_path:
- data
- campaigns
schema_loader:
type: InlineSchemaLoader
schema:
$ref: "#/schemas/campaigns"
prospects:
type: DeclarativeStream
name: prospects
retriever:
type: SimpleRetriever
requester:
$ref: "#/definitions/base_requester"
path: prospects
http_method: GET
request_parameters:
team_id: "{{ config['teamid'] }}"
record_selector:
type: RecordSelector
extractor:
type: DpathExtractor
field_path: []
paginator:
type: DefaultPaginator
page_token_option:
type: RequestOption
inject_into: request_parameter
field_name: page
pagination_strategy:
type: PageIncrement
start_from_page: 1
schema_loader:
type: InlineSchemaLoader
schema:
$ref: "#/schemas/prospects"
base_requester:
type: HttpRequester
url_base: https://api.smartreach.io/api/v1/
authenticator:
type: ApiKeyAuthenticator
inject_into:
type: RequestOption
inject_into: header
field_name: X-API-KEY
api_token: "{{ config[\"api_key\"] }}"

streams:
- $ref: "#/definitions/streams/campaigns"
- $ref: "#/definitions/streams/prospects"

spec:
type: Spec
connection_specification:
type: object
$schema: http://json-schema.org/draft-07/schema#
required:
- api_key
- teamid
properties:
api_key:
type: string
title: API Key
airbyte_secret: true
order: 0
teamid:
type: number
title: TeamID
order: 1
additionalProperties: true

metadata:
autoImportSchema:
campaigns: true
prospects: true
testedStreams:
campaigns:
streamHash: e79838138dfc56f5c6cdf2f220baef899bf1de36
hasResponse: true
responsesAreSuccessful: true
hasRecords: true
primaryKeysArePresent: true
primaryKeysAreUnique: true
prospects:
streamHash: a85b47cda313055ad0fae59d8f625fd7814ea6a2
hasResponse: true
responsesAreSuccessful: true
hasRecords: true
primaryKeysArePresent: true
primaryKeysAreUnique: true
assist: {}

schemas:
campaigns:
type: object
$schema: http://json-schema.org/schema#
additionalProperties: true
properties:
created_at:
type:
- string
- "null"
id:
type: number
name:
type:
- string
- "null"
owner_id:
type:
- number
- "null"
stats:
type:
- object
- "null"
properties:
total_clicked:
type:
- number
- "null"
total_opened:
type:
- number
- "null"
total_replied:
type:
- number
- "null"
total_sent:
type:
- number
- "null"
status:
type:
- string
- "null"
required:
- id
prospects:
type: object
$schema: http://json-schema.org/schema#
additionalProperties: true
properties:
data:
type:
- object
- "null"
properties:
prospects:
type:
- array
- "null"
items:
type:
- object
- "null"
properties:
city:
type:
- string
- "null"
company:
type:
- string
- "null"
country:
type:
- string
- "null"
created_at:
type:
- string
- "null"
custom_fields:
type:
- object
- "null"
email:
type:
- string
- "null"
first_name:
type:
- string
- "null"
id:
type:
- number
- "null"
job_title:
type:
- string
- "null"
last_name:
type:
- string
- "null"
linkedin_url:
type:
- string
- "null"
list:
type:
- string
- "null"
object:
type:
- string
- "null"
owner_id:
type:
- number
- "null"
owner_uuid:
type:
- string
- "null"
phone:
type:
- string
- "null"
prospect_category:
type:
- string
- "null"
prospect_uuid:
type:
- string
- "null"
state:
type:
- string
- "null"
team_id:
type:
- number
- "null"
timezone:
type:
- string
- "null"
updated_at:
type:
- string
- "null"
message:
type:
- string
- "null"
status:
type:
- string
- "null"
Loading

0 comments on commit affd12e

Please sign in to comment.