Hi,
While trying with Anaplan API GET method to export data from model, I am getting inconsistent response.
i. I was getting 9 columns earlier based on which we designed our database schema, now I am getting 8 columns in response.
ii. While trying with another user, I am getting all 9 columns in response.
iii. If I run export from UI, I am getting 9 columns in response.
iv. For 1 file id, I get chunk size as 29 for my user while for other user id I get chunk size as 0.
Can you please help to understand this behavior?
Thanks
Solved! Go to Solution.
@ben_speight Can you please help @rajanirath
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.
Hi,
The API respects the user rights. from what you explain, the user running the API might not have all the
access. Try running the API calls with the users you use for the GUI.
These columns, are they a list ? My guess is that list has selective access enabled.
Hi,
The response is in CSV format.I have verified that with my ID in gui I am getting all the columns in downloaded file. Its when I do API call, I see 1 column missing.
With user2, I see all the columns in GUI and API response as well.
Let me know if want me to provide any additional detail
I recommend you take advantage of the MetaData APIs for Imports and Exports.
I have done the following in my implementations:
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 🙂
See here https://anaplanbulkapi20.docs.apiary.io/#reference/import
Get the metadata for an import definition
/workspaces/{workspaceID}/models/{modelID}/imports/{importID}
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:
Name
Type
Source
Column Count