Hi,
Can we export data from anaplan and directly load into other tool via Rest API, without exporting csv or text file.
@Vicky_Kapri using Anaplan Rest API we can't, but if that tool supports some APIs, we can create our own APIs by combining Anaplan APIs and tool APIs we can load.
can we do it with Postman?
we are using Postman only to call rest API to interact with Anaplan and automate the tasks.
what tools we can use to integrate with anaplan?
https://help.anaplan.com/third-party-data-integration-0e2e7180-3a87-4899-afed-6da6a98cb470 Hope this helps you
@Vicky_Kapri I am working on a similar problem currently, using Python. Postman won't be the right tool for it as @SriNitya mentioned it only send requests to interact with Anaplan to automate tasks. Whereas using python we could get the exported csv into the script in form of DataFrames [Tabular Format] (using Pandas Library) without explicitly downloading the file on the system. Now this DataFrame can be shared using the tool's API by converting it to a csv variable within Python. Sharing the code below:
export_action_url = f"{base_url}/exports/{export_id}/tasks" response = requests.post(export_action_url, headers=headers,data=json.dumps({'localeName': 'en_US'})) response_json=response.json() # Check if the export action started successfully print(response_json) if response.status_code == 200: task_id = response_json["task"]["taskId"] print(f"Export action started successfully. Task ID: {task_id}") # Pull the status of the export action task_status_url = f"{export_action_url}/{task_id}" while True: response = requests.get(task_status_url, headers=headers,data=json.dumps({'localeName': 'en_US'})) response_json=response.json() print(response_json) task_status = response_json["task"]["taskState"] if task_status == "COMPLETE": print("Export action completed successfully.") break elif task_status == "FAILED": print("Export action failed.") break else: print(f"Failed to start the export action. Status code: {response.status_code}. Response: {response.text}") # Retrieve the exported data export_data_url = f"{base_url}/files/{file_id}" response = requests.get(export_data_url, headers=headers) if response.status_code == 200: file_data = response.content print("File retrived") else: print(f"Failed to retrieve the file data. Status code: {response.status_code}. Response: {response.text}") #Get the File from Anaplan file=pd.read_csv(io.StringIO(file_data.decode('utf-8')))
export_action_url = f"{base_url}/exports/{export_id}/tasks"
response = requests.post(export_action_url, headers=headers,data=json.dumps({'localeName': 'en_US'}))
response_json=response.json()
# Check if the export action started successfully
print(response_json)
if response.status_code == 200:
task_id = response_json["task"]["taskId"]
print(f"Export action started successfully. Task ID: {task_id}")
# Pull the status of the export action
task_status_url = f"{export_action_url}/{task_id}"
while True:
response = requests.get(task_status_url, headers=headers,data=json.dumps({'localeName': 'en_US'}))
task_status = response_json["task"]["taskState"]
if task_status == "COMPLETE":
print("Export action completed successfully.")
break
elif task_status == "FAILED":
print("Export action failed.")
else:
print(f"Failed to start the export action. Status code: {response.status_code}. Response: {response.text}")
# Retrieve the exported data
export_data_url = f"{base_url}/files/{file_id}"
response = requests.get(export_data_url, headers=headers)
file_data = response.content
print("File retrived")
print(f"Failed to retrieve the file data. Status code: {response.status_code}. Response: {response.text}")
#Get the File from Anaplan
file=pd.read_csv(io.StringIO(file_data.decode('utf-8')))
base_url : f"https://api.anaplan.com/2/0/workspaces/{workspaceID}/models/{modelID}" export_id, file_id : You can get this information from Anaplan In the end the "file" variable will hold your data as DataFrame without downloading it to the system. But you would require saving this script in some system which could run this script.
@Vicky_Kapri This article gives detailed information about multiple integration options with Anaplan.
Hi ALL, I have a module where a line item (Assignments column) is formatted by a large ‘Projects’ list. Each record is assigned to a Project and this module is published to a UX page. When users apply a filter on the Assignments column, the filter dropdown displays the entire Projects list (since the column is…
Hi ALL, In my model, I have Need stored at a 'D3' RS Group level. I need to use this Need in another module at the G5 Location level. I currently have a mapping module where each G5 Location maps to a D3 RS Group. This Module uses D2 Role as dimension. but the line item I've to find the RS Group (Find D3 RS Group = 'FIND…
I couldn't find any formula to do this, but I want a way to put on the page/grid the connection details. This is so I know what connection I'm in rather than going into Connections details to see it. Is there an XL3 formula to return this value?