1.0.3 • Published 7 years ago
sugarcrm-js-rest-consumer v1.0.3
SugarCrm JS Rest Consumer
Promise based javascript client for SugarCRM Rest API v.4.1 for browser and node.js
Features/Implemented methods
- login
- logout
- seamless_login
- get_user_id
- get_server_info
- get_available_modules
- get_module_fields
- get_entry_list
- get_entries_count
- get_entries
- get_entry
- set_entries
- set_entry
raw post function to send any method and data to Rest API
Installing
Using npm:
$ npm install sugarcrm-js-rest-consumer
Examples
Login
var sugar = new SugarCrmJsRestConsumer(crm_host, "v4_1");
sugar.login("admin", "password")
.then(function()
{
// You are logged in
})
.catch(function(error)
{
console.error(error);
});
Create a new record in Contacts module
sugar.setEntry("Contacts", false, {last_name: "Lee", first_name: "Bruce"})
.then(function(response)
{
console.log("SAVED WITH ID: " + response["id"]);
})
.catch(function(err)
{
console.error(error);
});
Other
...