Élodie Petit
Élodie Petit

Reputation: 5914

400 Bad Request with Foursquare API

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.

Upvotes: 1

Views: 1744

Answers (2)

akdotcom
akdotcom

Reputation: 4687

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

Upvotes: 2

Matthew Rathbone
Matthew Rathbone

Reputation: 8259

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

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

Upvotes: 1

Related Questions