In this tutorial, we’ll observe how to configure Bytescout Cloud API Server. In the last article, we have gone through setting-up API Server in Internet Information Server (IIS).
To begin with, Let’s explore the API Server publish folder. Here we have all published files for API Server. We’re mostly interested in the Web.Config file here, it’s the key file for setting up various configurations. Let’s open a Web.Config file with any text editor. I am using VS Code here.
In the Web.Config file, under Configuration, AppSettings contains all settings; as expected. To begin with, we’ll be going through some key settings.
Storage Type: This represents the output location of generated files. It can be either “Local” or “S3”. If the storage type is Local, output files will be stored locally in the specified folder. We also need to specify additional settings for local storage such as storage path, base URL, lifespan of stored files, etc.
On the other hand, If we have configured Storage Type as S3, then output files will be stored on A.W.S. S3 storage. As expected, we have to provide S3 related settings. For example, Bucket Name, A.W.S. Keys, Server region, etc.
Let’s see the contents of the local storage folder. Here, we have a local storage type. Let me grab the path and open it in file explorer. As we observe it contains several folders with output files inside. Please note that these files are temporary and will be deleted after the specified duration.
One Important note here, we have to give written permission to an IIS user so that files can be generated at a specific location. Follow these steps to check rights.
- Right-click on the output folder and navigate to Properties.
- I have already given it right here, we can check by going to the Sharing tab and verifying allowed roles in the Share menu.
Folders specified by local storage settings contain nested folders with output files. Let’s observe them.
Now moving to other configuration settings, ‘BaseUrl’ will be used in API response to refer to output files.
“LogExceptionType” represents error log type. It can be either None, Local, Email or LocalAndEmail. Its name is self-explanatory here. In the case of Local error message logging, we need to provide an output folder path for error logging.
Let me open an error log-in file explorer. As of now, there are no error files (lucky me! 🙂 here, but in case of error they’ll be stored here and can be very useful for diagnosis.
In case we also want an email to be sent to the developer when an error occurs, we need to provide email details such as Email To, SMTP configuration, etc.
And finally, we need to set all license keys for internal ByteScout SDKs used. You will receive all License keys upon purchase of the API Server license.