Setting up Apteco email webhooks for responses
The following steps guide you through how to set up Apteco email webhooks for your responses.
Note: For general set up and configuration documentation for Apteco email, see Apteco email.
How the Apteco email webhook process works:
-
Apteco email sends response events as JSON to the webhook.
-
The responses stream to a file in your temporary directory named AptecoEmail_yyyyMMdd@HHmm.txt (a new one each minute).
-
Every minute we pick up the previous files and parse the responses into your response database (RS_). Any errors go to a file in your the file err. You receive a new error file each day.
Setting up the Orbit Updater Configurator
The OrbitResponseAPI Web Application is necessary and resides on your WebServer along with your OrbitAPI. It exists within IIS (Internet Information Services) and has its own configured AspNetPool.
To set up your updater:
-
Log on to your Web Server.
-
Go to your Orbit Updater C:\Program Files (x86)\Apteco\FastStats Orbit Updater.
-
Run UpdaterConfigurator.exe by right-clicking on the executable and choosing Run As Administrator.
-
Select ResponsesAPI from the right-hand side.
-
Change the top Update option in the right-hand window to read Update if not installed or already installed and a newer version is available.
-
Click File > Save.
Checking the new Application Pool installation
You must now check that you have a new application pool installed.
To do this:
-
Click in the Windows Search pane on the bottom Task Bar, type Services, then go into the Windows Services.
-
Highlight any Service in the right-hand window and press F and navigate down and highlight FastStats Orbit Updater.
-
Right-click on this and Restart the Service.
-
Click on the Windows Search at the bottom of the Task Bar and type IIS. This comes up with IIS (Internet Information Services).
-
The Orbit Updater installs the OrbitResponsesAPI and a new Application Pool called AspNetCoreReponses.
Setting up your Orbit Responses API
You now need to set up the API for the webhook to work successfully.
Note: Make sure that you have access to the OrbitResponses API. You can check this with swagger.
To set up your OrbitResponses API:
-
Go to https://<WebServerURL>/OrbitResponsesAPI/swagger/ui/index.html.
-
To configure the AptecoEmailWebhook, update your appsettings.json file located in the OrbitReponseAPI folder: C:\inetpub\wwwroot\OrbitResponsesAPI\appsettings.json
Copy"AptecoEmail": {
"ConnectionString": "user id=faststats_service;password=xxx;initial catalog=RS_Develop;data source=10.0.2.101;pooling=true;max pool size=10000;",
"ApiKey": "xxx",
"ApiSecret": "xxx",
"UrnField": "urn",
"BaseUrl": "https://apteco-email.integrations.apteco.com/",
"ResponsePath": "C:\\temp\\Orbit\\Responses\\AptecoEmailResponses\\Test",
}, -
Apply the following settings:
-
The connection string should point at your response database (RS_).
-
The ApiKey and ApiSecret are your Apteco email account details.
-
The UrnField should be set to what you have called your Person URN in your system. This is its description not its reference and must be in *Lowercase*.
-
The BaseUrl is the URL of the Apteco Email integration server.
-
The ResponsePath is where on the server you want to have your temporary working folder to download responses to before inserting them. Make sure that this is accessible by SQL Server.
-
-
Now, send an email to ask Apteco's Technical Services team using support@apteco.com to setup the Webhook within your Apteco email account (under Account Settings, REST API, Event notifications) so Apteco email knows where to send the responses to.
You need to provide the Technical Services team with the link to your webhook. You can find this link via swagger in the AptecoEmailWebhook section.
-
Try out the sample data, and give the Request URL:
-
At this point, Technical Services liaises with the Apteco Business Development team to set this up for all your response types:
You can now send an email through Apteco email, and start picking up your events.