Documentation

Context path: https://www.xialab.ca/api/

Path Parameters Return values Description
/login String: usrID (NA for error) A folder named by usrID
/upload/{usrID} file: file (provided by file uploader) String: Success or Fail Upload file to the user folder
/download/{usrID}/{fileName} APPLICATION_OCTET_STREAM Download the file from user folder
/plot/{usrID} String plotName, String color String: plotName (or NA for error). Generate an example plot with two parameters

API Tests

Server setup:

The server folder path is /home/glassfish/user-data Inside the folder, there is a test folder (or usrID): internal_test_usrdir

Test procedures

  1. Login to create the usrID:
    https://www.xialab.ca/api/login # now we assume internal_test_usrdir is the returned value
  2. Upload a file to the use folder (need to use a File Upload form in order to submit both usrID and file)
    Test here showing how to supply path (https://www.xialab.ca/api/upload/internal_test_usrdir) and file component
  3. Call R PlotTestImage function:
    https://www.xialab.ca/api/plot/internal_test_usrdir?plotName=TestPlot.png&color=red
  4. Download the image file:
    https://www.xialab.ca/api/download/internal_test_usrdir/TestPlot.png