A client to Monica CRM's HTTP API using python. Allows easy access to the api methods.
APACHE-2.0 License
Connects to the Monica API and provides an easy to use python API.
pip install monica-client
from monica import MonicaClient
client = MonicaClient(access_token="ACCESS_TOKEN")
You can find the value for the ACCESS_TOKEN
on your
Monica Profile page. Create a
new token and use the returned key as your access token.
Get the profile of the authenticated user.
client.me()
Example:
In [4]: client.me()
Out[4]:
{'id': 14109, 'object': 'user', 'first_name': 'Peter', 'last_name': 'Pan', 'email': '[email protected]', 'timezone': 'UTC', 'currency': {'id': 2, 'object': 'currency', 'iso': 'USD', 'name': 'US Dollar', 'symbol': '$'}, 'locale': 'en', 'is_policy_compliant': True, 'account': {'id': 13}, 'created_at': '2018-10-28T09:51:19Z', 'updated_at': '2018-10-28T14:09:17Z'}
If you happen to run your own monica API server, there is a way to specify its url:
from monica import MonicaClient
client = MonicaClient(access_token="ACCESS_TOKEN",
api_url="http://yourapi.com/api")
added:
Licensed under the Apache License, Version 2.0. Copyright 2018 Tom Bocklisch. Copy of the license.