Skip to main content
CP CoreWebServices v1

CP CoreWebServices v1

Updated over 2 weeks ago

The CPCoreWebServices allows 3rd party applications to safely communicate with the NCR CounterPoint server retrieving real-time information from the SQL Database and exposing the data as an API. This service may also perform monitored events that trigger activity in 3rd party systems.

All transactions are secured over SSL encryption and each request must pass both a physical server whitelist check as well as a user created API KEY validation before any request is handled.

SSL

The CPCoreWebServices only supports SSL over the configured PORT. A self-signed certificate is automatically installed on the host server. You can see it by accessing the MMC viewing Local Computer Certificates under Personal > Certificates.

Usage

General Usage Guidelines: All parameter values must be URL encoded.

=================================================

System Scenarios

=================================================

Scenario: Perform Health Check
MethodName: HealthCheck()

Use:

https://localhost:50937/c5coreapi/?APIToken=123456&action=HealthCheck

Returns:

{

"Shout": ["Hello World!"]

}

Configuration

Service Parameters

<add key="SITENAME" value="MYSITENAME" />

<add key="URL" value="*" />

<add key="PORT" value="50937" />
<add key="DIAGNOSTICSMODE" value="DEBUG" />
<add key="DAYSOFLOGFILES" value="2" />

<add key="APITOKEN" value="xxxxxxxx" />

SITENAME is used to distinguish this location by name when checking into the Red Rook monitoring service. Defaults to "Unknown”

URL is used to identify the URL that will be monitored for authorization requests. Defaults to "*”

PORT is used to identify the PORT that will be monitored for authorization requests. Defaults to 80.

APITOKEN is used to compare the APIToken passed in the REST calls. If this does not match, the request will be rejected. Required field 6-50 characters.

DIAGNOSTICSMODE is used to set the level of logging to output. Only Errors will be output unless value is set to DEBUG. Defaults to DEBUG.

DAYSOFLOGFILES is used to set the number of days of logs to keep on file. Defaults to 2.

Logging

Logging is automatically turned on and writes to 2 text files for the current date (Example: Requests_04-Nov-2016.txt). Logging will report each step displaying only ERROR level information unless the .config file includes DIAGNOSTICSMODE set to DEBUG. Debug level output will include all inbound parameter values and values obtained from a database and calculated values. It is safe to delete the logs as they will get recreated.

Log Types

Requests_System logs all startup routines and external requests to the service listener in this log

SelfCheck_System performs a selfcheck on the listener status to ensure it is always running. Logs for this effort are reported in a separate file.

Here is a sample of logtype Requests_03-Feb-2017.txt:

2/3/2017 1:15:20 AMD Commerce5_CoreAPI.MonitorSite.GetContextCallBack                      Starting >> [a844d705-4537-4351-b151-519ed6928a0e]                                                                                                                                                        
2/3/2017 1:15:20 AMD Commerce5_CoreAPI.AppModules.GetItemQuantity Website = www.mywebsite.com
2/3/2017 1:15:20 AMD Commerce5_CoreAPI.AppModules.GetItemQuantity Item(s) = *060-1,*063-1,*063-1
2/3/2017 1:15:20 AMD Commerce5_CoreAPI.AppModules.GetItemQuantity Unique Items Requested = 2
2/3/2017 1:15:20 AMD Commerce5_CoreAPI.AppModules.GetItemQuantity Obtaining Inventory Control Settings.
2/3/2017 1:15:20 AMD Commerce5_CoreAPI.AppModules.GetItemQuantity Identifying which locations to calculate inventory quantities from.
2/3/2017 1:15:20 AMD Commerce5_CoreAPI.AppModules.GetItemQuantity Return Quantity (0) calculated from QTY_AVAIL
2/3/2017 1:15:20 AMD Commerce5_CoreAPI.AppModules.GetItemQuantity Return Quantity (0) calculated from QTY_AVAIL
2/3/2017 1:15:20 AMD Commerce5_CoreAPI.MonitorSite.GetContextCallBack Completed >> [a844d705-4537-4351-b151-519ed6928a0e] GetItemQuantity
Did this answer your question?