API Examples

Where can I find API examples / flow that actually seem to work? Examples do not seem to be operationally correct (yes I replaced the user name and secret...).
I am trying to integrate expensify with an internal system. Is there a sandbox somewhere?
All help would be appreaciated.
Answers
-
Sheena Trepanier Expensify Team, Approved! Accountant, Expensify Student Ambassador Posts: 1,362 Expensify Team
Hi @tincup, it would be easier to provide resources and direct you if you can share some more details about the call you're using and what you're trying to achieve.
We look forward to hearing back from you!
-
Thanks for the response. I would like to use the integration end point to pull our data from expensify. I would expect the examples given on referenced page to actually work for example (after replacing the UserID and UserSecret) the post below
curl -X POST 'https://integrations.expensify.com/Integration-Server/ExpensifyIntegrations' \ -d 'requestJobDescription={ "type":"...", "credentials":{ "partnerUserID":"_REPLACE_", "partnerUserSecret":"_REPLACE_" }, "inputSettings":{ ... } }'
returns a 500 with invalid requestJobDescription. Any help in explaining the workflow and actual payloads would be appreciated. From what I can piece together - I cannot expect a typical JSON payload, but have to request and download a report? (who does this today??). All help / explanation is appreciated.
-
I'm also in same situation. I'm using Postman App to Get data from provided APIs but not sure how to use userId and Secret Password. What is the Auth. Type we need to select?
Thanks
-
Why is it so difficult to send a example successful call? I understand the call is incomplete and hence the source of the question. I understand the API is antiquated and a self service tool (by definition all APIs are self service). Please help be understand what I am missing? I the time I have been experimenting with this API - I have completed two others (REST based).
-
@Nicole Trepanier I'm using above syntax, couple of questions.
- What is PolicyIDList? is it Id for Tag? if yes how I can get it?
- when I run this script I get following Response:
- {"responseMessage":"Export type 'policy' not supported.","responseCode":404}
-
@Nicole Trepanier Here is another example i took from you documentation with response. Nothing complex
{"responseMessage":"Export type 'policyList' not supported.","responseCode":404}
I got this working.
-
@Nicole Trepanier What is PolicyID? I can't find it. i even ask tsupport but no response.
-
@Nicole Trepanier Below file export doesnt work. I agree with @tincup a working exple will go a long way.
Getting this error.
https://integrations.expensify.com/Integration-Server/ExpensifyIntegrations invc@expensify_template.ftl is not a valid HTTP or HTTPS URL. Please ensure your URL starts with http:// or https://
Thanks
-
Hi @sbismil,
Please make sure to use the doc samples from the correct section, and only update the fields that are said to be valid in the center section of the page.
For example, the following snippet you posted is not valid, because
inputSettings.type: policyList
cannot be used in conjunction withtype: file
.{ "type": "file", ... "inputSettings": { "type": "policyList", ... } }
To clarify, the parent type
file
can only be used to export expense and report data — not policy information.If you want to export policy data (e.g. categories, tags), you will need to use the
get
type, withinputSetings.type
set topolicy
.In your last post, the error you got was returned by
curl
itself, and occurred because you're missing a backslash before the last line break - so your shell might consider the last line as a new command.In addition, the parameter name
invc
is not recognized by our API, and you'll need to replace withtemplate
:-d 'requestJobDescription={ ... }' \ --data-urlencode 'template@expensify_template.ftl'
For more information on passing parameters with
curl
, I recommend you read curl's official documentation. -
@Francois Thank for your detailed response. I was able to make changes and make script work. I have another issue with file it self. I was able to get link via email and download template file but I'm not getting any data in the file only headers. any Idea I'm missing something. I'm using above script and changing date range to 2019-01-01 to 2019-08-31. I do have quite a few reports in expensify. Thanks
-
@sbismil Can you attach the file you received?
-
-
@sbismil Hmmm. Can you send us the full request as well?
-
@Nicole Trepanier Please see below.
"onReceive":{
"immediateResponse":["returnRandomFileName"]
},
"inputSettings":{
"type":"combinedReportData",
"reportState":"REIMBURSED",
"limit":"10",
"filters":{
"startDate":"2019-01-01",
"endDate":"2019-09-23",
"markedAsExported":"Expensify Export"
}
},
"outputSettings":{
"fileExtension":"xlsx",
"fileBasename":"ExpenseReport"
},
"onFinish":[
{"actionName":"markAsExported","label":"Expensify Export"},
{"actionName":"email","recipients":[email protected]", "message":"Report is ready."}
]
}
-
Hi,
Are the reports in your account reimbursed? I'd recommend you remove the line:
"reportState":"REIMBURSED"
from the payload, so that all reports get included.
-
I wrote a guide on going from 0 to successful call here, if you find it useful: https://community.expensify.com/discussion/5267/how-to-zero-to-hero-in-postman-with-you-first-report-retrieval/p1?new=1
-
I am trying to understand a few things here and cannot get my head around the syntax of the API call to create a user in Expensify via API. I also cannot understand how to update an attribute for a user for an active user.
It would be great to see an example in the code of the API call to create a user and not just get pointed to documentation. Please can someone show this here on how to create and maybe also another example of how to update an existing users policy they are assigned?
Best,
-
How do I add user to a policy via api?
-
@m83nyc info on creating policies is under Create > Policy Creator section
-
I am just trying to invite a user to an existing policy. This is the way?
-
@m83nyc this lives under the Update section. You should find info on adding, updating, and removing employees via the API there
-
I got this all to work thank you! now my question is how do I get groups and add someone to groups is there a key for this in the data -d param I can add?
-
Christina Dobryzynski Expensify Success Coach - Admin, Expensify Team, Expensify Student Ambassador Posts: 268 Expensify Team
Happy everything is coming together @m83nyc! There isn't a method to manipulate Domain Groups via the API from what I can find. However, we have the option of setting a preferred policy for domain groups. Let me know if you have any questions!
-
Hi @Christina Dobryzynski, is this still the case (that you can't set domain groups via the API)? The Advanced Employee Updater API page specifically states:
- Assign employees to Expensify domain groups based on customizable fields, such as employee department, country, job code, etc.
-
Ted Harris Expensify Success Coach - Admin, Expensify Team, Expensify Student Ambassador Posts: 359 Expensify Team
@CampbellG - correct, you cannot create domain groups, only assign users to them.
-
@Ted Harris - are you able to point to documentation or give examples of how to assign users to groups? This is what I need to do. The domain groups are already created. Thanks.
-
@CampbellG Are you asking for how to do this via the API or in-product? If you're looking to do this in-product, you can check out this Help Document on Editing and Managing groups here. If this relates to the API, let me know and I can take another look.
Thanks!
-
@Zany Renney Via the API. Definitely don't want to be doing this manually for 250+ users!