Skip to main content

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:

  1. 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
  1. 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. 
  1. 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.
  1. 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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

kommo_python-0.1.1.tar.gz (4.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

kommo_python-0.1.1-py3-none-any.whl (4.8 kB view details)

Uploaded Python 3

File details

Details for the file kommo_python-0.1.1.tar.gz.

File metadata

  • Download URL: kommo_python-0.1.1.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

Hashes for kommo_python-0.1.1.tar.gz
Algorithm Hash digest
SHA256 ab1f683854621c23456c056652ca9c95fa6a437c8864531554804e58baa44cb7
MD5 25c6350882431f41e6f6874da7a54f29
BLAKE2b-256 eed9c652e5890ba74c5615c429a6016b93899cd594d322fd32ba0f735d0223aa

See more details on using hashes here.

File details

Details for the file kommo_python-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: kommo_python-0.1.1-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

Hashes for kommo_python-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 1f710e8421d6bb6e009176407df8c8013423250bfd44495db12d6c88bc984097
MD5 64739323c65cda9c5f30b16a75c9cf33
BLAKE2b-256 fbc53180cdc610cfa7b0f44ccc02fe42fbbf89b7352b776fb949208fa24a8f39

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page