This project contains source code for the ServiceNow K15 breakout session titled Enabling Web API Integrations with ServiceNow.
Speakers
- Bryan Barnard (@nardbard), Integrations Product Manager at ServiceNow
- Silas Smith, Senior Software Engineer at ServiceNow
- Venkata Koya, Senior Software Engineer at ServiceNow
Special thanks to Grant Hulbert (@VoiceOfSoftware) for assisting in the demo preparation.
Here is an overview of the demo architecture.
The demo consists of:
ServiceNow instance
The ServiceNow instance is configured with one table to store participant phone numbers, and two Import Set web services to handle registering participants and triggering the bridge.
Component | Table | Description |
---|---|---|
Session Participants | u_session_attendees |
Stores the registered phone numbers |
Session Participants Import Set Web Service | u_attendee_phone_number_imp_ws |
Registers a phone number |
Urgent Incident Conf Trigger Import Set Web Service | u_urgent_incident_conf_trigger |
Triggers opening a bridge from a transform script |
The update set with these components can be found here.
Additionally, Notify API properties are configured as:
Twilio configuration
Twilio is configured to forward SMS messages received at the register phone number (312-313-1772) to the registration endpoint served by the Node.js app.
Additionally a separate Twilio number (312-488-1677) is configured to act as the bridge line -- this is the line from which calls and texts about the bridge are sent to participants.
Node.js web application
The Node.js application source code can be found here.
This app can be hosted on any server capable of running Node.js applications (for this demo we used a VM provided by Digital Ocean).
The app consists of a /register
endpoint which proxies the incoming message from Twilio to ServiceNow using the Import Set API.
It also contains an index page to display the registration info and current count of participants, which uses the ServiceNow Aggregate API to retrieve the count from the u_session_attendees
table.
iOS applications
The iOS apps consist of an iPhone app and a Watch app which retrieve the most recent P1 incidents, and can trigger a bridge for the incidents.
They use the ServiceNow Table API to retrieve the P1 incidents, and the Import Set API to trigger opening a bridge for an incident. The Import Set Transform Map is configured with a transform script that uses ServiceNow's Notify API to open a bridge through Twilio.
The source code for the apps can be found here.