我正在尝试添加一个新的签入,但我无法确定Foursquare希望如何接收参数。我在正文中尝试了一个url编码的字符串:

shout=test&venueId=4a663032f964a5202fc81fe3

我在正文中尝试了一个json字符串(带有application/json内容类型头):
{"shout":"test","venueId":"4a4a9f71f964a52004ac1fe3"}

但是,我总是得到错误响应:
meta =     {
    code = 400;
    errorDetail = "Must provide parameter venueId";
    errorType = other;
};

发布到签入/添加终结点的正确方法是什么?

最佳答案

必须将venueid作为post参数发送。准确的方法取决于您使用的库/语言。
例如,要在命令行上使用curl执行此操作,可以使用

curl https://api.foursquare.com/v2/checkins/add -F venueId=<the id> -F oauth_token=<the token>

08-16 01:41