400 Bad Request with Foursquare API

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-11 05:59:51

问题


I am posting a checkin to 4sq but keep getting 400 Bad Request. Here is a very simple code that does the checkin:

client = new WebClient();
client.UploadStringCompleted += (s, args) =>
{
    var result = args.Result;
};
client.UploadStringAsync(new Uri("https://api.foursquare.com/v2/checkins/add/?oauth_token=my_token"),
"POST", "venueId=venue_id");

I am sure my_token and venue_id is correct because I use them for getting list of previous checkins and venue information.

Do you see something wrong with this code?

Thanks.


回答1:


Specify the oauth_token as a POST param, not part of the URL path.




回答2:


You're missing the 'broadcast' parameter. It's listed as required:

https://developer.foursquare.com/docs/checkins/add.html



来源:https://stackoverflow.com/questions/7913251/400-bad-request-with-foursquare-api

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!