Skip to content
This repository has been archived by the owner on Apr 18, 2024. It is now read-only.

Commit

Permalink
Add calls/ stream. (#35)
Browse files Browse the repository at this point in the history
* feat: Add `activityType` and `teamId` attributes to engagements stream.

* tidy: remove references to `engagements` stream as it's no longer supported.

* feat: Add /calls stream.

* docs: Add references to Calls and Meetings API docs.
  • Loading branch information
benw-at-birdie authored Nov 22, 2022
1 parent 2a98e9e commit 9abc312
Show file tree
Hide file tree
Showing 5 changed files with 99 additions and 180 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,10 @@ This tap:
- [Contacts](https://developers.hubspot.com/docs/methods/contacts/get_contacts)
- [Contact Lists](http://developers.hubspot.com/docs/methods/lists/get_lists)
- [Deals](http://developers.hubspot.com/docs/methods/deals/get_deals_modified)
- [Meetings](https://developers.hubspot.com/docs/api/crm/meetings)
- [Calls](https://developers.hubspot.com/docs/api/crm/calls)
- [Deal Pipelines](https://developers.hubspot.com/docs/methods/deal-pipelines/get-all-deal-pipelines)
- [Email Events](http://developers.hubspot.com/docs/methods/email/get_events)
- [Engagements](https://developers.hubspot.com/docs/methods/engagements/get-all-engagements)
- [Forms](http://developers.hubspot.com/docs/methods/forms/v2/get_forms)
- [Keywords](http://developers.hubspot.com/docs/methods/keywords/get_keywords)
- [Owners](http://developers.hubspot.com/docs/methods/owners/get_owners)
Expand Down
76 changes: 76 additions & 0 deletions tap_hubspot/schemas/calls.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
{
"type": "object",
"properties":{
"id": {
"type": ["null","string"]
},
"createdAt": {
"type": ["null", "string"],
"format": "date-time"
},
"updatedAt": {
"type": ["null", "string"],
"format": "date-time"
},
"archived": {
"type": ["null", "boolean"]
},
"properties": {
"type": "object",
"properties": {
"createdate": {
"type": ["null", "string"],
"format": "date-time"
},
"hs_call_body": {
"type": ["null", "string"]
},
"hs_call_duration": {
"type": ["null", "string"],
"format": "number"
},
"hs_call_from_number": {
"type": ["null", "string"]
},
"hs_call_recording_url": {
"type": ["null", "string"]
},
"hs_call_status": {
"type": ["null", "string"]
},
"hs_call_title": {
"type": ["null", "string"]
},
"hs_call_to_number": {
"type": ["null", "string"]
},
"hs_call_direction": {
"type": ["null", "string"]
},
"hs_activity_type": {
"type": ["null", "string"]
},
"hs_call_disposition": {
"type": ["null", "string"]
},
"hs_call_callee_object_type_id": {
"type": ["null", "string"]
},
"hs_call_callee_object_id": {
"type": ["null", "string"]
},
"hs_lastmodifieddate": {
"type": ["null", "string"],
"format": "date-time"
},
"hs_timestamp": {
"type": ["null", "string"],
"format": "date-time"
},
"hubspot_owner_id": {
"type": ["null", "string"]
}
}
}
}
}
179 changes: 0 additions & 179 deletions tap_hubspot/schemas/engagements.json

This file was deleted.

19 changes: 19 additions & 0 deletions tap_hubspot/streams.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,25 @@ def schema(self) -> dict:
return self.cached_schema


class CallsStream(HubspotStream):
name = "calls"
path = f"/crm/v3/objects/calls"
primary_keys = ["id"]

def get_url_params(
self, context: Optional[dict], next_page_token: Optional[Any]
) -> Dict[str, Any]:
params = super().get_url_params(context, next_page_token)
params["properties"] = ",".join(self.properties)
return params

@property
def schema(self) -> dict:
if self.cached_schema is None:
self.cached_schema, self.properties = self.get_custom_schema()
return self.cached_schema


class OwnersStream(HubspotStream):
"""Define custom stream."""

Expand Down
2 changes: 2 additions & 0 deletions tap_hubspot/tap.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
CompaniesStream,
DealsStream,
MeetingsStream,
CallsStream,
OwnersStream,
PropertiesCompaniesStream,
PropertiesContactsStream,
Expand Down Expand Up @@ -59,6 +60,7 @@
CompaniesStream,
DealsStream,
MeetingsStream,
CallsStream,
PropertiesCompaniesStream,
PropertiesContactsStream,
PropertiesDealsStream,
Expand Down

0 comments on commit 9abc312

Please sign in to comment.