API to List Employees

Expensify seems to have a very rich mechanism to update employees (https://integrations.expensify.com/Integration-Server/doc/employeeUpdater.html), but I cannot find a way to programmatically pull that same data down.
This is a critical function for things like sync operations or audits to verify that the settings we say we've set are as they really are in Expensify.
How can I pull a list of employees assigned to a policy, with all their details?
Thank you!
Answers
-
Hi! we are having the same problem, specially regarding account ID in order to manage mapping.
Tagging @John Schuster who has been helpful in the past!
-
Hey there, @len_devoted and @aletocar!
I recommend using the 'onFinish' element for exactly this. Using the 'onFinish' element allows you to configure the recipients list of email addresses that should receive a summary email of the changes made by the API.
Could that work?
-
Hi @John Schuster thanks! Not really.
At least in our case, we need something like The Policy Getter API to include more details on the employees themselves.
For example: account Id so as to be able to match them
-
Yeah, that doesn't help at all.
For our example, we want to be able to audit Identity and Access -- who has access to Expensify and the status of their account.
To do that, we need to be able to programmatically pull down a list of current users so that we can compare that to the directory of who should have access and flag discrepancies. We could also use this for deprovisioning accounts -- check the current list to see if UserX has an account and, if so, close it.
At present, the only way I've found to do that is to manually export a CSV of users from the Expensify GUI and then use that to compare to our directory.
But if we can download that user list from the GUI, why can't we do it programmatically over the API?
The "Get Users" SCIM-style API call is honestly one of the most basic calls out there and appears to be missing from Expensify.
-
Got it. Thanks for clarifying that, @aletocar! Have you gotten a chance to try the Policy Getter API?
It sounds like it might not be quite right either, but I figured I'd double check.
Also, when you say you'd like to see the account ID, are you referring to the Employee ID that is passed through the API request when the user is added to Expensify, or are you referring to the user's Expensify account ID?
-
Thanks @John Schuster !
Yes, the Policy Getter API is what we've been trying. However, it doesn't include the users Expensify account ID.
To be clear: the field we are trying to get is the one that can be obtained in the report exporter, through report.accountID field. That seems to be the only field that we can use to match an employee with their expenses, in case they change their email.
What do you think is the best approach?
-
Gotcha. That makes sense.
I'll need to poke around to see if that's possible. In the meantime, one option to mitigate the issue you're describing would be to disable a user's ability to change their primary login. This would block the user's ability to even change their email address away from their company email address. Could that work for you?
-
Thanks @John Schuster,
The integration we are working on is actually for multiple clients, and we cannot control that aspect.
We just want a way to get the id of every employee in a policy so that we can match them in our systems, and avoid making changes in the future.
If you find a way, let me know! Also more than happy to jump on a call with anyone.
-
If you serve an Employee ID to us via the Advanced Employee Updater, that ID would be served to Custom Field 1 in the policy. You could use that number to verify who is in the policy via the Policy Getter later.
-
This would, of course, require you to either pull their employee ID from their HR tool or assign and store one somewhere on your end. That is typically how this procedure would be handled, though.
-
Thanks @Jeremy Boniface. But is there a way to get said employee ID so as to avoid disrupting any other workflow the company might already have?
Say they have an ERP or HR integration already running, is there no way to pull the employee ID from expensify?
-
Whether or not there is an ID to pull depends on the HR integration and how the company is currently using it. It will almost always be pulled from Custom Field 1, as far as I know. I would recommend reaching out to [email protected] with the company's info so we can look into it more closely.
-
Sophie_Pinto Expensify Customer, Expensify Team, Expensify Student Ambassador Posts: 133 Expensify Team
Hi @aletocar - Jeremy essentially covered that scenario with this comment here:
If you serve an Employee ID to us via the Advanced Employee Updater, that ID would be served to Custom Field 1 in the policy. You could use that number to verify who is in the policy via the Policy Getter later.
To reiterate, you can provide the ID from your HR system or another.
-
Thanks @Jeremy Boniface and @Sophie_Pinto
The problem is we don't have access to the hr system (or other), and should get the IDs from Expensify, respecting what the customer has already used.
-
Hm, I don't understand what you mean by "respecting what the customer has already used". Where is that coming from/stored/assigned on their end?
-
@Sophie_Pinto @Jeremy Boniface
Thank you for the replies.
If you serve an Employee ID to us via the Advanced Employee Updater, that ID would be served to Custom Field 1 in the policy. You could use that number to verify who is in the policy via the Policy Getter later.
The thing is - It is not possible to leave out an Employee ID when using the Advanced Employee Updater. If you refrain from adding one, you are getting the "Missing employeeID" error.
Do you understand the loop? One has to use the Employee ID for using the Advanced Employee Updater and in order to fetch the Employee ID, one has to use the Advanced Employee Updater. Even the onFinish does not work on a "dry-run" : true scenario.
So how does one gets the Employee ID of a user with changing it?
-
Typically you would have access to the HR system so that you can pull the ID and provide it via the API. If they are already supplying the employee ID to Expensify in a custom field, you can use the policy getter to pull it from the custom field. But the employee ID is something that is supplied by the customer. We don't generate one for you.