How to initialize the API and use the return values.
API class instantiation
In it's simplest form, all that's necessary is the single AppSpice class file. The class can be instanced in account and network modes.
$appSpice = new AppSpice([apiKey], $networkMode = false);
In account mode (default), the API will only recognize the account directly associated with the API key provided. Use this mode to define the project and optionally develop a network of participating accounts.
The API should be initiated on every page load to return the current environment. You can determine the best use method based upon your framework or other page logic.
This single method will remotely authenticate users and provide the current environment.
||Minimum required method. This method alone will remotely log in a user and return the current environment back to the calling script.|
This option will allow new network accounts to be created at the signin pages. (Otherwise, they're created through the user interface.)
The create new account option will not be offered if a valid type code is not found.
The method arguments are designed to support usage of one user interface for a wide variety of sign up scenarios.
||If you allow creation of new accounts at the signup pages, this option will set the initial gainsharing fee to collect from their revenue earned through the system. Enter a whole number (e.g. 5.25) without the percent sign. This fee will have to be accepted by the new account before implementation.|
||Error alerts that would not be displayed on a form page (invalid system parameters, etc) will be emailed to this address if provided.|
||If provided in your account settings, the system will enforce your User Agreement at the signin pages. Users are automatically required to update their acceptance each time you update the agreement.|