What for need CRM API
It need that external applications can programmatically add and receive data to CRM. To work with the API, you must configure the security key (password) and the rights of the user that will be connected.
Setting access to API
For access to API you need to specify the API Key (password) in the Administration/Plugins/CRM/Access:
Access rights to CRM objects
To receive data via API, you can use different users with different access rights. Access rights to the objects defined in the Administration/Plugins/CRM/Access:
Supported methods
Method's name | User right | Description |
---|---|---|
getcompanybyname | CRM Main Menu | Return company by name or ID |
getcontactbyname | CRM Main Menu | Return contact by name or ID |
getcompanies | CRM Main Menu | Return all companies |
getcontacts | CRM Main Menu | Return all contacts |
sync | CRM Main Menu | Start synchronization of JIRA users |
setcrmproperties | CRM Main Menu | Set custom field type "Crm Property" in issue |
addcompany | Add companies | Add company |
setcontact | Add contacts | Set company for contacts |
Calls examples.
Start synchronization:
http:
//YOURDOMAIN/plugins/servlet/crm/api?apiKey=${apiKey}&userName=${userName}&command=sync
Register organization "Adobe" to contact "Ted Johnson":
http:
//YOURDOMAIN/plugins/servlet/crm/api?apiKey=${apiKey}&userName=${userName}&command=setcontact&companyName=Adobe&contactName=TedJohnson
Receive organization with ID=15 and contact with ID=6:
http:
//YOURDOMAIN/plugins/servlet/crm/api?apiKey=${apiKey}&userName=${userName}&command=setcontact&companyId=15&contactId=6
http:
//YOURDOMAIN/plugins/servlet/crm/api?apiKey=${apiKey}&userName=${userName}&command=addcompany&clients-org_name=test Company Name&clients-org_www=test.com&tableName=CLIENTS&view-clients-org_industry=Consulting&view-clients-org_sla=SLA-1 Free
Receive all organizations:
http:
//YOURDOMAIN/plugins/servlet/crm/api?apiKey=${apiKey}&userName=${userName}&command=getcompanies
Receive all contacts:
http:
//YOURDOMAIN/plugins/servlet/crm/api?apiKey=${apiKey}&userName=${userName}&command=getcontacts
Receive organization with ID=2:
http:
//YOURDOMAIN/plugins/servlet/crm/api?apiKey=${apiKey}&userName=${userName}&command=getcompanybyname&companyId=2
Receive organization with name "Teamlead":
http:
//YOURDOMAIN/plugins/servlet/crm/api?apiKey=${apiKey}&userName=${userName}&command=getcompanybyname&companyName=Teamlead
Receive contact with ID=2:
http:
//YOURDOMAIN/plugins/servlet/crm/api?apiKey=${apiKey}&userName=${userName}&command=getcontactbyname&contactId=2
Receive contact with name "Vladimir Putin":
http:
//YOURDOMAIN/plugins/servlet/crm/api?apiKey=${apiKey}&userName=${userName}&command=getcontactbyname&contactName=Vladimir Putin
where:
${apiKey} - key's title
${userName} - JIRA user's login