Channel framework startup tutorial - Step 3: Add logging of event callbacks

When Zendesk performs an action for our integration, it can call back to your service via a webhook style callback to let us know what happened. This is particularly helpful when debugging problems with your service.

To support event callbacks, add the eventCallback function to wordpress.js:

exports.eventCallback = (body, res) => {  console.log('Event callback:');  console.log(body);  res.sendStatus(200);};

You can test this by POSTing data to the event callback endpoint, and verifying that you see the POSTed data logged out by your service, like this:

curl -X POST -d '{"some key":"some value"}' -H "Content-Type: application/json" http://localhost:3000/event_callback

Continue on Channel framework startup tutorial - Step 4: Post new resources to the origin service (Channelback).