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!

Answers

  • @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!

  • @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!

  • Hello, sure thing. I will publish it on Github in few days.
    Glad you enjoyed it.
    Enjoy CPX !

  • 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!

  • Hello,

    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.

      certifi2020.6.202020.6.20
      cffi1.14.11.14.3
      chardet3.0.43.0.4
      cryptography3.03.1.1
      idna2.102.10
      pip20.220.2.3
      pycparser2.202.20
      requests2.24.02.24.0
      setuptools49.2.150.3.0
      six1.15.01.15.0
      urllib31.25.101.25.10

       

    We will consider further videos on related topics.

    Happy coding !

    Christophe K.

  • 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. 🙂

     

     

  • Hello Venkat,

     

    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.

     

    christophe_keom_0-1614614391791.png

    In the screenshot above, you can see that we can get a token back using Certificate authentication.
    Hope it will be of some help.

    Christophe