Last Modified October 1, 2026

Activation API - Helper Functions

  1. DNASetProperties
  2. DoWebAPI
  3. DNAParam
  4. DNAError
  5. DoWebInfoTag

For the following coding environments, we provide source code "As Is" for a set of Helper Functions to simplify the implementation. They are all you need to know and use to implement software_DNA.

  • ASP.NET C# Web App
  • Android Studio for Android Apps

You can download them from the DNA Control Panel under Resources -> DNA Libraries

Code Samples for both ASP.NET and Android are available for download under Resources -> Code Samples

All Helper Functions will return an integer dnaError error code.

 

int DNASetProperties( prop_name, prop_value )

The following properties to be set before calling any Helper Functions using DNASetProperties for each property:

for SAAS Apps
licenseCookieName name of HTTP cookie to store DNA License
licenseCookieDomain domain of HTTP cookie (ex: .softworkz.com)
dnaWebKey the Activation API Key (the WEB_KEY)
for Device Apps
cdmPathName the full path of the location to save the DNA License JSON string
dnaWebKey the Activation API Key (the WEB_KEY)
deviceID <DEVICE_ID> to use for node-locking (optional)
deviceName <deviceName> to use in DNA Control Panel displays and License Manager (optional)

Example of setting properties for a SAAS App

                
                 
                	// set Properties for the Helper Functions
					dnaError = DNAWEB.DNASetProperties("licenseCookieName","saasDemo");
					dnaError = DNAWEB.DNASetProperties("licenseCookieDomain",".softworkz.com");
					dnaError = DNAWEB.DNASetProperties("dnaWebKey","APIxxxxxxxxxxxxxxx");
                
                

 

int DoWebAPI( apiName, productID, licenseCode, licenseEmail, licensePassword, newPassword )

  • executes the given apiName API call including the HTTPS POST/GET to the DNA Servers, and returns dnaError
    (See DNA Error Codes     for description of error codes)
  • generates Request Signatures and validates Response Signatures
  • read / writes the DNA License
  • for WEB_Validate, implements a Local Validation function

(Note: parameters not used by the API should be empty strings)

DoWebAPI( "WEB_VALIDATE", productid, "", "", "", "" )
  • performs a local validation of the License
  • performs a DNA Server Validation if more than 24 hours since the last DNA Server Validation
DoWebAPI( "WEB_VALIDATECDM",productid,"","","","" )
  • performs a local validation of the License
DoWebAPI( "WEB_ACTIVATE", productid, licenseCode, licenseEmail, licensePassword, "" ) (for Device Apps)
DoWebAPI( "WEB_ACTIVATE_SAAS", productid, licenseCode, licenseEmail, licensePassword, "" ) (for SAAS Apps)
DoWebAPI( "WEB_ACTIVATE_LOGIN", productid, licenseCode, licenseEmail, licensePassword, "" ) (for SAAS Apps tied to Device App)
  • activates the License
  • licenseEmail is optional but recommended
DoWebAPI( "WEB_REACTIVATE", productid, licenseCode, licenseEmail, licensePassword, newPassword )
  • re-activates the License
  • newPassword is only required for licenses using Roll-over Re-activation, otherwise, pass empty string
DoWebAPI( "WEB_DEACTIVATE", productid, licenseCode, licensePassword, "", "" )
  • de-activates the License
  • licensePassword is empty string if Evaluation License issued with WEB_EvaluateNow
DoWebAPI( "WEB_EVALUATENOW", productid, "", "", "", "" )
  • generates and immediately activates an Evaluation License
DoWebAPI( "WEB_SENDEVALCODE", productid, "", userEmail, "", "" )
  • generates an Evaluation License and sends the licenseCode to the userEmail
DoWebAPI( "WEB_QUERY", productid, licenseCode, "", "", "" )
  • used for the TurnKey Activation method
  • returns an error code based on the status of the licenseCode
  • see implementation guides for details
DoWebAPI( "WEB_RESETPASSWORD", productid, licenseCode, "", "", "" )
  • resends the License Password to the licenseEmail with instructions

 

int DNAParam( keyName )

  • returns the keyValue of the keyName, or <empty string> if it does not exist in the Web License

 

int DNAError( dnaError )

  • returns a text description of the dnaError;. The DNAError() function can be edited to provide different descriptions and different languages.

 

int DoWebInfoTag( productid, licenseCode, infoTag )

  • sets the Info Tag for the License Code
  • maximum length of infoTag is 512 characters and will be encoded in Base64 by this function.