DigitalCPX 2020: Expert Advice: Anaplan API & Python w/ Christophe Keomanivong
Fully on board with Connected Planning? Looking at expending your sources to the world wide web?
In this session, we will illustrate how to use Python to import data into Anaplan from any remote source.
We will focus on getting started using Python as your steppingstone for integrations.
Watch the video here, download the presentation (.pdf format), and then join the conversation, add comments & questions below!
@christophe_keom - Enjoyed your API walk-through. Wondering if you will be making the code available in addition to the pdf of the ppt? Thanks!2
@kjochim beat me to it.
@christophe_keom it would be great if you could make a best practice post with what you shared today!
Great job, by the way!1
Hello, sure thing. I will publish it on Github in few days.
Glad you enjoyed it.
Enjoy CPX !1
That is for sure something we are planning to do.
We want to have more and more content coming on integrations and API.
Very glad you appreciated it!0
I've got some issues with Github so I will share the different files in that thread.
To open them, just unzip the enclosed file.
You will find:
- anaplan_runner.py, containing the main function
- anaplan_api_def.py, containing the classes for calls to the Anaplan APIs.
Below, the different packages that have been used for the code.
certifi 2020.6.20 2020.6.20 cffi 1.14.1 1.14.3 chardet 3.0.4 3.0.4 cryptography 3.0 3.1.1 idna 2.10 2.10 pip 20.2 20.2.3 pycparser 2.20 2.20 requests 2.24.0 2.24.0 setuptools 49.2.1 50.3.0 six 1.15.0 1.15.0 urllib3 1.25.10 1.25.10
We will consider further videos on related topics.
Happy coding !
In anaplay_api_def.py, how is caCert and privateKey defined or created? Is importing load_pem_private_key is enough? It will be great if you can reply as the script is failing. 🙂0
I have been trying the code related to certificate authentication and it worked fine.
Can you make sure that:
1/ you have extracted the private key in a separate file
2/ you have extracted the public certificate in a separate file as well?
You don't need to import anything into Anaplan at all when using certificate authentication.
In the screenshot above, you can see that we can get a token back using Certificate authentication.
Hope it will be of some help.