Web API URL

The Web API URL (also called the Web API site URL) refers to the address of the Web API application executable file (ServerAPIs.exe). It serves as the root URL for all PowerServer Web APIs (such as /api/ServerApiCreateSession, /api/ServerApi/ConnectAndCreateTransaction etc.)

When PowerServer Web APIs are deployed to a web server, the Web API URL is determined by the server configuration and folder structure:

  • For Kestrel:

    When Web APIs are self-hosted in the built-in Kestrel, it is directly bound to a port using Kestrel.

    Web API URL = server site URL

    Example: http://172.16.100.2:5000/

  • For IIS:

    There are multiple deployment scenarios in IIS, each resulting in a different Web API URL.

    • Web APIs files directly in IIS Web root

      1. The compiled Web API files (ServerAPIs.exe, web.config, app assembly files, dependencies etc.) are placed directly in the IIS Web root.

      2. web.config points to ServerAPIs.exe in the same folder by default (e.g., .\ServerAPIs.exe).

        Web API URL = server site URL

        Example: http://172.16.100.2:83/

    • Web APIs files in a sub-folder (converted to IIS sub-app)

      1. The compiled Web API files are placed in a sub-folder under the IIS Web root.

      2. The sub-folder is converted to a sub-application in IIS.

      3. web.config (in the sub-app) points to ServerAPIs.exe in the same folder by default (e.g., .\ServerAPIs.exe).

        Web API URL = server site URL + sub-folder name

        Example: http://172.16.100.2:83/salesdemo_cloud_API/

    • Web APIs files in a sub-folder (root web.config pointing to ServerAPIs.exe in the sub-folder)

      1. The compiled Web API files are placed in a sub-folder under the IIS Web root.

      2. web.config file in the web root points to ServerAPIs.exe inside that sub-folder (e.g., .\salesdemo_cloud_API\ServerAPIs.exe).

        Web API URL = server site URL

        Example: http://172.16.100.2:83/

      There is no need to include the sub-folder in the URL, because the web root's web.config explicitly points to the executable in that sub-folder, therefore, IIS treats that sub-folder's executable as the entry point for the whole site, and when requests are sent to this URL, they will be routed to the Web APIs in that sub-folder. For more information about the web root's web.config and the sub-folder's web.config, refer to web.config.

The client app must call PowerServer Web APIs to perform database connections, data processing, PowerServer license activation, and more. Therefore, each client must be configured with the correct root URL for its corresponding PowerServer Web APIs.

For where to configure the Web API URL for a client app, refer to Configure the Web API URL.