API report list based on user email

Hi there,
I am calling expensify Report Export api service with the the company account's credential. Instead of fetching all the transactions in the exported report, i only need to get the list based on a given user email address. However i am getting error message "Not authorized to authenticate as user". Any help?
Answers
-
Ted Harris Expensify Success Coach - Admin, Expensify Team, Expensify Student Ambassador Posts: 359 Expensify Team
Hi @jeff_klick, thanks for posting in the Expensify Community! It's so great to have more people asking and answering API questions in here.
Without seeing the specific query, it's difficult to determine exactly where this is going wrong. However, it's likely a misconfiguration of the
employeeEmail
string in theinputSettings
. For reference, you cannot determine individual's employees to export, you can only specify the Status (ie:APPROVED
,REIMBURSED
etc) and theinputSettings.filters
.The
employeeEmail
field is simply used to configure which user we determine to have performed the Report Export, rather than the user who's reports are the subject of the export. -
Thanks for the rely @Ted_Peeters
This is the requestJobDescription I am using in C#.type = "file",
credentials = new
{
partnerUserID = {myUserID},
partnerUserSecret = {myUserSecret}
},
onReceive = new
{
immediateResponse = new[] { "returnRandomFileName" }
},
inputSettings = new
{
type = "combinedReportData",
reportState = "ARCHIVED",
employeeEmail = {targetUserEmail},
filters = new
{
startDate = lastRun.ToString("yyyy-MM-dd"),
markedAsExported = importedTag
}
},
outputSettings = new
{
fileExtension = "json"
},
test = true,
onFinish = new[] {
new {
actionName = "markAsExported",
label = importedTag
}
}The reason I want to export the report by a single user email is to speed up the request and let each user to sync their expensify items in our platform. Where should i put the filter
employeeEmail
in the request? -
Ted Harris Expensify Success Coach - Admin, Expensify Team, Expensify Student Ambassador Posts: 359 Expensify Team
Hiya @jeff_klick, apologies if I wasn't clear enough!
The
employeeEmail
string is listed ininputSettings
but it is not a filter. You'll note it's not listed with the remainder of theinputSettings.filters
here.You cannot use the Report Exporter API to filter on an individual's reports. This will have to be done outside of the Report Exporter API, most often as a manual spreadsheet filter.
When we state in the Description column that:
The reports will be exported from that account.
This means we use the owner of the account listed for
employeeEmail
to audit who performed the export. The export is exported from that account rather than The export contains only reports from that account.If you'd like to make use of this field, you'll need to follow the steps here to reach out for verification you can act on behalf of others on your Domain/Policy.
-
I took a look at the notes in https://community.expensify.com/discussion/comment/4596/#Comment_4596
- Make sure you're set up correctly, (using Domain Control, are a Domain Admin, are a Policy Admin etc...)
- Validate you are authorized internally to add data to other accounts on your domain.
Pretty sure i did the 1st part. Not quite sure how to set up the 2nd one. Any suggestion?