/
Contact Service (java)
NOTE: Trivore ID Documentation has moved to https://trivoreid.com
The content on this site IS OUT OF DATE!
This space has been archived!
Please go ahead to the new site!
Contact Service (java)
Wrapper for '/contact/' endpoint
List of all options
Contact management
Enterprise info management
Initialize service
TrivoreID sdk = TrivoreID.mgmtApiClient();
ContactServiceImpl contactService = new ContactServiceImpl(sdk.contactService());
Contact Management
// get page with contacts with the first name "FirstName"
Criteria criteria = new Criteria(Filter.equal("firstName", "FirstName"));
Page<Contact> page = contactService.getAll(criteria);
// create new contact
// the function returns contact object with the generated id
Contact contact = contactService.create(new Contact());
String contactId = contact.getId();
// update contact
contact.setNotes("Example notes.");
contactService.update(contact);
// get contact
contact = contactService.get(contactId);
// delete contact
contactService.delete(contactId);
Enterprise management
// get and update enterprise info
Enterprise enterprise = contactService.getEnterprise(contactId);
// update enterprise information
enterprise.setVatId("vatId");
contactService.updateEnterprise(contactId, enterprise);