首页 > 解决方案 > 将图表从本地文件上传到 StockTwits API 的正确语法是什么?

问题描述

我正在使用 Excel 构建一个本地应用程序,以使用 API 将带有图表的消息发布到 StockTwits。由于该文件是本地文件,并且 API 调用此语法来上传图表:

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

我的 JASON 正文如下所示:

{"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"}

但是,当我将此发布到 API 时,我收到以下错误:

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

我的本地文件语法有什么不正确的地方?

标签: apichartsuploadingstocktwits

解决方案


推荐阅读