Question: How do I configure the Act! Web API when using a custom Website configuration?Product Details:
- Product Family: Act!
- Product: Act! Premium for Web
If you have set up your own custom APFW website in Internet Information Services (IIS), you will need to ensure that your Act! API and your custom website are both setup correctly.
The setup required depends on whether you have installed the Act! Connect Link or you are using the Act! Web API that comes ready installed with the program. Please follow the instructions below for guidance.
Note: The following steps should be performed on the computer hosting your APFW website.
I’m using the Act! Web API
There are 2 config files to update in the event that you have customised your APFW website directory.
Act! Web API Configuration
By default, the config file for your Act! Web API application is located at C:\Program Files (x86)\ACT\Act.Web.API\web.config and in this file there are 2 settings that you will need to confirm to be correct after customising your APFW website:
This key points your Act! Web API towards the Admin.xml document that stores all databases associated with your website and by default is located at C:\Program Files (x86)\ACT\Act for Web\PadFiles\Admin.xml
This is the name of your Act! for Web application in IIS and by default is set to “APFW”
See below for an example of these keys at their default setting. Update either of these values if they have been changed during your customisation.
We create a custom APFW application in IIS called “CompanyInc” which points to a copy of the APFW application files at the following location: C:\Program Files (x86)\ACT\Act for Web\APFW-CompanyInc\
We also choose to move the admin.xml file mentioned above in to this custom directory at the following location: C:\Program Files (x86)\ACT\Act for Web\APFW-CompanyInc\PadFiles\Admin.xml
With this setup, we would expect the web.config file for your Act! Web API to look like the screenshot below:
Act! for Web website configuration
By default, the config file for your APFW website is located at C:\Program Files (x86)\ACT\Act for Web\APFW\web.config and in this file there is one setting that you will need to confirm to be correct after customising your APFW website.
Search for the Key named “WebAPIBaseURL” in this config file. By default it will be blank and display as shown below.
For your website to use your Act! Web API you will need to update the WebAPIBaseURL key with your full API URL.
You have setup your custom API site in IIS to be accessible at:
With this setup, we would expect the web.config file for your APFW website to look like the screenshot below:
I’m managing multiple sites on the same machine
If you manage multiple websites on the same web server, you will need to make sure each API application contains its own unique “BearerKey”. This BearerKey is located in the web.config file for the API which is by default located in ‘C:\Program Files (x86)\ACT\Act.Web.API\web.config’. The advice below will assume the default location for files & folders involved, please modify this advice where necessary.
Via a command prompt, we will be using the executable RegenerateBearerKey.exe found in the installation files for the Act! Web API. Please see below for an example that will provide a NEW bearer key to the default act.web.api application.
Press the Windows key on your keyboard and type CMD and press Enter to open a command prompt.
C:\updateactwebapi_v1.0.375.0\regenerateBearerKey.exe -fk -l "c:\program files (x86)\act\act for web\act.web.api"
If this is successful, the CMD prompt should go to a new line without any error message or confirmation. You should now see a new key has been generated in the API web.config file that you chose.
I’m using the Act! Connect Link
This guidance assumes you have already installed the Act! Connect Link and are ready to configure your custom APFW website. If you haven’t installed the Act! Connect Link yet, please refer to the following article to get started: https://www.act.com/products/act-connect-link
When using the Act! Connect link with custom APFW websites, we need to update the web.config file of your custom website to use the API URL that it provides. Please following the guidance below.
You may wish to paste this somewhere (such as Notepad) in order to easily use it again.
Once you have located this, amend the value using your Connect web address that you copied earlier. Save the file and close it.
Please Note: The additional forward slash that MUST be added to the end of the address: