{{ title }}
What is eCourtDate?
eCourtDate is a cloud-native communications platform used by justice systems such as courts and prosecutors. Agencies can automatically send and receive two-way messages via texts (SMS), email, and voice calls.
Webhooks allows system admins to integrate eCourtDate's scheduling and messaging capabilities into their own applications and workflows.
eCourtDate Agency Required
Getting Started
Webhooks are designed to provide real-time data about messages, events, and payments for machine-to-machine communication. You can use webhooks to notify an internal Teams channel about new payments or a kiosk system about new check-ins.
Step 1 - Create a Webhook
Login to the Console, then click Webhooks from the top navigation.
In the Add Webhook form, enter a name (you can change this later), choose a region, then click Add.
Step 2 - Customize Webhook
(optional) Choose the Agency to use for the webhook.
(required) Enter your webhook URL. This is the URL that we'll send webhook events to.
Step 3 - Use Webhooks
Webhooks can be used in connected systems to respond to real-time changes. Use our REST API to update data and trigger multilingual notifications.
Inbound Message Webhook
The following is a sample payload of an inbound message (such as a text message) sent to an Agency Phone Number.
{
"token": "{uuid}",
"content": "Can I reschedule my next court date?",
"from": "+14442225555",
"to": "+12224445555",
"segments": 1,
"mms": 0,
"channel": "text",
"uuid": "{uuid}",
"created_at": "{date-time-utc}",
"created_by": "{api-uuid}",
"url": "{message-url}",
"sent": 1,
"last_status": "received",
"direction": "inbound",
"credits": 1,
"scheduled_at": "{date-time-utc}",
"updated_at": "{date-time-utc},
"client": "{client-uuid}",
"first_name": "james",
"last_name": "madison",
"client_reference": "{client-reference}",
}
Sample Code
Below is a simple Node.js application that demonstrates how to set up an Express server to listen for incoming webhook events and respond with a JSON payload.
1. First, ensure you have node
and npm
installed. If not, download and install them from Node.js official website.
2. Create a new directory for your demo:
bash
mkdir webhook-demo
cd webhook-demo
3. Initialize a new Node.js application:
bash
npm init -y
4. Install the required packages:
bash
npm install express body-parser
5. Create a file called `app.js` and add the following code:
javascript
const express = require('express');
const bodyParser = require('body-parser');
const app = express();
// Use body-parser middleware to parse JSON payloads
app.use(bodyParser.json());
// Webhook endpoint
app.post('/webhook', (req, res) => {
console.log('Received webhook event:', req.body);
// Respond with a JSON payload
res.json({
message: 'Webhook received successfully!'
});
});
// Start the server
const PORT = 3000;
app.listen(PORT, () => {
console.log(`Server is running on http://localhost:${PORT}`);
});
6. Run the application:
bash
node app.js
7. To test the webhook, you can send a message to your Agency Phone or Agency Email.
You should see the console output indicating the received webhook event and the curl command should receive a JSON response:
json
{
"message": "Webhook received successfully!"
}
Technical Support
If you have any questions or issues while using eCourtDate's Webhooks, please contact our support team at help@ecourtdate.com. We're here to help.
We appreciate any feedback or suggestions to improve our Webhooks and technical resources.