TeamDesk Knowledge Base & Support

   Home      FAQ      Forum      Idea Exchange      Ask a Question      My Stuff      Help   
Using the REST API with Python!
Hello Teamdesk gang,

Does anybody have experience with using python to interact with the REST API? Specifically with the 'requests' module?

My following function returns 405: 'the method is not supported by the requested resource'.

I am using the same URL as the one I successfully tested in the API playground.

Any advice? =)

randy = str(randint(1, 9999)) + "API TEST"

payload = {
"PR ID": randy,
"Description": "Testing",
"Department": "TMRP",
"Mission": "Chuuk",
"Justification": "Whatever"

headers = {"Content-type": "application/json"}
tdurl = ""
r =, json=payload, headers=headers)
popup = Popup(title="TD", content=Label(text=str(r.json())))

james whitaker
Date Created
8/25/2016 9:12:11 AM
Date Updated
8/25/2016 9:08:35 PM
james whitaker 8/25/2016 10:26:01 AM
Whoops! Forgot to escape the '%'. Rookie error... This can be deleted
james whitaker 8/25/2016 10:30:12 AM
Although while I'm here, what could I be doing wrong here?

{u'source': u'content', u'message': u'Error converting value "[{\'PR ID\': \'4530API TEST\', \'Department\': \'TMRP\', \'Justification\': \'Whatever\', \'Description\': \'Testing\', \'Mission\': \'Chuuk\'}]" to type \'ForeSoft.TeamDesk.API.v2.DataSetRequest\'. Path \'\', line 1, position 126.', u'code': 2002, u'error': 400}

Kirill Bondar  Staff  8/25/2016 7:11:38 PM
@James: with python 3.4.3 and requests 2.11.1 the following works (try it):

import requests
payload = [ { "Text": "Python", "Date": "2016-12-31" } ]
tdurl = ""
headers = { "Content-type": "application/json" }
auth = ( "", "pwd" )
r =, json=payload, headers=headers, auth=auth)
james whitaker 8/25/2016 9:08:35 PM
Thanks, it works!
Back to Search Results