Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/driftt/drift-python
Drift API wrapper written in Python
https://github.com/driftt/drift-python
Last synced: 3 days ago
JSON representation
Drift API wrapper written in Python
- Host: GitHub
- URL: https://github.com/driftt/drift-python
- Owner: Driftt
- License: mit
- Created: 2018-08-06T21:05:05.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2024-12-10T18:25:30.000Z (about 1 month ago)
- Last Synced: 2025-01-06T12:30:37.649Z (10 days ago)
- Language: Python
- Size: 109 KB
- Stars: 23
- Watchers: 73
- Forks: 3
- Open Issues: 10
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[![Open Source Love](https://badges.frapsoft.com/os/mit/mit.svg?v=102)](https://github.com/ellerbrock/open-source-badge/)
[![PyPI version](https://badge.fury.io/py/drift-python.svg)](https://badge.fury.io/py/drift-python)
# Drift Python
A [Drift API](https://devdocs.drift.com) wrapper written in Python.## Getting Started
To get started run `pip install drift-python````python
from drift import Drift
drift = Drift("YOUR ACCESS TOKEN")
```## Contacts
Read the docs here: [Contacts API](https://devdocs.drift.com/docs/contact-model).**Available Methods**
- `drift.contacts.get()`
- contact_id (required)
- email (optional)
- limit (optional)
-
- `drift.contacts.create()`
- **attributes (required)
Example:
`drift.contacts.create(email='[email protected]')`
- `drift.contacts.update()`
- contact_id (required)
- **attributes (required)- `drift.contacts.delete()`
- contact_id (required)
- `drift.contacts.add_tags()`
- contact_id (required)
- tags (required)
Example:
```
drift.contacts.add_tags(
conversation_id=1,
tags=[{'name': 'My Tag'}]
)
```
- `drift.contacts.remove_tag()`
- contact_id (required)
- tag_name (required)
- `drift.contacts.remove_tags_bulk()`
- contact_id (required)## Conversations
Read the docs here [Conversations API](https://devdocs.drift.com/docs/conversation-overview)**Available Methods**
- `drift.conversations.get()`
- conversation_id (required)
- `drift.conversations.list()`
- limit (optional) - defaults to `50`
- page_token (optional)- `drift.conversations.create_message()`
- conversation_id (required)
- org_id (required)
- type (required)
- body (optional)
- buttons (optional)
- edited_message_id (optional)
- edit_type (optional)
Example:
```
drift.conversations.create_message(
conversation_id=1,
org_id=1,
type='chat'
)
```
- `drift.conversations.get_messages()`
- conversation_id (required)
- next_ (optional)- `drift.conversations.get_attachments()`
- doc_id (required)
- `drift.conversations.get_metrics()`
- query (required)
Example:
```
drift.conversations.get_metrics(
{
"metrics": [
{
"type": "AVG",
"property": "numBotMessages"
}
],
"filters": [
{
"property": "createdAt",
"operation": "BETWEEN",
"values": ["2018-01-01", "2018-07-31"]
}
]
}
)
```## Users
Read the docs here [Users API](https://devdocs.drift.com/docs/user-model)**Available Methods**
- `drift.users.get()`
- user_id (required)
- `drift.users.list()`- `drift.users.update()`
- user_id (required)
- **attributes (required)Example:
drift.users.update(243266, phone='555-555-5555')
## Contributors
- Lemuel Boyce [rhymiz](https://github.com/rhymiz)
- Chris Buonocore [cbonoz](https://github.com/cbonoz)## Support / Feedback / Bugs
For support and feedback, you can find us on [Slack](https://join.slack.com/t/devdrift/shared_invite/enQtMzg4MTI3NDk5NDQ0LWUwMWYzZTkyMmQ1YjdkNjkwZDg2Mzk2YjAyMDg4MWViYmIzZjVhZTczNDQwMDVjOGRjZGU5OTkxMWQ0ZGU0Mjg)!If you've found a bug, feel free to open up a PR with a fix or submit an issue. Let us know in the dev slack!