Skip to main content

Using NodeJS API

  1. To work with the WizCloud API, you have to use the Node.JS command prompt.
  2. Open a new directory on your computer, for example "myapi".
  3. 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.
  4. Open the Node.JS command prompt and go to your new directory - cd myapi.
  5. Install wizcloud-api only once - npm install wizcloud-api.

nodejs install wizcloud api

  1. Once wizcloud-api has been installed you can find the following files in your directory:

myapi directory

The node modules directory includes the wizcloud-api sub-directory:

wizcloud-api sub-directory

The Examples directory lists some examples and the configuration file:

examples directory

  1. Copy the apiConfig.js and the example files and paste them in your directory (myapi)

  2. 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…).

  3. Once the configuration is done, you can try one of the working examples or modify some of these examples or create your personal example.

  4. 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.

command prompt run file

  1. The list of the example files:

example files

  1. 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.
  1. 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.