Connecting to the API

In versions earlier than 8.2, you had to have an ODBC connection that is defined and have access to the signing keys for the deployment to authenticate to the API. In version 8.2, the use of signing keys and ODBC connections was discontinued. You only need the server hostname and login credentials to connect to the API.

Your existing code should continue to work properly, assuming that you still have access to the keys and they have not been changed in the deployment after your upgrade. However, using signing keys results in the execution of additional steps in the connection process, and you might want to consider migrating to the simpler login to speed things up.

In version 8.1 and earlier, you were required to create a SigningKeys object, direct that to the location of the keys, and then ascertain their validity. The sequence was:

 SetDefaultDSN( $DSN )
  SetPrivateKeyPath( $Username, $Path )
  AreSigningKeysValid( $Username, $Password )
      

In version 8.2, the SigningKeys object is not required. Instead, from any BESAPI object, you can use:

 SetServer( $Hostname )

Each subsequent call uses this server for communication. No ODBC connection must be established and no signing key is required. The new API, however, does need to get an SSL Certificate from the server and store that locally. The location where this key is stored is either the current path of the executable using the API or from a registry key. That key is:

 HKEY_LOCAL_MACHINE\Software\BigFix\(ApplicationName)\base.  
The ApplicationName is set from any object by using:
SetAppName( $ApplicationName )

If the SSL Certificate on the server changes, it might be necessary to delete the old certificate from this location. It is also the location where information fetched from the server is stored, such as site exports.

Note: For versions earlier than 8.2, Patch 3, the API still requires that you make unnecessary calls to the signing key related methods. To avoid this situation, make sure that you have Patch 3 or later.