How do I get Policy Info using an API?

viswaisteerviswaisteer Expensify Customer Posts: 2

Hi Support team

I have a task where I create/update employee in expensify and assign him to a given policy. After successful creation/updation,I need to check whether that employee's manager also assigned to that policy if not he also need to be assigned to that policy with a auditor.

Example:

Tasks are

  1. Create Emp A and assign with Policy '1A' and manager B.
  2. Check whether manager B has already assigned with Policy '1A' if not assign with Policy '1A'

I have completed the task 1. But for task 2 I need an API which which helps either to fetch Manager's existing policy details based on manager email or fetch employee details associated with an policy id.


I have tried Policy getter and policy getter and policy list getter but both didnt give the expected response.

Policy getter: Gives only tax details in below response only for the admin email.

Policy List Getter: Gives only policyList": [{
        "outputCurrency": "USD",
        "owner": "<<>>",
        "role": "<<>>",
        "name": "<<>>",
        "id": "<<>>",
        "type": "<<>>"


If I give other employee email Im getting below response.

{"responseMessage":"Not authorized to authenticate as user [email protected]","responseCode":401}


Can someone help or advise for above scenario?


Regards

Viswa

Answers

Sign In or Register to comment.