4 Replies Latest reply on Oct 4, 2021 1:55 AM by Harish Thummapudi

    Calling TDM RESTAPI from Python

    JoAnn Kulcyk Active Member

      Is anyone using python requests.post to GENERATE a plan using the TDM RESTAPI?   We are able to do it using curl, but we are getting a status code 500 when we use python.


      We create the curl command using Swagger:




      curl -X POST "https://gn1dmxengprd03.gnet.biz:6643/api/public/tdm/v1/jobs"
      -H "accept: application/json" -H "authorization: Basic
      pw" -H "Content-Type:
      multipart/form-data" -F "type=Generate" -F

      "projectId=4020" -F


      We use what we believe to be the equivalent python code:




      import requests

      headers = {      
      'accept': 'application/json',
      'authorization': 'Basic pw',
      'Content-Type': 'multipart/form-data'


      'type': "Generate",
      'projectId': 4020,
      'planId': 11063,



      r = requests.post(url,
      json=datavalues, headers=headers, verify=False)



      and status_code is 500.

        This content has been marked as final.  Show 4 replies