Not long ago Anaplan updated their transactional API (Application Programming Interface), allowing users to read “large volume view and list” data. To qualify as “large volume” the data set should consist of at least one-million cells or list members respectively. For those familiar with Anaplan and its methods of integration, these API endpoints allow for reading data without the need for a predefined export action, similar to the reading of Anaplan module saved views. This means that no Anaplan know-how is necessary to make these API calls, so long as a user has a valid means of authentication and access to workspace and model IDs.

There are four core endpoints needed to fulfill the process of reading from a large volume view, all of which will be covered in this article.

  1. Initiate large read request
  2. Retrieve status of large read request
  3. Download pages
  4. Delete read requests

It is important to recognize however that authentication must be performed, and model metadata will need to be collected as well. These steps will be included in the final solution below.

In the Anaplan Integration API V2 Guide and Reference, endpoints are shown in curl request formatting as follows:

This simply reads as a request of type ‘GET,’ at some URI (Uniform Resource Indentifier), with both Authorization and Accept headers attached. The ‘{modelId}’ is found within your target Anaplan model, and the ‘{anaplan_auth_token}’ is found after performing basic authentication, which will be shown.

There are many ways to run and implement these API requests. For the scope of this article, I will be showing how to set up and run requests in Postman, an API testing and design platform, and how to put together a Python script which will allow for automation and reusability.

Postman

For Postman, a collection called ‘Read Large Volume’ has been set up to contain all the requests. The authorization for the collection is set to Bearer Token, and all the requests, other than the authentication request, are set to ‘Inherit auth from parent.’ For all requests, the headers may be left as Postman generates them. The authorization tab in the authorization request will be set to ‘Basic Auth’ where you will then enter your username and password. The only request which requires a body is the ‘Initiate read request.’

Variables included are:

Once you hit ‘Send,’ in the returned body, everything in quotes after “tokenValue”: will be copied and pasted into the collection’s bearer token input field:

Python

This is a basic script which can be used to automate the running of the above process. If this script is used, the global variables at the top of the script need to be adjusted to match the credentials and workspace metadata of someone with proper access. It is important to note, the code written below is not the only way to achieve the desired result. This script is available to be used as an example and a means of generating a starting point for Anaplan API integration scripts.