Setting up Apteco SMS webhooks for responses
Webhooks are the preferred method for collecting responses from Email/SMS providers because they provide real-time updates without the need for scheduled polling. This ensures that responses are gathered much faster.
However, when configuring Apteco SMS responses, an important consideration is whether the system is hosted in the cloud and regularly shuts down. If the cloud instance is frequently powered down, SMS Webhooks may not be ideal. Sinch, Apteco's SMS provider, retries sending webhook data for up to 24 hours. After this period, unsent data is lost.
For more detail on using Apteco SMS, see Apteco SMS.
How the Apteco SMS webhook works
When a recipient responds to an Apteco SMS message, Apteco forwards the response as a .json
request to the webhook. These responses are temporarily stored in:
C:\temp\Orbit\Responses\AptecoSmsResponses\
-
If processed successfully, responses are inserted into the Response and ResponseDetails tables within the RS database.
-
If an error occurs,
.err
files are generated in the same directory for troubleshooting.
Pre-requisites
Before proceeding, ensure you have the following:
-
The API Key and API Secret used to configure the SMS channel
-
A configured and running Orbit instance with the Apteco SMS channel set up
-
An email response database (RS) with connection details readily available
-
The OrbitResponsesAPI downloaded and ready to use
Verification steps
To verify your webhook connection:
-
Run FastStats Orbit Updater Configurator (
UpdaterConfigurator.exe
) as an administrator. Typically located at:CopyC:\Program Files (x86)\Apteco\FastStats Orbit Updater\
-
Click on the Responses API tab.
-
Check that the Base URL setting points to the correct OrbitResponsesAPI and test it by clicking Test.
-
If not installed, set the Update option to:
-
Update if not installed or if a newer version is available
-
-
If the update option was set to Don't Update or the API was missing, restart the FastStats Orbit Updater service.
-
Use the Summary page to confirm the Responses API installation status.
-
Once confirmed, test the OrbitResponsesAPI via Swagger by navigating to:
Copy<Base URL>/OrbitResponsesAPI/swagger/ui/index.html
The page should look like this:
Configuring webhooks in appsettings.json
To configure the webhook, edit the appsettings.json
file in the OrbitResponsesAPI directory on the web server (default location: C:\inetpub\wwwroot\OrbitResponsesAPI
).
Locate the AptecoSMS section and update the following settings:
"AptecoSMS": {
"ConnectionString": "user id=faststats_service;password=;initial catalog=RS_DB01;data source=localhost;pooling=true;max pool size=10000;",
"SystemConnectionString": "user id=faststats_service;password=;initial catalog=WS_DB01;data source=localhost;pooling=true;max pool size=10000;",
"OrbitApiUrl": "",
"OrbitDataViewName": "DB01",
"ApiKey": "",
"ApiSecret": "",
"OptOutKeywords": "OPTOUT,STOP,UNSUBSCRIBE"
}
Parameter explanations
-
ConnectionString: The Orbit database connection string, found in the Orbit Database settings in OrbitAPI Configuration.
-
SystemConnectionString: Connection details for the web service control database, available in FastStats system database settings.
-
OrbitApiUrl: Base URL for Orbit API, found in the API section of FastStats Orbit Updater Configurator.
-
OrbitDataViewName: The Data View name configured for Apteco SMS.
Save the file after making changes.
Obtaining the webhook URL
To retrieve the webhook URL:
-
Open the Swagger page:
OrbitResponsesAPI/swagger/ui/index.html
-
Expand the AptecoSmsWebhook section.
-
Click Try It Out and then Execute.
-
The RequestURL displayed is the Apteco SMS webhook URL.
For more detail on using Apteco SMS, see Apteco SMS.