Skip to content

Instantly share code, notes, and snippets.

@anthonycoffey
Last active December 7, 2025 07:33
Show Gist options
  • Select an option

  • Save anthonycoffey/4c69a40320e4906bdd7a093a1d149686 to your computer and use it in GitHub Desktop.

Select an option

Save anthonycoffey/4c69a40320e4906bdd7a093a1d149686 to your computer and use it in GitHub Desktop.
This webhook accepts a customer's phone number and returns active jobs in a JSON response

Simpletalk Webhook API

This document provides instructions for using the Simpletalk webhook to retrieve active job information for a customer.

Endpoint

POST /webhooks/simpletalk/jobs

Authentication

This endpoint is protected by an API key. You must include a valid API key in the X-API-KEY header of your request.

  • Header: X-API-KEY
  • Value: Your secret API key

Request Body

The request body must be a JSON object containing the customer's phone number.

  • Content-Type: application/json
Parameter Type Description
phoneNumber String The customer's phone number.

Example:

{
  "phoneNumber": "+15551234567"
}

Response

The webhook will return a JSON object containing the customer's information and a list of their active jobs.

Success (200 OK):

{
  "customer": {
    "name": "John Doe",
    "phone": "+15551234567"
  },
  "activeJobs": [
    {
      "jobId": 123,
      "status": "en_route",
      "proxyNumber": "+15557654321",
      "technician": {
        "name": "Mike Smith"
      },
      "serviceLocation": {
        "address": "123 Main St, Anytown, USA"
      }
    }
  ]
}

Error Responses:

  • 400 Bad Request: The phoneNumber is missing from the request body.
  • 401 Unauthorized: The API key is missing.
  • 403 Forbidden: The API key is invalid.
  • 404 Not Found: The customer could not be found.
  • 500 Internal Server Error: An unexpected error occurred.

Create Notification

POST /webhooks/simpletalk/notifications

Authentication

This endpoint is protected by an API key. You must include a valid API key in the X-API-KEY header of your request.

  • Header: X-API-KEY
  • Value: Your secret API key

Request Body

The request body must be a JSON object containing the notification details.

  • Content-Type: application/json
Parameter Type Description
title String The title of the notification.
message String The body text of the notification.
recipients Integer or Array[Integer] The User ID(s) of the recipient(s).
from String (Optional) The sender identifier.
to String (Optional) The recipient identifier (string representation).

Example:

{
  "title": "New Job Assigned",
  "message": "You have been assigned a new job.",
  "recipients": [123],
  "from": "System",
  "to": "Technician Mike"
}

Response

The webhook will return a JSON object containing the created notification and push notification status.

Success (201 Created):

{
  "newNotification": {
    "id": 1,
    "title": "New Job Assigned",
    "message": "You have been assigned a new job.",
    "from": "System",
    "to": "Technician Mike",
    "recipients": [123],
    "createdAt": "2023-10-27T10:00:00.000Z",
    "updatedAt": "2023-10-27T10:00:00.000Z"
  },
  "newPushNotification": {
    "success": true,
    "message": "Push notification sent"
  }
}

Error Responses:

  • 401 Unauthorized: The API key is missing.
  • 403 Forbidden: The API key is invalid.
  • 500 Internal Server Error: An unexpected error occurred.

Search Form Submissions

POST /webhooks/simpletalk/form-submissions/search

Authentication

This endpoint is protected by an API key. You must include a valid API key in the X-API-KEY header of your request.

  • Header: X-API-KEY
  • Value: Your secret API key

Request Body

The request body should be a JSON object where the keys correspond to the form field names (e.g., phone, full_name, service_type) and the values are the strings to search for. The search performs a case-insensitive partial match on the values.

  • Content-Type: application/json

Example:

{
  "phone": "737932",
  "full_name": "John"
}

This will find submissions where the phone number contains "737932" AND the full name contains "John".

Response

The webhook will return an array of matching form submission objects.

Success (200 OK):

[
  {
    "id": 155383,
    "submission": [
      {
        "name": "full_name",
        "value": "John Doe"
      },
      {
        "name": "phone",
        "value": "(737) 932-4565"
      },
      ...
    ],
    "status": "pending",
    "createdAt": "2023-10-27T10:00:00.000Z",
    "updatedAt": "2023-10-27T10:00:00.000Z"
  }
]

Error Responses:

  • 400 Bad Request: The payload is missing or empty.
  • 401 Unauthorized: The API key is missing.
  • 403 Forbidden: The API key is invalid.
  • 500 Internal Server Error: An unexpected error occurred.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment