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 event meaning change create create new job created change create update job updated change create hire new hire change create depart departure change create move move/transfer change create delete job removed change create data data collected change update create amendment to previous new job change update update amendment to previous job update change update hire amendment to hire change update depart amendment to departure change update move amendment to move change update delete amendment to job removal change update data amendment to collected data change delete create cancellation of job creation change delete update cancellation of job update change delete hire cancellation of new hire change delete depart cancellation of departure change delete move cancellation of move change delete delete cancellation of deletion change delete data cancellation of collected data job create person create new person created person update person updated group create group created group update group updated group delete group deleted app create app created app update app updated user create user created user update user updated user create \<appname> app installed user update \<appname> installed app settings changed user token \<appname> token generated for installed app user delete \<appname> app uninstalled user update password user password updated user remove password user password removed user invite user invited into org comment create comment posted comment delete comment deleted content create content created content update content updated content delete content deleted field create custom field created field update custom field updated field delete custom field deleted form create custom form created form submit custom form submitted form update custom form updated form delete custom form deleted media create media image uploaded org create org created org update org settings updated process create \<processname> process started process complete \<processname> process completed process error \<processname> process errored report create report created report update report updated report delete report deleted report chart create report chart created report chart update report chart updated report chart delete report chart deleted scenario create scenario created scenario update scenario updated scenario delete scenario deleted 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