To do some actions with CRM data you can use CRM API. Here is an examples:Now we have authorization in API. For access in API you need:
- apiKey (Set in CRM Administration panel in Access inlay.)
- userName (Login of JIRA's user, which will perform all actions)
As now all actions will be performed under the JIRA's user, he owe to have all rights for access to methods
For access to: | A user owe to have right: | Function properties: |
---|
getcontactbyname | CRM Main Menu | Return organization by name or ID |
getcompanies | CRM Main Menu | Return list of all organizations |
getcontacts | CRM Main Menu | Return contact by name or ID |
sync | CRM Main Menu | Return list of all contacts |
setcrmproperties | CRM Main Menu | |
addcompany | Add companies | |
setcontact | Add contacts | |
How now owe to look method's calls :
HTML |
---|
|
Code Block |
---|
title | Examples of Remote Calls |
---|
|
http://crm-demo.teamlead.ru/plugins/servlet/crm/api?command=sync
Answer
{"success": true, "details":"sync process started"}&apiKey=${apiKey}&userName=${userName}&command=sync |
HTML |
---|
http://crm-demo.teamlead.ru/plugins/servlet/crm/api?&apiKey=${apiKey}&userName=${userName}&command=setcontact&companyName=Adobe&contactName=TedJohnson
Answer
{"success": |
HTML |
---|
true, "details":"company Adobe set for contact Ted Johnson"}http://crm-demo.teamlead.ru/plugins/servlet/crm/api?&apiKey=${apiKey}&userName=${userName}&command=setcontact&companyId=15&contactId=6
Answer |
HTML |
---|
{"success": true, "details":"company Apple set for contact Ted Johnson"}http://crm-demo.teamlead.ru/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 |
$ {apiKey} need replace on key's value adjusted in Plugin administration panel.
$ {userName} need replace on JIRA user's login.
Here is an examples of a new method's calls.
HTML |
---|
http://crm-demo.teamlead.ru/plugins/servlet/crm/api?&apiKey=${apiKey}&userName=${userName}&command=getcompanies |
HTML |
---|
http://crm-demo.teamlead.ru/plugins/servlet/crm/api?&apiKey=${apiKey}&userName=${userName}&command=getcontacts |
HTML |
---|
http://crm-demo.teamlead.ru/plugins/servlet/crm/api?&apiKey=${apiKey}&userName=${userName}&command=getcompanybyname&companyId=2 |
HTML |
---|
Answer
{"success": true, "details":"company has been added"}http://crm-demo.teamlead.ru/plugins/servlet/crm/api
Answer?&apiKey=${apiKey}&userName=${userName}&command=getcompanybyname&companyName=Atlassian |
HTML |
---|
http://crm-demo.teamlead.ru/plugins/servlet/crm/api?&apiKey=${apiKey}&userName=${userName}&command=getcontactbyname&contactId=2 |
HTML |
---|
http://crm-demo.teamlead.ru/plugins/servlet/crm/api?&apiKey=${apiKey}&userName=${userName}&command=getcontactbyname&contactName=Mike Cannon-Brookes
{"success": false, "details":"command is required!"} |