A Python interface for the Agile CRM API.
$ pip install agile-crm-python
In [1]: from agilecrm import AgileCRM
In [2]: EMAIL = 'your_email'
...: API_KEY = 'agilecrm_api_key'
...: DOMAIN = 'your_domain'
In [3]: agile_client = AgileCRM(DOMAIN, EMAIL, API_KEY)
In [4]: print(agile_client.contact.fetch('5649050225344512'))
{'data': {'klout_score': '', 'is_duplicate_existed': False, 'properties': [{'type': 'SYSTEM', 'value': 'Baqsssaasdf2', 'name': 'first_name'}, {'type': 'SYSTEM', 'value': 'SomeCompany', 'name': 'company'}, {'type': 'SYSTEM', 'value': '+998934979894', 'name': 'phone'}, {'type': 'CUSTOM', 'value': 'SuperSource', 'name': 'Captured Source'}, {'type': 'SYSTEM', 'value': '[email protected]', 'name': 'email'}], 'star_value': 4, 'created_time': 1498828722, 'lead_status_id': 0, 'last_emailed': 0, 'owner': {'email': '[email protected]', 'calendar_url': 'https://jahongir.agilecrm.com/calendar/Jahongir_Rahmonov', 'phone': '', 'id': 4840599839309824, 'calendarURL': 'https://jahongir.agilecrm.com/calendar/Jahongir_Rahmonov', 'name': 'Jahongir Rahmonov', 'pic': 'https://d1gwclp1pmzk26.cloudfront.net/img/gravatar/48.png', 'domain': 'jahongir', 'schedule_id': 'Jahongir_Rahmonov'}, 'entity_type': 'contact_entity', 'lead_score': 34, 'lead_converted_time': 0, 'browserId': [], 'id': 5649050225344512, 'is_lead_converted': False, 'updated_time': 1498854662, 'tags': ['ios', 'awesome'], 'is_client_import': False, 'last_called': 0, 'trashed_time': 0, 'type': 'PERSON', 'source': 'api', 'lead_source_id': 0, 'unsubscribeStatus': [], 'restored_time': 0, 'contact_company_id': '5714163003293696', 'tagsWithTime': [{'entity_type': 'tag', 'availableCount': 0, 'createdTime': 1498829643106, 'tag': 'ios'}, {'entity_type': 'tag', 'availableCount': 0, 'createdTime': 1498830015686, 'tag': 'awesome'}], 'emailBounceStatus': [], 'last_contacted': 0, 'is_duplicate_verification_failed': False, 'viewed': {'viewed_time': 1500654861002, 'viewer_id': 4840599839309824}, 'formId': 0, 'campaignStatus': [], 'viewed_time': 0, 'last_campaign_emaild': 0}, 'text': None, 'ok': True, 'status_code': 200}
1 Contact * 1 Create a contact * 2 Fetch a contact by ID * 3 Delete a contact by ID * 4 Update a contact by ID * 5 Set a lead score for a contact * 6 Set a star value for a contact * 7 Add a tag to a contact * 8 Remove a tag from a contact * 9 Search for a contact * 10 Add a note to a contact * 11 Get notes of a contact * 12 Delete a note of a contact
2 Company * 1 Create a company * 2 Fetch a company by ID * 3 Update a company by ID * 4 Delete a company by ID
3 Deal
* 1 Create a dea
* 2 Update a deal by ID
* 2 Fetch a deal by ID
* 4 Delete a deal by ID
* 5 Get notes of a deal
* 6 Add notes to a deal
* 7 Update note of a deal
All the following examples assume that you have agile_client configured as shown above
contact_data = {
"star_value": "4",
"lead_score": "92",
"tags": [
"Lead",
"Likely Buyer"
],
"properties": [
{
"type": "SYSTEM",
"name": "first_name",
"value": "Los "
},
{
"type": "SYSTEM",
"name": "last_name",
"value": "Bruikheilmer"
},
{
"type": "SYSTEM",
"name": "company",
"value": "steady.inc"
},
{
"type": "SYSTEM",
"name": "email",
"subtype": "work",
"value": "[email protected]"
},
{
"type": "CUSTOM",
"name": "My Custom Field",
"value": "Custom value"
}
]
}
response = agile_client.contact.create(contact_data)
response = agile_client.contact.fetch('5649050225344512')
response = agile_client.contact.delete('5649050225344512')
new_contact_data = {
"properties": [
{
"type": "SYSTEM",
"name": "last_name",
"value": "Chan"
},
{
"type": "CUSTOM",
"name": "My Custom Field",
"value": "Custom value change"
}
]
}
response = agile_client.contact.update('5689413791121408', new_contact_data)
response = agile_client.contact.set_lead_score(contact_id='5689413791121408', lead_score=100)
response = agile_client.contact.set_star_value(contact_id='5689413791121408', star_value=3)
response = agile_client.contact.set_tags(contact_id='5689413791121408', tags=['new_tag'])
response = agile_client.contact.remove_tags(contact_id='5689413791121408', tags_to_remove=['new_tag'])
response = agile_client.contact.find(q='los', page_size=15)
response = agile_client.contact.add_notes(contact_id='5689413791121408', subject='Note Subject', description='Some Note')
response = agile_client.contact.get_notes(contact_id='5689413791121408')
respose = agile_client.contact.delete_note(contact_id='5689413791121408', note_id='5755685136498688')
company_data = {
"type": "COMPANY",
"star_value": 4,
"lead_score": 120,
"tags": [
"Permanent",
"USA",
],
"properties": [
{
"name": "Company Type",
"type": "CUSTOM",
"value": "MNC Inc"
},
{
"type": "SYSTEM",
"name": "name",
"value": "Spicejet"
},
{
"type": "SYSTEM",
"name": "url",
"value": "http://www.spicejet.com/"
},
{
"name": "email",
"value": "[email protected] ",
"subtype": ""
},
{
"name": "phone",
"value": "45500000",
"subtype": ""
},
{
"name": "website",
"value": "http://www.linkedin.com/company/agile-crm",
"subtype": "LINKEDIN"
},
{
"name": "address",
"value": "{\"address\":\"MS 35, 440 N Wolfe Road\",\"city\":\"Sunnyvale\",\"state\":\"CA\",\"zip\":\"94085\",\"country\":\"US\"}",
"subtype": "office"
}
]
}
response = agile_client.company.create(company_data)
respose = agile_client.company.fetch('5712536552865792')
new_company_data = {
"properties": [
{
"type": "SYSTEM",
"name": "name",
"value": "SPICE JET"
},
{
"type": "SYSTEM",
"name": "url",
"value": "http://www.spicejet.com/"
},
{
"name": "phone",
"value": "45500000",
"subtype": ""
}
]
}
response = agile_client.company.update('5712536552865792', new_company_data)
response = agile_client.company.delete('5712536552865792')
Bumps ipython from 6.1.0 to 7.16.3.
d43c7c7
release 7.16.35fa1e40
Merge pull request from GHSA-pq7m-3gw7-gq5x8df8971
back to dev9f477b7
release 7.16.2138f266
bring back release helper from master branch5aa3634
Merge pull request #13341 from meeseeksmachine/auto-backport-of-pr-13335-on-7...bcae8e0
Backport PR #13335: What's new 7.16.28fcdcd3
Pin Jedi to <0.17.2.2486838
release 7.16.120bdc6f
fix conda buildDependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase
.
python agile-crm api api-wrapper