Matt Trader
Matt Trader

Reputation: 21

What is the proper syntax to upload a chart from a local file to StockTwits API?

I am building a local application using Excel to post a message with a chart to StockTwits using the API. Since the file is local and API calls for this syntax to upload a Chart:

curl https://api.stocktwits.com/api/2/messages/create.json -F access_token=<access_token> -F body="Creating a new message with a chart. \$ticker" -F chart=@/path/to/a/local/image/file.jpg

My JASON body text looks as follows:

{"body":"Testing a post for $WDC with a chart testing two again to see if this works","chart":"file://C:/My_Folder/My_File.png"}

However when I POST this to the API 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"}]}

What is incorrect in my local file syntax?

Upvotes: 2

Views: 126

Answers (0)

Related Questions