Question regarding Expensify expenses report error
Hey all, going to keep it as short but informative as possible.
I'm trying to export a report via the API but I'm getting auth issues. We know it's not actually auth issues because using the same creds we've been able to make an expense correctly using the API. What do you think the error could be? We've taken the example from the API documentation page and tweaked it slightly for our own uses, but no dice.
We think it's the do with the template that we're passing, the reason being is because if we remove the template, we get an error saying "we haven't included the template" which make sense. We know the report is incorrect, we just want to make sure the connects are correct. I'll include some examples. Any help or insights would be greatly appreciated.
Example of Request:
{
requestJobDescription: {
"type":"file",
"credentials":{
"partnerUserID":"REDACTED",
"partnerUserSecret":"REDACTED"
},
"onReceive":{
"immediateResponse":"test"
},
"inputSettings":{
"type":"combinedReportData",
"reportState":"APPROVED,REIMBURSED",
"filters":{
"startDate":"2020-01-08",
"endDate":"2020-02-08",
"markedAsExported":"Expensify Export"
}
},
"outputSettings":{
"fileExtension":"csv",
"fileBasename":"myExport"
}
},
"template": "<#if addHeader == true>\n attendees.email<#lt>\n</#if>"
}
Answers
-
Hi @Convex ,
I replaced in my api request template with "<#if addHeader == true>\n attendees.email<#lt>\n</#if>" and it works fine, the result is: "attendees.email" without auth issue.
Best Regards,
Edward
-
@Z1abl what was your body for the request though? We're still getting auth issues despite using the same template you posted. We tried the authentication tokens again with creating an expense and it works - so I'm curious to see what you're sending for the
requestJobDescription
key. Cheers -
@georgegilliland , sure:
{
"type": "file",
"credentials": {
"partnerUserID": userId,
"partnerUserSecret": secret
},
"onReceive": {
"immediateResponse": [
"returnRandomFileName"
]
},
"inputSettings": {
"type": "combinedReportData",
"filters": {
"startDate": "2010-01-01"
}
},
"outputSettings": {
"fileExtension": "csv"
}
}
-
Hi @Convex - could you post the exact response you got? That could help narrow down what's causing the error.
One thing to check - are the partner credentials you are using associated with a Policy Admin for the policy you are exporting reports out of?
-
Thanks for the help all, but we narrowed down the problem to an incorrect key and got it sorted.
-
Matt Moore Expensify Customer, Expensify Success Coach - Admin, Expensify Team, Expensify Student Ambassador Posts: 132 Expensify Team
Awesome! Let us know if you need anything else.