python api proxy issue
I am new to this. Trying to write a basic python script that uses the smartsheet api. It runs fine from my home desktop, via python for windows. However, when I run it at work on my laptop, I am encountering the '[WinError 10061] No connection could be made because the target machine actively refused it' error. I am assuming this is proxy related. I tried adding a proxies value, with same result. Can someone tell me how to overcome this error? See my latest attempt below:
import smartsheet
proxies = {
'http://user:pw@proxy.net:9119',
'https://user:pw@proxy.net:9119'
}
smartsheet = smartsheet.Smartsheet(access_token='blablabla',proxies=proxies)
action = smartsheet.Sheets.get_columns(sheetidhere, include_all=True)
columns = action.data
for col in columns:
print(col.id)
print(col.title)
print('')
Comments
-
Looking at your example it appears the proxies object isn't set correctly. It only has values with no attributes
Setting a proxy for the Python SDK is discussed in the Advanced.md file here:
https://github.com/smartsheet-platform/smartsheet-python-sdk/blob/master/ADVANCED.md#http-proxy
Try updating your proxies declaration to look like this:
proxies = { 'https': 'https://user:pw@proxy.net:9119' }
That should hopefully work to allow you to connect to the Smartsheet API via the Python SDK on your company laptop.
-
Thanks for the quick response. You were correct. Fixed that code up and it is working like a champ. Thanks again!
-
That's awesome! I'm glad to hear it is working.
Categories
- All Categories
- 14 Welcome to the Community
- Smartsheet Customer Resources
- 64.2K Get Help
- 419 Global Discussions
- 221 Industry Talk
- 461 Announcements
- 4.8K Ideas & Feature Requests
- 143 Brandfolder
- 142 Just for fun
- 58 Community Job Board
- 462 Show & Tell
- 32 Member Spotlight
- 1 SmartStories
- 299 Events
- 38 Webinars
- 7.3K Forum Archives