-
Notifications
You must be signed in to change notification settings - Fork 8
/
package.json
29 lines (29 loc) · 2.95 KB
/
package.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
{
"name": "civicrm",
"version": "3.2.2",
"main": "civicrm",
"description": "Access civicrm api4 (using REST)",
"keywords": [
"civicrm",
"crm",
"api"
],
"author": {
"name": "Xavier DUTOIT",
"email": "[email protected]",
"url": "http://www.techtothepeople.com"
},
"license": "BSD",
"repository": {
"type": "git",
"url": "git://github.com/TechToThePeople/node-civicrm.git"
},
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"readme": "## civicrm\nAllow to fetch data from a civicrm server.\nIt covers all the entities civicrm api exposes (more than 80) and the basic crud methods. Yes, it can create, update or delete too.\n\nIt's assumed you are familiar with the civicrm api, checkout the [documentation](http://wiki.civicrm.org/confluence/display/CRMDOC/API+Reference) if you aren't sure.\n\nTo avoid running too many queries at the same time and flood the civicrm server, it has a build in queue that doesn't send more than 8 requests in parallel.\n\nyou can adjust that by setting config.concurrency = 8;\n\n## Installation\n$npm install civicrm\n\n## Examples\n\n\n### get the first 25 individuals \n\n var config = {\n server:'http://example.org',\n path:'/sites/all/modules/civicrm/extern/rest.php',\n key:'your key from settings.civicrm.php',\n api_key:'the user key'\n };\n var crmAPI = require('civicrm')(config);\n\n crmAPI.get ('contact',{contact_type:'Individual',return:'display_name,email,phone'},\n function (result) {\n for (var i in result.values) {\n val = result.values[i];\n console.log(val.id +\": \"+val.display_name+ \" \"+val.email+ \" \"+ val.phone);\n }\n }\n );\n\n### create a new contact\n\n crmAPI.create ('contact',{contact_type:'Individual','first_name':'John','last_name':'Doe'},\n function (result) {\n if (result.is_error) {\n console.log('ERROR '+ result.error_message);\n } else {\n console.log('CREATED CONTACT '+ result.id);\n }\n }\n );\n\n### delete contact id 42\n\n crmAPI.delete ('contact',{id:42},\n function (result) {\n if (result.is_error) {\n console.log('ERROR '+ result.error_message);\n } else {\n console.log('DELETED CONTACT '+ result.id);\n }\n }\n );\n\n\n### lower access \nAll the above actions relies on the lower level call method. You can call it directly if there is another action you need.\nFor instance the get above can also be called:\n\n crmAPI.call ('contact','get',{contact_type:'Individual',return:'display_name,email,phone'},\n function (result) {\n for (var i in result.values) {\n val = result.values[i];\n console.log(val.id +\": \"+val.display_name+ \" \"+val.email+ \" \"+ val.phone);\n }\n }\n );\n\n",
"readmeFilename": "README.md",
"bugs": {
"url": "https://github.com/TechToThePeople/node-civicrm/issues"
}
}