The best practice would be to use our people endpoint which will provide all the user's backend IDs in your company (based on the Service user's permissions).
Once you have the service user and have added the Service user to the permissions group. We can use this endpoint to request all user's backend IDs: Search for employees
-
Also, add the display field to this endpoint, so you can match the employee's name to their backend ID which can be retrieved from this endpoint: Get all company fields
-
Another way to get the fields IDs you can use the in the Search API endpoint request body, is to generate the Employee Fields report from Analytics (available for Bob Admins)

Display name field ID: root.displayName

We need to use a Service user to use our public APIs. Please see this guide, for information on how to configure the Service user and assign it to a custom permissions group: API Service Users
For further information on custom permissions groups, please see this guide: Create a custom permission group