Getting an error when trying to run an Import Action using Python3
Hi,
I’m new to Anaplan and am trying to automate the process of refreshing data from a file that has been previously uploaded and imported to a module.
I’m referring to the Apiary and this github repo https://github.com/cdhippen/Anaplan-Python3-Scripts/blob/master/Action%20scripts/action.py
I’ve created a certificate file and am able to connect to Anaplan and do things like getting a list of all workspaces, models, files, actions, etc. However, I get an error (404) when I try to run the action of importing a file. Following is the code snippet:
url = (f'https://api.anaplan.com/1/3/workspaces/{wGuid}/models/{mGuid}/' +
f'actions/{file_id}/tasks')
print(url)
action = requests.post(url, data='{"localeName": "en_US"}', headers=postHeaders)
print('Action status code: ' + str(action.status_code))
with open('postAction.json', 'wb') as f:
f.write(action.text.encode('utf-8'))
Following is the response returned b yAnaplan:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>Anaplan</title>
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="viewport" content="width = 960">
<link rel="shortcut icon" href="lib/anaplan/themes/original/images/favicon.ico">
<style type="text/css">
@import "lib/dojo/resources/dojo.css";
html {
overflow: auto;
}
</style>
</head>
<body>
<div id="pageWrap" class="pageWrap">
<div class="banner"><h1>An error has occurred whilst processing your request:</h1></div>
<div><pre class="original">Not Found</pre></div>
<div>Please close your browser window and try again.</div>
<div>If the problem persists then please contact Anaplan Support.</div>
</div>
</body>
</html>
Has anyone else faced this kind of issue? Any pointers on troubleshooting this error would be greatly appreciated.
Comments
-
Thank you so much for this. I was into this issue and tired to tinker around to check if its possible but couldnt get it done. Now that i have seen the way you did it, thanks guys with regards
0
Categories
- All Categories
- 2.3K Anaplan Community
- Academy
- Anaplan Talent Builder
- Model Design Course
- The Anaplan Way
- Archive
- 2 Idea exchange
- 62 Enterprise Scale
- 1.1K Extensibility
- 21 Intelligence
- 1.6K Planning & Modeling
- 331 Security
- Community Connections
- Connections
- Experiences
- Groups
- Personas
- Employees
- CS Toolkit
- Customer Care Center
- Forums
- Academy & Training
- Community Feedback & Updates
- Japan
- Anaplan Community Japan
- Anaplan Community Japan Knowledge Base
- HyperCare Japan
- JP-Central
- Support-Japanese
- Partners
- Partner Leadership Council
- Partner Product Council
- 724 Platform
- Anapedia
- App Hub
- Centers Of Excellence
- Extensions
- Planual
- Platform Updates
- 724 User Experience
- Profile Builder
- Resources
- Anaplan Advocates
- Anaplan Live!
- Community
- Community Advancement
- Community Connections
- Partner Program
- The Official Master Anaplanner Program
- Videos
- Welcome to the Anaplan Community!
- Success Central
- Support
- Case Portal Link
- Common Support Questions
- HyperCare Redirect
- Known Issues and Workarounds
- Support test page
- SupportFAQ
- Survey
- 2 Training Day Takeaways