Identify employees most at risk of being phished
Get the Group ID
To begin, it is necessary to get the group ID. This can be done by listing all groups:
The endpoint allow a set of query parameters to filter and paginate the results:
- the base URL:
https://api.arsen.co - the route:
groups
curl --request GET \ --url 'https://api.arsen.co/v1/groups?filter[name]=$eq:sales' \ --header 'x-api-key: <<AUTH_TOKEN>>' \ --header 'Content-Type: application/json'import axios from 'axios';
const options = { method: 'GET', url: 'https://api.arsen.co/v1/groups', params: { 'filter[name]': '$eq:sales' }, headers: { 'Content-Type': 'application/json', 'x-api-key': '<<AUTH_TOKEN>>' }};
try { const { data } = await axios.request(options); console.log(data);} catch (error) { console.error(error);}import requests
url = "https://api.arsen.co/v1/groups"
querystring = {"filter[name]":"$eq:sales"}
headers = { "Content-Type": "application/json" "x-api-key": "<<AUTH_TOKEN>>"}
response = requests.get(url, headers=headers, params=querystring)
print(response.json())The result should be like the following example:
{ "status": "success", "pagination": { "totalItems": 1, "totalPages": 1, "currentPage": 1, "itemsPerPage": 100, "nextPage": null, "prevPage": null }, "data": { "groups": [ { "id": "jkP6Bcn40dARdfyeXfFj", "name": "sales", "type": "standard", "score": 49, "employeeCount": 93, "identityDirectory": null, "createdAt": "2023-11-14T14:51:25.994Z" } ] }}The response provides the group and its ID.
Get the Employees
The next step is to list the employees in this group. Sorting by score and applying a result limit will ensure only the desired data is returned.
The endpoint also has options for retrieving results
- the base URL:
https://api.arsen.co - the route:
employees
curl --request GET \ --url 'https://api.arsen.co/v1/employees?filter[groupIds]=$eq:4p6pCZXocEPONBGnGQFm&sort[score]=asc&filter[language]=$eq:it&limit=5&page=1' \ --header 'x-api-key: <<AUTH_TOKEN>>' \ --header 'Content-Type: application/json'import axios from 'axios';
const options = { method: 'GET', url: 'https://api.arsen.co/v1/employees', params: { 'filter[groupIds]': '$eq:4p6pCZXocEPONBGnGQFm', 'sort[score]': 'asc', 'filter[language]': '$eq:it', limit: 5, page: 1 }, headers: { 'Content-Type': 'application/json', 'x-api-key': '<<AUTH_TOKEN>>' }};
try { const { data } = await axios.request(options); console.log(data);} catch (error) { console.error(error);}import requests
url = "https://api.arsen.co/v1/employees"
querystring = {"filter[groupIds]":"$eq:4p6pCZXocEPONBGnGQFm","sort[score]":"asc","filter[language]":"$eq:it","limit":"5","page":"1"}
headers = { "Content-Type": "application/json" "x-api-key": "<<AUTH_TOKEN>>"}
response = requests.get(url, headers=headers, params=querystring)
print(response.json())The response provides a list of employees retrieved based on the criteria.
{ "status": "success", "pagination": { "totalItems": 639, "totalPages": 64, "currentPage": 1, "itemsPerPage": 100, "nextPage": null, "prevPage": null }, "data": { "employees": [ { "id": "g42nJVcl28Nh7ywhABn9", "firstName": "Rebecca", "lastName": "Starling", "language": "it", "score": 12, "identityDirectory": "microsoft", "groupIds": ["jkP6Bcn40dARdfyeXfFj", "fIzKBgn4EdzRd7yrx9d2"], "createdAt": "2023-02-04T14:51:25.997Z" } // ... ] }}