The lookups function retrieves all major lookup fields for records (not productions). This can be useful for populating dropdown menus. We request that you make a local copy and run a periodic script to check they are up-to-date.
The lookup for table for trackers will only be supplied if a production ID is provided.
Example JSON request for this function:
{
"action": "lookups", // string
"user": "api@greenlit.org.nz", // email string
"production": "YmU9U5evebUbUjagydejU3Ehuna2a2", // string, optional
"key": "50d95141da41a5e502ada5c7da7de33d" // string, only required if production defined
"records": {}, // empty
"data": {} // empty
}Example JSON response for this function:
{
"status": "success", // or error
"error": "", // string, error message
"data": [], // empty
"actions": [], // empty
"lookups": {
"tracking": { // only present if a production is supplied
"103": "Tracker Name", // string
// ... more trackers
},
"department": {
"1": "Production", // string
// ... more departments
},
"map_record": { // see help article on api emission factors
"5": {
"iid": "5",
"category": "2", // integer, see lookup
"level_2": "Taxi", // string
"level_3": "", // string
"level_4": "", // string
"factor": "401",
"co2e": "0.224697",
"co2": "0.220883",
"ch4": "0.000295203",
"n2o": "0.00351882",
"unit": "dollars",
"unit_multiplier": null,
"scope": "3"
},
// ... more map records linking emission factors
},
"category": {
"2": "Vehicles",
// ... more categories
}
}
}