API to get detail data for a module ID

Hello, I'm using RestAPI https://api.anaplan.com/2/0/workspaces/{workspacesID}/models/{modelID}/modules to get the list of modules available for a Budget Model.  Is there an API to get the data details or items behind the module ID?  I tried using the API to get the file details, but did not work.  /workspaces/{workspacesID}/models/{modelID}/files/{moduleID}

 

Thank in advance for your help. 

Best Answer

  • no, this endpoint doesn't exist.

    The only additional information you can get is by creating exports, which become API endpoints.

Answers

  • It is possible to get details after the model ID. Have you tried without the [modelID] after files?

  • Thanks for the response @TrentB. After files is the ModuleID, not the [modelID]. When I remove the ModuleID, I do get a list of files. Are these Files the same as Modules?
  • Sorry may have misread the question but are you trying to get all the modules in your model? If so, you can use "modules" instead of "files" as the last item in your API call.This will return the list of modules within your model with their ID and names. 

  • That's correct, I did get a list of Modules. Is there a way to pass the Module ID to get the detail data or items behind that Module? Just like I get the list of files and there's the API to get the data details for that file.
  • I do not think that has been released yet. I know this is something the Anaplan engineering team is working on to be able to get the line items, dimensions, and saved views details from the modules but the current v2.0 API does not support that to the best of my knowledge.

  • Thanks again for your input. Have a great day : )
  • Agreed with the previous answer from Nathan Rudmann. You cannot query the modules object directly to get to the module data.

     

    You need to create an export action in Anaplan from the source module. Then you post to exports to run the export action. Anaplan will then export the data to a file and you get the file.

     

    So it would look something like this:

    1. Authentice and get token

     

    2. POST https://api.anaplan.com/2/0/workspaces/{workspaceId}/models/{modelId}/exports/{exportId}/tasks

    2.1. This returns a task ID, if you want to check the status of the task you can go .../tasks/{taskid}

    2.2. Off the top of my head I think if you call an export it will also return the file id being generated when it is complete

     

    3. GET https://api.anaplan.com/2/0/workspaces/{workspaceId}/models/{modelId}/files/{fileid}

    3.2. Note step 3 is a bit lazy, if you check the Anaplan doc (https://anaplanbulkapi20.docs.apiary.io/#reference/download-files), you really want to check the number of chunks provided, and then loop and get the data chunk by chunk -get /workspaces/{workspaceId}/models/{modelId}/files/{fileId}/chunks/{chunkId}