elasticio-snazzycontacts-component

Snazzy Contacts Node.js component for elastic.io platform

Snazzy Contacts is a smart contact management software for controlling, organizing and managing your contacts data. With Snazzy Contacts you could manage your entire team contacts(contacts and organizations) and work flexibly together with your colleagues. You are able to maintain your addresses on all devices from everywhere and sync them with Outlook.

This is a connector(component) which connects Snazzy Contacts with elastic.io platform. With this connector you are able to create different flows in elastic.io. The component supports "Triggers" (e.g. getPersons, getOrganizations) as well as "Actions" (e.g. updatePerson, createOrganization, updatePersonsOrganization, etc.), therefore with this component you could both read and fetch data from Snazzy Contacts and write and save data in Snazzy Contacts via elastic.io platform.

Before you begin

Before you can use the component you must be a registered snazzy contacts user. Please visit the home page of https://snazzycontacts.com to sign up.

Any attempt to reach Snazzy Contacts endpoints without registration will not be successful

After you are already registered in Snazzy Contacts you have to activate your API Key (in Snazzy Contacts named Data Sharing Key).

For activation you have to be logged in, then click of Administration and under Einstellungen click of Unternehmensdaten. Once you are in Unternehmensdaten click of the button Data Sharing aktivieren for generating your API key.

Once the activation is done you have an access to API Key which is required for an authentication when you make a request to Snazzy Contacts.

Actions and triggers

The connector supports the following actions and triggers:

Triggers:

  • Get persons (getPersons.js)
  • Get organizations (getOrganizations.js)

Actions:

  • Create person (createPerson.js)
  • Create organization (createOrganization.js)
  • Delete person (deletePerson.js)
  • Delete organization (deleteOrganization.js)
  • Update person (updatePerson.js)
  • Update person's organizations (updatePersonsOrganization.js)
  • Update organization (updateOrganization.js)

NOTE: As mentioned before, to perform an action or a trigger you have to be a registered Snazzy Contacts user and you have to pass your API Key (in Snazzy Contacts named Data Sharing Key) when you send a request.

In each trigger and action, before sending a request we create a session in Snazzy Contacts via calling the function createSession() from snazzy.js file, which is located in directory utils. This function returns a cookie which is used when we send a request to Snazzy Contacts.

Get persons

Get persons trigger (getPersons.js) performs a request which fetch all persons saved by a user in Snazzy Contacts. The response consist of an array of objects with all persons and their attributes.

Get organizations

Get organizations trigger (getOrganizations.js) performs a request which fetch all organizations saved by a user in Snazzy Contacts. The response consist of an array of objects with all organizations and their attributes.

Create person

Create person action (createPerson.js) creates a person in Snazzy Contacts. At this point of time the function accepts as required parameters name and firstname, but of course you can also pass other parameters like email, phone, salutation, title, etc.

Create organization

Create organization action (createOrganization.js) creates a new organization in Snazzy Contacts. This function accepts as required parameter only name, but if you wish you can also pass town, street, street_number, zip_code, countryetc.

Delete person

Delete person action (deletePerson.js) deletes a person in Snazzy Contacts. The required parameter which must be passed is rowid of the person which you want to delete.

NOTE: We do NOT really delete the person from our database, we just set a value in field is_deleted to 1 which actually hides the person from the view.

Delete organization

Delete organization action (deleteOrganization.js) deletes an organization in Snazzy Contacts. The required parameter which must be passed is rowid of the organization which you want to delete.

NOTE: We do NOT really delete the organization from our database, we just set a value in field is_deleted to 1 which actually hides the organization from the view.

Update person

Update person action (updatePerson.js) updates a specific person in Snazzy Contacts. The function accepts as required parameter rowid of the person and respectively the values of the properties which you want to update.

Update person's organizations

Update person's organizations action (updatePersonsOrganization.js) assign one person to one or more organizations. This means that one person could be assigned to as many organizations as you want. The function accepts as required parameters same_contactperson, for_rowid, name und firstname.

Rrequired parametes:
  • same_contactperson - that is an id which is generated when the person was created
  • for_rowid - that is the rowid of the organization to which you want to assign the current person
  • name - you need to pass the same name as the initial one
  • firstname - you need to pass the same firstname as the initial one

IMPORTANT: With this action we actually create a duplicate of the person which has the same same_contactperson, that's why you have to pass the same name and firstname to prevent misconception

Update organization

Update organization action (updateOrganization.js) updates a specific organization in Snazzy Contacts. The function accepts as required parameter rowid of the organization and respectively the values of the properties which you want to update.