What are the requirements to run the code samples?


For the ASP sample code, you can follow the below steps on how to run the script:

1. Unzip it and upload / copy the files into any Windows Server or Localhost that can run ASP script.
NOTE: You don’t need to upload the sample files into a VPCart site folder. The sample files are standalone and does not have any correlation to VPCart files.

2. Login to your VPCart administration : Modules > API Manager > Add a record to create API User, Password, and Secret Key.

3. Open testclientapi.asp using notepad or text editor, and please replace the below credentials to yours :
const apiuser = "enter your API User"
const apipassword = "enter your API Password"
const apisecretkey = "enter your API Secret Key" 
const api_mainsite_url = "Enter the url of a VPCart site"
 

4. Save and upload the file to your Windows Server or Localhost.

5. Open browser and type the URL eg : http://www.example.com/api_default.asp
Or for localhost type the URL eg : http://localhost/[yourfolder]/api_default.asp

6. You should see preview like this :



7. Click any of the table links to simulate the JSON Request and JSON Response for each View and List section.



 

For the PHP sample code, you can follow the below steps on how to run the script:

1. Unzip it and upload / copy the file into a Linux Server or Windows Server that can run PHP script.
NOTE: You don’t need to upload the sample file into a VPCart site folder. The sample file is standalone and does not have any correlation to VPCart files.

2. Login to your VPCart administration : Modules > API Manager > Add a record to create API User, Password, and Secret Key.

3. Open samplecode.php using notepad or text editor, and please replace the below credentials to yours :

      public $base_url              = "[enter your VPCart site URL]";

      public $api_user              = '[enter your api user]';

      public $api_password          = '[enter your api password]';

      public $api_secretkey         = '[enter your api secretkey]';

4. Save and upload the file to your Linux Server or Windows Server.

5. Open browser and type the URL eg : http://www.example.com/samplecode.php

6. You should see preview like this :