Incorrect/Unclear Documentation for reportFields.data.[].values in Policy Updater

matthewpoermatthewpoer Posts: 15Expensify Customer Expensify Newcomer

The documentation for the API's Policy Updater functionality needs correction and adjustment in regards to specifying the values for a new dropdown-type report field.

API Documentation: https://integrations.expensify.com/Integration-Server/doc/#policy-updater

There are two curl examples for policy-updater that demonstrate the creation of dropdown-type custom report fields (reportFields) with pre-defined values. The first shows the values referenced as strings, which works great.

e.g. https://gist.github.com/matthewpoer/87b39b0339f3b4a346fff51a2076839c#file-working-sh

The other examples show the values specified as JSON Objects. The documentation describes and shows these JSON Objects with the keys value, externalId and enabled. I cannot get this method to work. In fact, when I copy-and-paste the example from the sidebar into my console (replacing the credentials and policy ID reference), it doesn't appear to be valid JSON.

e.g. https://gist.github.com/matthewpoer/87b39b0339f3b4a346fff51a2076839c#file-notworking-badjson-sh

The JSON is valid once I adjust the closing tags.

e.g. https://gist.github.com/matthewpoer/87b39b0339f3b4a346fff51a2076839c#file-notworking-fixedjson-sh

The API consistently returns this error message when I attempt the JSON Objects way:

{"responseMessage":"Value at index 0 for report field at index 0 is invalid","responseCode":410}

I'm not sure I understand the need/use case for using JSON Objects at all, so my recommendation would be to remove this second example and adjust the documentation to list reportFields.data.[].values an array of strings.

Thanks!

Answers

Sign In or Register to comment.