The app_details function retrieves information about what permissions your App has within the API. This is useful for checking whether functions are available along with your write/view permissions on records.
Example JSON request for this function:
{ "action": "app_details", // string "user": "apitest@greenlit.org.nz", // email string "production": "", // empty "key": "", // empty "records": {}, // empty "data": {} // empty }
Example JSON response for this function:
{ "status": "success", // or error "error": "", // error message string "app_details": { "iid": "1", // integer "slug": "testapp", // string "idesc": "The Test App", // string "map_used": "2", // integer "active": "1", // boolean "counter": "226", // integer "view_all_records": "1", // boolean "write_all_records": "0", // boolean "fn_app_details": "1", // boolean "fn_user_productions": "1", // boolean "fn_lookups": "1", // boolean "fn_read_all": "1", // boolean "fn_create": "1", // boolean "fn_update": "1", // boolean "fn_read": "1", // boolean "fn_delete": "1" // boolean } }
The important returned fields are:
iid, slug and idesc
These are your App ID, username and a pretty name for your App respectively.
map_used
This is the map used to map your emissions factors. See mapping.
active
Whether your App is active, or whether access has been turned off. This will always be true for you, as you won't be able to make this request without it being active.
counter
The number of successful Api calls your App has made. The use of app_details is not included in this counter.
view_all_records and write_all_records
These indicate whether you have view or write permission on records other than the ones created by your App. The default is view_all_records = 1; write_all_records = 0.
If one of these is false, you will only be able to interact in that capacity with records your App has created.
fn_{function name}
These fields indicate whether your App has access or not to specific functions.