Any alteration to data on ChartHop represents an event.
You can retrieve events with the Event API, or set an app web hook to subscribe to an event pattern. Note that events are not exactly the same as changes (such as hires or departures), because an event can represent an amendment, or even a cancellation, of a change.
For example, if a new hire is entered, and then the date of that new hire is altered, this is just one new-hire change, but it's two events: change.create.hire and change.update.hire.
In general an event consists of an entity (the thing that is being acted upon), and a type the type of action that is happening to the entity. In some cases the event has a subtype which further describes the type of entity. All events have a code that consists of either entity.type or entity.type.subtype
New job created
Amendment to previous new job
Amendment to previous job update
Amendment to hire
Amendment to departure
Amendment to move
Amendment to job removal
Amendment to collected data
Cancellation of job creation
Cancellation of job update
Cancellation of new hire
Cancellation of departure
Cancellation of move
Cancellation of deletion
Cancellation of collected data
New person created
Installed app settings changed
Token generated for installed app
User password updated
User password removed
User invited into org
Custom field created
Custom field updated
Custom field deleted
Custom form created
Custom form updated
Custom form deleted
Media image uploaded
Org settings updated
Report chart created
Report chart updated
Report chart deleted
An app can subscribe to a pattern of events and receive them as a webhook.
You might build an app that takes an action upon a new hire. The app might listen for change.create.hire events. Whenever a hire occurs, there will be a POST to the app's event notification URL.
The app can match on different types of events via wildcard matching.
A few examples:
To listen for any kind of change:
To listen only for hires:
For events of type change.* and person.*, you can add additional filtering based on any CQL Filter.
To add the filter, put the filter in [brackets] following the wildcard match.
For example, rather than listening for any new hire, you might only want to listen for new hires who are managers in the Engineering department. You could match on:
change.create.hire [department:engineering directs > 0]
The particular set of filters that are matched will be passed in the webhook in the matchFilters property.
You will receive the POST as an HTTP POST containing the following:
The payload will vary depending on the type of event. Generally, for create events, the payload will contain the initial entity being created, and for update events the payload will contain the fields that were modified.
You can define custom payloads to control which specific data gets passed along. For example, you might want a webhook to receive the work email address of new hires.
Custom payloads may currently only be used for change.* events.
Define the payload as a JSON object, where the key represents the key element, and the value is a CQL expression containing the data you want to evaluate.
For example, let's suppose you want to pass along a new hire's work email, department name, whether or not they are a manager, and whether they are highly compensated. Set custom payload to:
Carefully considered custom payloads can allow you to control the information that leaves the system.