API wrapper for Kommo CRM written in Python
Project description
kommo-python
kommo-python is an API wrapper for Kommo CRM, written in Python.
This library uses Oauth2 for authentication.
Installing
pip install kommo-python
Usage
from kommo.client import Client
client = Client(client_id, client_secret, code, domain, redirect_uri)
To obtain and set an access token and set it, follow this instructions:
- Get authorization url
url = client.authorization_url(state=None)
# This call generates the url necessary to display the pop-up window to perform oauth authentication
# param state(code) is required for direct request for oauth, for local test isn't necessary
- Get access token
access_token = client.get_access_token(code, domain)
# This call generates the oauth validation and get the access token and refresh token.
# Must send the code and domain generated from get authorization url.
- Refresh access token
refresh_token = client.refresh_access_token(refresh_token)
# "refresh_token" is the token refresh in response after login with oauth with the above url.
- Set token
client.set_token(access_token)
# It is necessary to be able to use the library's actions.
##Actions for get data
- Get account info
client.get_account_info()
# Returns a json with the account information where the application was configured.
- Get list of companies
client.list_companies()
# Returns a json with the list of companies.
- Get custom fields for company
client.get_custom_fields_company()
# Returns a json with the list of custom fields for company.
- Get list of contacts
client.list_contacts()
# Returns a json with the list of contacts.
- Get custom fields for contact
client.get_custom_fields_contacts()
# Returns a json with the list of custom fields for contact.
- Get list of leads
client.list_leads()
# Returns a json with the list of leads.
- Get custom fields for lead
client.get_custom_fields_leads()
# Returns a json with the list of custom fields for lead.
- Get list of tasks
client.list_tasks()
# Returns a json with the list of tasks.
- Get custom fields for task
client.get_custom_fields_tasks()
# Returns a json with the list of custom fields for tast.
##Actions for send data
- Create company
client.create_company(name: str = None, company_name: str = None,
phone: str = None, email: str = None,
custom_fields: list = None)
# Allows you to create a company in the configured application.
- Create contact
client.create_contact(self, name: str = None, first_name: str = None,
last_name: str = None,
custom_fields: list = None)
# Allows you to create a contact in the configured application.
- Create lead
client.create_lead(self, name: str = None, first_name: str = None,
last_name: str = None,
custom_fields: list = None)
# Allows you to create a lead in the configured application.
- Create lead
client.create_task(self, name: str = None, first_name: str = None,
last_name: str = None,
custom_fields: list = None)
# Allows you to create a task in the configured application.
##Actions for webhook
- List webhooks
client.list_webhooks()
# Allows list webhooks in the configured application.
- Create webhook
client.create_webhook(event_type: str = None, url: str = None)
# Allows create a webhook in the configured application.
- Delete webhook
client.delete_webhook(uuid: str = None)
# Allows delete a webhook in the configured application.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file kommo_python-0.1.2.tar.gz.
File metadata
- Download URL: kommo_python-0.1.2.tar.gz
- Upload date:
- Size: 4.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.8.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b8afaa0608ab402eb246f88c8a3488efa5ef5ec940ff292dbe1a7ddfc0a54ca5
|
|
| MD5 |
ede42be68a77a0dd7a1fbc88eefe6831
|
|
| BLAKE2b-256 |
6df1df3b129ee4c93e3031ee7586817e6b6e5d348fc0e1fd0cebfb79ac119e79
|
File details
Details for the file kommo_python-0.1.2-py3-none-any.whl.
File metadata
- Download URL: kommo_python-0.1.2-py3-none-any.whl
- Upload date:
- Size: 4.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.8.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f04d8a91a45b24cd9ddbd7da4d11a8471b3d1de4865e22d573ec57ee5e28c45d
|
|
| MD5 |
08be1a11df2227ed8702dddcb4df1e57
|
|
| BLAKE2b-256 |
fb2fb094f633fbcbd9719cedb365dd2b291fd28cb2506faf592f4984d8994435
|