When a user runs an export in the API, it writes to a file that is specific to that export and user. If you execute an export (by POSTing to the .../exports/id/tasks endpoint and polling the task status) as user A then retrieve the file content as another user B then you won't receive the results of user A's export execution. If you are running and then retrieving the export as the same user, but get a different number of columns depending on the user, there could be permissions differences, but these would also be reflected when run from the UI. So lets start by looking at how exactly you are running the export through the API.
I recommend you take advantage of the MetaData APIs for Imports and Exports.
I have done the following in my implementations:
Call the MetaData REST API for a given Import
Verify the column count and column headers match my internal code
ie, My java POI excel parser is expecting header "Email, Last Name, First Name, address"
Continue processing if column count and headers match ELSE fail out with a clear error message (I show expected vs actual column headers in the log)
In my prod setup,I export data for ~10 workspaces and ~20 models via hourly batches and found the above very useful. Once a model builder changed an export in DEV and didn't relay the same to Eng Team however our DEV integration run caught it b/c of the MetaData check...I sent a nicely worded email to the model builder and it was fixed in 1 hr 🙂
You can use the API to obtain metadata for an import definition for module and list imports using the import ID. This enables you to use mappings on your imports without querying the import file itself. You can retrieve: