Using NodeJS API
- To work with the WizCloud API, you have to use the Node.JS command prompt.
- Open a new directory on your computer, for example "myapi".
- Open the Node.JS command prompt. If a message such as
"Your environment has been set up for using Node.js 10.16.3 (x64) and npm"
is displayed, you can proceed to the next stage (4). If no such message is displayed, you have to install npm -
npm install
. - Open the Node.JS command prompt and go to your new directory -
cd myapi
. - Install wizcloud-api only once -
npm install wizcloud-api
.
- Once wizcloud-api has been installed you can find the following files in your directory:
The node modules directory includes the wizcloud-api sub-directory:
The Examples directory lists some examples and the configuration file:
-
Copy the apiConfig.js and the example files and paste them in your directory (myapi)
-
Go to your directory and configure a personal data in the file:
apiConfig.js
-
WizcloudApiPrivateKey – your WizCloud access key is a long string generated from the following menu. The access to this window is limited to the administrator.
-
WizcloudApiServer - your WizCloud server
-
WizcloudApiDBName - your database name (wizdb…).
-
-
Once the configuration is done, you can try one of the working examples or modify some of these examples or create your personal example.
-
To use (run api method) one of the examples/your file, you can return to the Node.JS command prompt and run a proper file -
node BankPagesApiExample
.
- The list of the example files:
- Each example file includes three parts:
- Basic required code - no need to modify this part
- Jason data example – you should update this part by properly structured data. Jason data include a list of fields given in the data tables below. You have to update the fields marked by ***. The other fields are optional.
- API methods – you should update the parameters for each method that you wish to use. You don’t have to use all the methods.
- All the methods listed below include an additional constant parameter "myDBname" that is defined in the first part of the file by using the configuration data.
All the changes in all the methods have to be done according to proper data structure. See full explanation about each method under Import/Export.