Description
This api endpoint gives a summary of the positions - roles & departments - for an office.
Back-end
This is a REST api endpoint. It uses elasticsearch and aggregates to obtain doc_count for the particular role and department.
Front-end
The endpoint is a rest api endpoint. The roles and departments are ids which can be resolved by calling the constants query with type_id - role & department. Please do note that the roles bucket will have office_id along with it and the immediate child offices will also be returned. eg: For an MC, all its LCs will be returned, AI will have Regions returned and Regions will have MCs returned.
Sample request - http://localhost:8000/v2/applications/analyze.json?access_token=<access_token>&position%5Boffice_id%5D=<office_id>
GET /v2/applications/analyze.json
Request
position[office_id] - Integer
Response
{
"analytics": {
"roles": {
"after_key": {
"role": 11647,
"office": "1585"
},
"buckets": [
{
"key": {
"role": 11645,
"office": "1585"
},
"doc_count": 2
},
{
"key": {
"role": 11646,
"office": "1585"
},
"doc_count": 22
},
{
"key": {
"role": 11647,
"office": "1585"
},
"doc_count": 44
}
]
},
"departments": {
"doc_count": 227,
"deparments": {
"doc_count_error_upper_bound": 0,
"sum_other_doc_count": 0,
"buckets": [
{
"key": 11627,
"doc_count": 20
},
{
"key": 11628,
"doc_count": 20
},
{
"key": 11629,
"doc_count": 20
},
{
"key": 11630,
"doc_count": 20
},
{
"key": 11631,
"doc_count": 20
},
{
"key": 11632,
"doc_count": 20
},
{
"key": 11633,
"doc_count": 20
},
{
"key": 11634,
"doc_count": 20
},
{
"key": 11635,
"doc_count": 20
},
{
"key": 11636,
"doc_count": 20
},
{
"key": 11637,
"doc_count": 20
},
{
"key": 11638,
"doc_count": 7
}
]
}
}
}
}