Skip to content

Setting up Apteco SMS webhooks for responses

Webhooks are the preferred method for collecting responses from SMS providers because they provide real-time updates without the need for scheduled polling.

Warning

If your system is hosted in the cloud and regularly shuts 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. Responses are temporarily stored in:

Text Only
C:\temp\Orbit\Responses\AptecoSmsResponses\
  • If processed successfully, responses are inserted into the Response and ResponseDetails tables in the RS database.
  • If an error occurs, .err files are generated in the same directory for troubleshooting.

Pre-requisites

  • 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 available
  • The OrbitResponsesAPI downloaded and ready to use

Verification steps

  1. Run FastStats Orbit Updater Configurator (UpdaterConfigurator.exe) as Administrator:

    Text Only
    C:\Program Files (x86)\Apteco\FastStats Orbit Updater\
    
  2. Click on the Responses API tab.

  3. Check that the Base URL points to the correct OrbitResponsesAPI and click Test.
  4. If not installed, set the Update option to Update if not installed or if a newer version is available.
  5. If the update option was previously set to Don't Update or the API was missing, restart the FastStats Orbit Updater service.
  6. Use the Summary page to confirm the Responses API installation status.

    Summary page showing Responses API installation status

  7. Test the OrbitResponsesAPI via Swagger by navigating to:

    Text Only
    /OrbitResponsesAPI/swagger/ui/index.html
    

    Orbit Responses API Swagger page

Configure the Apteco SMS section

Add the following to your appsettings.json configuration for the OrbitResponsesAPI:

JSON
"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"
}

Where:

  • 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.

Obtain the webhook URL

  1. Open the Swagger page: OrbitResponsesAPI/swagger/ui/index.html
  2. Expand the AptecoSmsWebhook section.
  3. Click Try It Out and then Execute.
  4. The Request URL displayed is the Apteco SMS webhook URL.

    Webhook URL in AptecoSmsWebhook section