Home Energy Scoring‎ > ‎API Definitions‎ > ‎API Methods‎ > ‎2017.2‎ > ‎

generate_custom_label

Similar to generate_label, except that whereas generate_label relies on an upgrade package building that is generated automatically by a call to calculate_package_building, this method instead allows the user to supply a second building that will be treated as the upgrade package building.  For example, to generate a label that shows the energy efficiency gain from upgrading just a home's windows, a user could submit the home's current state, then create a second building representing the same home but with the windows upgraded.  By passing the first home to base_building_id and the second as custom_building_id, a label would be generated showing the difference. 

Parameters

NameDescriptionTypeRequiredOptions
 session_token Get from the get_session_token methodstringYes 
user_keyAPI key for accessstringYes
 base_building_id ID of building to use as the base - this should be a definition of the home as it currently is intYes 
 custom_building_id ID of building to use as upgrade package - this should be a definition of the home with whatever upgrades you would like to recommend int Yes 
 force_regenerate Pass 1 to force the label to be regenerated. This is mostly used for HES internal development, but it can be useful if an update has resulted in a change in how labels are rendered and you wish to re-render a label to take advantage of that change. int No 0 or 1 (treated as 0 if not passed)



Response

ElementDescription
resultFAIL or OK
 message Error or success message depending on result
 file On success, a series of file elements will be returned. The first contains the URL of the PDF file. The others contain PNG images of each page of the label. 



Roles

Method access is limited by the roles assigned the user to whom the session token was assigned

RoleAccess
AssessorMust be the assessor who created both buildings
PartnerNo access
 Admin Allowed to generate label for any buildings