Use this recipe when an export action already exists in the model and you want to run it through the API.

You need:

  • An authentication token.
  • Access to the target workspace and model.
  • An existing export action.
  • Permission to run the export.
  • Permission to download the generated file.
  1. Authenticate.
    Request: POST https://auth.anaplan.com/token/authenticate
    Save the returned authentication token.
  2. Find the workspace
    Request: GET /workspaces
    Save the id of the workspace as workspaceId.
  3. Find the model
    Request: GET /workspaces/{workspaceId}/models
    Save the id of the model as modelId.
  4. Find the export action
    Request: GET /workspaces/{workspaceId}/models/{modelId}/exports
    Save the id of the export action as exportId.
  5. Start the export
    Request: POST /workspaces/{workspaceId}/models/{modelId}/exports/{exportId}/tasks
    Save the returned taskId.
  6. Poll the export task
    Request: GET /workspaces/{workspaceId}/models/{modelId}/exports/{exportId}/tasks/{taskId}
    Repeat this request until the export task reaches a terminal state.
  7. Find the generated file
    Request: GET /workspaces/{workspaceId}/models/{modelId}/files
    Save the id of the generated export file as fileId.
  8. List file chunks
    Request: GET /workspaces/{workspaceId}/models/{modelId}/files/{fileId}/chunks
    Use the response to identify the available chunkId values.
  9. Download each file chunk
    Request: GET /workspaces/{workspaceId}/models/{modelId}/files/{fileId}/chunks/{chunkId}
    Download each chunk. If the file has multiple chunks, combine them in chunk order.

The export action runs, creates an output file, and the integration downloads the generated file content.

If the export fails, check:

  • Whether the integration user can run the export.
  • Whether the export action still exists.
  • Whether the model is busy or unavailable.
  • Whether the export task completed successfully.
  • Whether the generated file appears in the files list.
  • Whether all file chunks were downloaded in the correct order.