我对此进行了广泛的搜索,并查看了非官方的Vine API。下面是我在端点文件中看到的代码:
def post(videoUrl, thumbnailUrl, description, entities, optionals = {} )
forsquareVenueId = optionals["forsquareVenueId"] || optionals[:forsquareVenueId]; venueName = optionals["venueName"] || optionals[:venueName]; channelId = optionals["channelId"] || optionals[:channelId]
url = (API_URL + "posts") % []
params = { "forsquareVenueId" => forsquareVenueId , "venueName" => venueName , "channelId" => channelId , "videoUrl" => videoUrl , "thumbnailUrl" => thumbnailUrl , "description" => description , "entities" => entities }.reject { |k, v| v.nil? }
api_call "post", url, params, nil
end
根据我的理解,似乎我需要首先创建一个帖子,然后使用带有视频数据和缩略图数据的HTTP Put方法更新它。但我不清楚如何填充各种领域,如'实体'在JSON中。需要一些帮助。