Post a chart in python StockTwits API

256 Views Asked by At

I am creating a python script, and I can't get this script to work properly. I have an image that is stored on my PC, and I need to send that image to StockTwits API.

    myobj = {'access_token': mytoken, 'body': 'test', 'sentiment': 'bullish', 'chart':image_path}

where image_path, is the path to where my Image lives on my computer.

https://api.stocktwits.com/developers/docs/api#messages-create-docs

They have an example in CURL, but not for python.

When I run the above example I get the following error:

   {"response":{"status":422},"errors":[{"message":"There was a problem with the URL. Please 
   check to make sure the provided URL is valid"}]}
1

There are 1 best solutions below

0
On

So this fails, for whatever reason. Instead, I put the images onto my own server, and then I called sent the Https://url as the chart parameter.

This was the workaround I found.