PVComplete - API Service
Installation instructions.
This guideline will help you install PVComplete API server and DB on your local servers.

Database setup
Prerequisites:
  • MySQL Server version 5.6

Installation instruction:
  1. Download and install MySQL server version 5.6 from mysql community website. Make standard server configuration. No special configuring is required.
  2. Download and unpack PVComplete Database snapshot from our server: PVCompelte DB snapshot
  3. Create empty schema and import PVComplete DB snapshot

API Server setup
Minimal prerequisites:
  • Windows server 2008 R2 with .NET version 4.0 and IIS minimal version 7.0
  • Minimal 2 GB of RAM

Installation instruction:
  1. Download and unpack API server binaries API Server binaries (v 1.2.10)
  2. Under IIS manager create new integrated application pool for .net 4.0 framework. NOTE: make sure API.NET 4.0 is registered under your IIS. If not register ASP.net v4.0 using aspnet_regiis command
  3. Add new application and name it "APIService". Make sure that application is using the pool you have created in the previous step. The physical path of the virtual folder should point to the place where you have extracted APIService binaries.
  4. Configuration file changes. Go to the folder where you have unpacked APIService and locate web.config file, open it and make the following changes: find DB connection string settings (line 21) and change connection string so that it would point to database and database server where you have restored PVComeplete DB (check previous section).
  5. Reset iis by running "iisreset" command in command promt under administrator privileges
You can test that your configuration is running by accessing API service help page: http://localhost/APIService/Help/ and running one of API service REST calls using any REST client.
Documentation.
Detailed API documentation is available by this link PVComplete DB api help
API operations brief description
Get all inverters
Method: GET
Description: This operation returns the list of all available inverters.
Get inverter by id
Method: GET
Description: This operation returns inverter data with provided ID.
Get inverter lookup
Method: GET
Description: This operation returns list of inverter IDs and Names grouped by manufacturer. Parameter enteredBy is optional and can be set to return additional inverters for specified user.
Add new inverter
Method: PUT
Description: This operation inserts new inverter into database.
Get all pvmodules
Method: GET
Description: This operation returns the list of all available pvmodules.
Get pvmodule by id
Method: GET
Description: This operation returns pvmodule data with provided ID.
Get pvmodule lookup
Method: GET
Description: This operation returns list of pvmodule IDs and Names grouped by manufacturer. Parameter enteredBy is optional and can be set to return additional pvmodules for specified user.
Add new pvmodule
Method: PUT
Description: This operation inserts new pvmodule into database.
Get all manufacturers
Method: GET
Description: This operation returns the list of all available manufacturers.
Generate pvmodule layout by project
Method: POST
Description: This operation recieves Layout Control project from GetProject with few additional parameters and returns same project but with generated module layout for specified Roof.
POST request data example:
{
 "Project": {
  "latitude": 37.59468726568874,
  "longitude": -122.4132813597098,
  "measurementSystem": 3,
  "PVSystems": [{
    "PVArrays": [{
      "tilt": "0",
      "roofIndex": 1,
      "azimuth": 214,
      "moduleLayout": {
       "moduleSpaces": []
      }
     }]
   }],
  "roofs": [{
    "index": 1,
    "name": "Roof 1",
    "description": "",
    "meanHeight": 0,
    "parapetWall": false,
    "parapetWallHeight": 0,
    "setback": 0,
    "roofFaces": [{
      "polygon2dLocal": {
       "vertices": [{
         "x": -122.41315077524632,
         "y": 37.59471240840254
        }, {
         "x": -122.41328488569707,
         "y": 37.59464015029437
        }, {
         "x": -122.41324331145734,
         "y": 37.59459977073274
        }, {
         "x": -122.41311456542462,
         "y": 37.5946699036415
        }]
      },
      "name": "",
      "azimuth": 214,
      "slope": 0,
      "area": 80.66726580096766
     }],
    "obstructions": [],
    "installationAreas": []
   }],
  "obstructions": [],
  "installationareas": []
 },
 "Roofname": "Roof 1",
 "ModuleId": 1,
 "EastWestSpacing": "3.41207",
 "RowSpacing": "8.0052",
 "Orientation": "0",
 "ModuleTilt": "0"
}
POST data parameters description:
  • ModuleID (mandatory) - PVModule ID from DB
  • EastWestSpacing (mandatory) - East-West panel spacing
  • RowSpacing (mandatory) - North-to-North spacing between panels
  • ShadowTimeInterval (optional) - Solar positions by hour
  •    - 0: 6am to 6pm
       - 1: 7am to 5pm
       - 2: 8am to 4pm
       - 3: 9am to 3pm
       - 4: 10am to 2pm
       - 5: 11am to 1pm
  • ShadowSolarPosition (optional) - Astronomical event
  •    - 1: Summer Solstice
       - 2: Equinox
       - 3: Winter Solstice
  • Project (mandatory) - Standard layout control project
  • Roofname (optional) - Roof name to generate layout on
  • InstallAreaName (optional) - Installation Area name to generate layout on
  • Orientation (mandatory) - PVModules orientation on Roof
  •    - 0: Portrait
       - 1: Landscape
  • ModuleTilt (mandatory) - PVModules tilt on Roof
Specify Roof name to generate layout:
Specify Installation Area name to generate layout:
Row spacing (in project measurement system):
East-West spacing (in project measurement system):
Module ID:
Project (insert your project here):
Service Output (Project with modules):