api-client-python/README

71 lines
1.3 KiB
Plaintext
Raw Permalink Normal View History

RetailCRM python API client
2018-03-20 21:07:22 +03:00
===========================
This is python RetailCRM API client. This library allows to use all
2018-03-20 21:07:22 +03:00
available API versions.
Install
-------
::
2021-09-08 16:28:10 +03:00
pip3 install retailcrm
2018-03-20 21:07:22 +03:00
Usage
-----
.. code:: python
# coding utf-8
import retailcrm
client = retailcrm.v3('https://demo.retailcrm.pro', 'uLxXKBwjQteE9NkO3cJAqTXNwvKktaTc')
2018-03-20 21:07:22 +03:00
order = {
'firstName': 'John',
'lastName': 'Doe',
'phone': '+79000000000',
'email': 'john@example.com',
'orderMethod': 'call-request',
}
result = client.order_create(order)
.. code:: python
# coding utf-8
import retailcrm
client = retailcrm.v4('https://demo.retailcrm.pro', 'uLxXKBwjQteE9NkO3cJAqTXNwvKktaTc')
2018-03-20 21:07:22 +03:00
result = client.customers_history(filter={'sinceId': '1500', 'startDate': '2018-03-01'})
print(result['pagination']['totalCount'])
.. code:: python
# coding utf-8
import retailcrm
client = retailcrm.v5('https://demo.retailcrm.pro', 'uLxXKBwjQteE9NkO3cJAqTXNwvKktaTc')
2018-03-20 21:07:22 +03:00
site = 'example-com'
task = {
'text': 'Product availability problem',
'commentary': 'Take a look ASAP',
'order': {
'externalId': '100500'
},
'performerId': 1
}
result = client.task_create(task, site)