RESTAPI Create a model sync task python
Options
Hello,
I got a core model with about 40 markets application link.
Each time I create a revision tag, I need to synchronize all application one by one.
I'd like to use the new REST API function to create a model sync task but I got an error and I don't know to fix it.
I know that the problem is on data-raw call (Documentation REST API Create a model sync task) but I don't know how to set it up (I've also check on Python Requests documentation)
Thank you for your help
Regards,
Yohan
def SynchRevisionTag(vModelID_Target,vModelID_Source,latestRT_ID_Target,latestRT_ID_Source,vToken😞
SynchRT_URL = 'https://api.anaplan.com/2/0/models/'+vModelID_Target+'/alm/latestRevision'
header = {'Authorization':'AnaplanAuthToken ' + vToken,'Content-Type':'application/json'}
data2 = {'sourceRevisionId':+latestRT_ID_Source, 'sourceModelId': +vModelID_Source, 'targetRevisionId':+latestRT_ID_Target}
r = requests.post(SynchRT_URL, headers= header,data=json.dumps(data2))
try:
r.raise_for_status()
except requests.exceptions.HTTPError as e:
print("Error: " + str(e))
exit()
return r.json()
0
Comments
-
yrignac Member, ALL USERS, Partner, Community Member, Certified Model Builder Posts: 5 Occasional Contributor
Found the solution if some want need it
def SynchRevisionTag(vModelID_Target,vModelID_Source,latestRT_ID_Target,latestRT_ID_Source,vToken😞SynchRT_URL = 'https://api.anaplan.com/2/0/models/'+vModelID_Target+'/alm/syncTasks'header = {'Authorization':'AnaplanAuthToken ' + vToken,'Content-Type':'application/json'}jsondata = {'sourceRevisionId': latestRT_ID_Source, 'sourceModelId': vModelID_Source, 'targetRevisionId': latestRT_ID_Target}r = requests.post(SynchRT_URL, headers= header,json=jsondata)try:r.raise_for_status()except requests.exceptions.HTTPError as e:print("Error: " + str(e))print(r.json())exit()return r.json()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