A python wrapper for clientify
- Requests
pip install git+https://github.com/ingmferrer/clientify-python.git
There are two ways to authenticate to Clientify
- Get the API Token from dashboard
from clientify.client import ClientifyClient
client = ClientifyClient(token='<API_TOKEN>')
- Log-in with username and password
from clientify.client import ClientifyClient
client = ClientifyClient()
response = client.authenticate(username='<EMAIL>', password='<PASSWORD>')
assert response == True
response = client.contacts.list_contacts()
data = {
'first_name': 'Jasper',
'last_name': 'Barry',
'email': '[email protected]',
'phone': '+1 (618) 353-6458',
'status': 'Voluptates facilis u',
'title': 'Mrs.',
'company': 'Henderson Gomez LLC',
'contact_type': '',
'contact_source': '',
'addresses': [
{
'street': 'camino de la coquina, 23',
'city': 'Lugo',
'state': 'Galicia',
'country': 'Spain',
'postal_code': '34',
'type': 1
}
],
'custom_fields': [],
'description': 'Sunt vitae consequun',
'remarks': 'Consequatur aliquid',
'summary': 'Voluptas dolorem com',
'message': 'Nobis aliquip quia c',
're_property_name': 'Hakeem Hicks',
'last_contact': None
}
response = client.contacts.create_contact(data)
response = client.contacts.contact_details('<CONTACT_ID>')
data = {
'first_name': 'Paco',
'last_name': 'Mario'
}
response = client.contacts.edit_contact_details('<CONTACT_ID>', data)
response = client.contacts.delete_contact('<CONTACT_ID>')
response = client.deals.list_deal_pipelines()
response = client.deals.get_deal_pipeline_details('<PIPELINE_ID>')
response = client.deals.list_deal_pipeline_stages()
response = client.deals.get_deal_pipeline_stage_details('<STAGE_ID>')
response = client.deals.list_deals()
data = {
"name":"Nuevo deal con pipeline desc y pipeline stage, fecha y custom fields",
"amount":"11.33",
"contact":"https://api.clientify.net/v1/contacts/integer/",
"company":"https://api.clientify.net/v1/companies/integer/",
"pipeline_desc": "nuevo",
"pipeline_stage_desc": "ultima",
"expected_closed_date": "2019-11-30",
"custom_fields": [{"field": "quaderno_id","value": "cdn_1133"}]
}
response = client.deals.create_deal(data)
data = {
"pipeline_stage": "https://api.clientify.net/v1/deals/pipelines/stages/integer/"
}
response = client.deals.update_deal_details(data)
response = client.deals.delete_deal('<DEAL_ID>')