Using API to get transaction report csv

Hi,
I have called the API and I correctly receive an email with a link to the csv report. However, my goal is to integrate clients expensify transactions with my accounting software and so I was hoping that the link the email would take me straight to the transactions, but instead I need to login to the client account. Is there anyway (perhaps by supplying api key to the download url) that I could follow the link and get the transactions without logging into the account?
Answers
-
Hey @andyp888 via the API that's possible, but you need to use the Downloader job to retrieve that file.
So, that process will be:
1. Use the ReportExporter job to define the contents of the export
2. We'll respond with the file name
3. Via the Download job, send back that file, and you'll be able to get that fileMake sense?
-
Hi Conor, thanks for this information - what I don't see is how I get the file from the download job - is it returned as binary, or can I specify an email address for it to be attached or what?
curl -X POST 'https://integrations.expensify.com/Integration-Server/ExpensifyIntegrations' \
-d 'requestJobDescription={
"type":"download",
"credentials":{
"partnerUserID":"REPLACE",
"partnerUserSecret":"REPLACE"
},
"fileName":"myFile.csv"
}' -
Hi again Conor - I tried the download job call and note it returns a format that doesnt look like csv:
%3C%23if+addHeader+%3D%3D+true%3E%0D%0A++++Merchant%2CAmount%2CCategory%2CReport+number%2CExpense+number%3C%23lt%3E%0D%0A%3C%2F%23if%3E%0D%0A%3C%23assign+reportNumber+%3D+1%3E%0D%0A%3C%23assign+expenseNumber+%3D+1%3E%0D%0A%3C%23list+reports+as+report%3E%0D%0A++++%3C%23list+report.transactionList+as+expense%3E%0D%0A++++++++%24%7Bexpense.merchant%7D%2C%3C%23t%3E%0D%0A++++++++%24%7Bexpense.amount%7D%2C%3C%23t%3E%0D%0A++++++++%24%7Bexpense.category%7D%2C%3C%23t%3E%0D%0A++++++++%24%7BreportNumber%7D%2C%3C%23t%3E%0D%0A++++++++%24%7BexpenseNumber%7D%3C%23lt%3E%0D%0A++++++++%3C%23assign+expenseNumber+%3D+expenseNumber+%2B+1%3E%0D%0A++++%3C%2F%23list%3E%0D%0A++++%3C%23assign+reportNumber+%3D+reportNumber+%2B+1%3E%0D%0A%3C%2F%23list%3E
Any idea where I have went wrong here?
-
So, the above looks like an encoded template file, but how do i get access to the client csv?
-
Hi Conor, This is regarding your comment above to use the Download job. I do not want an email to be sent. In this case how can i retrieve the file name so i can send to the download job.
Thanks