Beetexting Connect OpenAPI
API Swagger Docs
Beetexting
  1. Webhook Subscriptions API
  • API Reference
  • OAuth 2.0 for Beetexting
  • Postman How-to for Beetexting OpenAPIs
  • Zapier How-to for Beetexting OpenAPIs
  • FAQ
  • APIs
    • Message API
      • Send SMS
      • Send MMS
    • Contacts
      • Get All Contacts in an Org
      • Find contact using Mobile number
      • Search a contact using Number
      • Create or Update Contact
      • Update contact using Mobile number
      • Update Contact
    • Consent
      • Create Custom Consent
      • Update Custom Consent
      • Get Custom Consent Details Using ID
      • Get All Custom Consents
      • Change Custom Consent Status by Id
      • Add or Remove Custom Consent Type
    • Webhook Subscriptions API
      • Get All Subscriptions
        GET
      • Create or Update Subscription
        POST
    • Sites API
      • Get Sites
  1. Webhook Subscriptions API

Create or Update Subscription

POST
/webhooksubscription

Description :

Client applications subscribe for webhook notifications and listen for the various events pertaining to their data in Beetexting, including; create or update contact, delete contact, and message outbound events. This API helps create or update subscription using "SubscriptionRequest" object in the request body.

URL :

https://connect.beetexting/prod/webhooksubscription
(While sending the request please make sure to append https://connect.beetexting.com/prod if the url in the cUrl command starts with /message ...)

**Note : To add the OAuth2.0 Auth Token please see the section 'OAuth2.0 For Beetexting' and 'Postman How-to for Beetexting section'

Following are the webhook filters to be used for webhook subscription

for inbound -

/orgId/<organizationId>/department/<departmentId>/message?direction=inbound

for outbound -

/orgId/<organizationId>/department/<departmentId>/message?direction=outbound

for contact -

/orgId/<organizationId>/department/<departmentId>/contact

Users can subscribe to the inbound message by sending below request to Beetexting.

API End Point : https://connect.beetexting.com/prod/webhooksubscription

Method : POST

Request Body:

{
"uri": "https://callbackurl.com/\<callback>",
"eventFilters": [
"/orgId/<organizationId>/department/<departmentId>/message?direction=inbound"
],
"expiresDateInMillies": <expireTimeInMillis>
}

Then, Beetexting will validate by sending a GET call to the callback URL, e.g. https://callbackurl.com/ with a validation-token in the request header.
The caller should then send a response with the same validation-token in the response header with https 200 status. If the response header validation-token matches with the request-header validation-token that we sent, we will then send below response for the create subscription call as below:

Response:

{
"id": "",
"uri": "https://callbackurl.com",
"eventFilters": [
"/orgId/<organizationId>/department/<departmentId>/message?direction=inbound"
],
"disabledFilters": [
{
"filter": "string",
"reason": "string",
"message": "string",
"orgId": "string",
"id": "string"
}
],
"expirationTime": "2024-03-10T18:07:52.534Z",
"expiresIn": ,
"status": "ACTIVE",
"createdDateTime": "2023-06-10T18:07:52.534Z",
"lastUpdateDateTime": "2023-06-10T20:07:52.534Z",
"orgId": "<organizationId>"
}

With this, now the user has subscribed to get notification for any inbound/oubound messages.

Once an Inbound message comes Beetexting will send the following payload to the above mentioned uri.
See below the sample payload for the inbound message

Payload :

{
"uuid": "",
"timestamp": 1704067200000,
"event": " "/orgId/<organizationId>/department/<departmentId>/message?direction=inbound",
"subscriptionId": "<SubscriptionId>",
"messageInfo": {
"organizationId": "<organizationId>",
"departmentId": "<departmentId>",
"lastUpdated": 1704067200000,
"messageId": "<messageId>",
"carrierMessageId": "<carrierMessageId>",
"status": "<messageStatus>"
}
}

Using the messageId part of the above payload, user can call the below end point to get the message details.

API End Point : https://connect.beetexting.com/prod/message/getmessagebyid/{messageId}

Method : GET

Response:

{
"id": "<messageId>",
"owner": "user@example.com",
"time": "2024-01-01T12:00:00Z",
"direction": "in",
"to": [
"<mobileNumber>",
"<mobileNumber>"
],
"from": "<mobileNumber>",
"text": "<Message Text>",
"media": [
"<MessageRelatedMedia in String>"
],
"attachments": [
"<AttachementsRelated in String>"
]
}

Sample Response:

{
"id": "67070af782b96f464c18bc7b",
"owner": null,
"time": null,
"direction": "in",
"to": [
"+112353623623"
],
"from": "",
"text": "Hi ",
"media": [],
"attachments": []
}

Request

Authorization
Add the parameter
Authorization
to Headers
,whose value is to concatenate the Token after the Bearer.
Example:
Authorization: Bearer ********************
Header Params

Body Params application/json

Examples

Responses

🟢200Success
application/json
Bodyapplication/json

Request Request Example
Shell
JavaScript
Java
Swift
curl --location '/webhooksubscription' \
--header 'x-api-key: HvG7OZaxgz3raDMzX9CYp9105hV9VwDa6zrCS234' \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
    "uri": "https://beetexting.com",
    "eventFilters": [
        "/orgId/<organizationId>/department/<departmentId>/contact",
        "/orgId/<organizationId>/department/<departmentId>/message?direction=outbound"
    ],
    "expiresDateInMillies": 0
}'
Response Response Example
{
    "id": "string",
    "uri": "string",
    "eventFilters": [
        "string"
    ],
    "disabledFilters": [
        {
            "filter": "string",
            "reason": "string",
            "message": "string",
            "orgId": "string",
            "id": "string"
        }
    ],
    "expirationTime": "2024-03-10T18:07:52.534Z",
    "expiresIn": 0,
    "status": "ACTIVE",
    "createdDateTime": "2023-06-10T18:07:52.534Z",
    "lastUpdateDateTime": "2023-06-10T20:07:52.534Z",
    "orgId": "string"
}
Modified at 2026-08-27 15:19:26
Previous
Get All Subscriptions
Next
Get Sites
Built with