Giter Site home page Giter Site logo

amocrm_api's Introduction

UNMAINTAINED AmoCRM python API.

https://travis-ci.org/Krukov/amocrm_api.svg?branch=master

Python AmoCRM API (http://www.amocrm.ru/) (human interface for easy using )

Installation

pip install amocrm_api

Usage

There are 7 abstraction of 5 AmoCRM objects:

  • Контакт - BaseContact
  • Компания - BaseCompany
  • Сделка - BaseLead
  • Задача - (LeadTask, ContactTask)
  • Событие - (LeadNote, ContactNote)

Settings

First of all you need to define settings Example:

from amocrm import BaseContact, amo_settings, fields
amo_settings.set('[email protected]', '4b332718c4c5944003af7e6389860ced', 'testcentrobit')

Custom field

One of the features of AmoCRM in the presence of custom fields in a contact, company and lead objects

To define your custom field you need describe it

Example:

from amocrm import BaseContact, amo_settings, fields
amo_settings.set('[email protected]', '4b332718c4c5944003af7e6389860ced', 'testcentrobit')

class Contact(BaseContact):
    position = fields.CustomField(u'Должность')
    site = fields.CustomField(u'Сайт')
    phone = fields.EnumCustomField(u'Телефон', enum='WORK')

Ok, now it is ready to use and you can get, create or edit contacts

Example:

new_contact = Contact(name='Example2', company='ExampleCorp2', position='QA', phone='0001')
new_contact.site = 'http://example.com'
new_contact.save()

contact = Contact.objects.get(new_contact.id)
contact_search = Contact.objects.search('Example2')
assert contact.id == contact_search.id
print(contact.phone)
contact.phone = '8-800-00000000'
contact.save()
contact.create_task('New task, yeee', task_type=u'Звонок',
                 complete_till=datetime.datetime.now()+datetime.timedelta(days=3))
print(contact.notes)
print(contact.tasks)

amocrm_api's People

Contributors

gitter-badger avatar icegreg avatar krukov avatar lavr avatar n-litened avatar sutyrin avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.