ChartHop for Developers
Events
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 events list 389,354 false unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type false unhandled content type false unhandled content type false unhandled content type false unhandled content type false unhandled content type false unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type event notifications an app can subscribe to a pattern of events and receive them as a webhook for example 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 matching specific events the app can match on different types of events via wildcard matching a few examples to listen for any kind of change change to listen only for hires change hire filtering 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 webhook format and payload you will receive the post as an http post containing the following { "id" \<event id>, "orgid" \<your org id>, "userid" \<user id who caused the event>, "username" \<name of user who caused the event>, "appid" \<id of app subscribing>, "appname" \<name of app subscribing>, "appuserid" \<id of installation of app>, "notifyurl" \<url of notification webhook>, "type" \<event type>, "subtype" \<event subtype>, "entitytype" \<entity type>, "entityid" \<entity id>, "matchfilters" \<list of filters matched> "at" \<timestamp of event> "payload" \<payload>, } 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 custom payloads 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 { "email" "contact workemail", "department" "department name", "ismanager" "directs > 0", "ishighlycompensated" "base > 200000" } carefully considered custom payloads can allow you to control the information that leaves the system