Drift Python
A Drift API wrapper written in Python.
Getting Started
To get started run pip install drift-python
from drift import Drift
drift = Drift("YOUR ACCESS TOKEN")
Contacts
Read the docs here: Contacts API.
Available Methods
-
drift.contacts.get()- contact_id (required)
- email (optional)
- limit (optional)
-
drift.contacts.create()- **attributes (required)
Example:
drift.contacts.create(email='johndoe@drift.com') -
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
Available Methods
-
drift.conversations.get()- conversation_id (required)
-
drift.conversations.list()- limit (optional) - defaults to
50 - page_token (optional)
- limit (optional) - defaults to
-
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
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
Support / Feedback / Bugs
For support and feedback, you can find us on Slack!
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!
Metadata
Release files for drift-python 1.1.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| drift-python-1.1.3.tar.gz | 5.7 kB | Without provenance | Details for drift-python-1.1.3.tar.gz |
Release files / drift-python-1.1.3.tar.gz
| Download URL | drift-python-1.1.3.tar.gz |
|---|---|
| Size | 5.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
6e280eb5961446efacdb8f064895259cc888fa5928c80613a6d2770273977698
|
|
BLAKE2b-256 checksum How to use checksums |
5bc3c90cbda6df3ddaf7528380d76a92e442310e7129f8ff5003b45c95dfd4e4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.0.1 CPython/3.11.6
|
Security for drift-python 1.1.3
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.