400 Bad Request with Foursquare API

2019-08-13 19:13发布

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.

标签: foursquare
2条回答
等我变得足够好
2楼-- · 2019-08-13 19:48

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

查看更多
对你真心纯属浪费
3楼-- · 2019-08-13 20:07

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

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

查看更多
登录 后发表回答