Home Energy Scoring‎ > ‎API Definitions‎ > ‎API Methods‎ > ‎< 2017.1‎ > ‎


Generates the label PDF file for a building. Prior to this call, the calculate_base_building, commit_results, and calculate_package_building methods must have been called, as they populate the database with the values required to generate the PDF file.
user_keyAPI key for accessstring32Yes
building_idID of buildingint
 force_regenerate If 1, PDF will be regenerated even if it already  exists.int No 0 or 1 (Default is 0)
 is_final If true, the generated label will have no  recommended upgrades.bool Yes true or false
 is_polling If true, the label will be generated  asynchronously.

 Asynchronous label generation is  deprecated: This field will be removed in  an upcoming update.
bool Yes true or false 


resultThis field is always the string "OK"
messageThis field is always the string "Label for building #<buildingId> successfully generated
fileAppears multiple times. Complex type comprising the fields below.
 file - type String. Values are "pdf" or "png". If "pdf",  this is the link to the generated label. If  "png" it is a link to a PNG version of one  page of the label.
 file - url String. The URL of the PDF or PNG file.


Error TextMeaning
 API key is not authorized You need to submit a valid API key
 No building found for building_id ##### You need to submit a valid building_id
 Building ###### - Upgrade package has not been calculated You need to call calculate_package_building for this building first

 "Building #{$buildingId} - Upgrade package has not been calculated"