Skip to content

Latest commit

 

History

History
118 lines (77 loc) · 2.42 KB

README.md

File metadata and controls

118 lines (77 loc) · 2.42 KB

Contacts

Any methods return promise object.

Static methods

Retrieve all contacts

client.contacts.find([params][, callback(err, contacts)]);
  • params is object with a list of filters, not required
  • callback is a function, not required

Create a contact

client.contacts.create(data[, callback(err, contact)]);
  • data is a contact object
  • callback is a function, not required

Retrieve a single contact

client.contacts.find(id[, callback(err, contact)]);
  • id is unique identifier (number) of the contact
  • callback is a function, not required

Update a contact

client.contacts.update(id, data[, callback(err, contact)]);
  • id is a contact ID (number)
  • data is a updated params of the contact (object)
  • callback is a function, not required

Delete a contact

client.contacts.delete(id[, callback(err, state)]);
  • id is unique identifier (number) of the contact
  • callback is a function, not required

Upsert a contact

client.contacts.upsert(params, data[, callback(err, contact)]);
  • params is object with a list of filters
  • data is a contact object
  • callback is a function, not required

Model methods

Create a contact

var Contact = client.contacts;

new Contact(data).save([callback(err, contact)]);
  • data is a contact object
  • callback is a function, not required

Update a contact

contact.save([callback(err, contact)]);
  • callback is a function, not required

Delete a contact

contact.delete([callback(err, state)]);
  • callback is a function, not required

Assign a note

contact.assignNote(data[, callback(err, note)]);
  • data is model of the note or string
  • callback is a function, not required

Assign a task

contact.assignTask(task[, callback(err, task)]);
  • task is model of the task
  • callback is a function, not required

Detailed documentation in the official API

License

MIT

Bug Reports

Report here.