Take the 2-minute tour ×

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?


share|improve this question
add comment

2 Answers

up vote 1 down vote accepted

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

share|improve this answer
Thanks akdotcom. oauth_token has to be in request url as per the documentation. Also putting it as a POST parameter didn't change anything. –  Élodie Petit Nov 8 '11 at 7:32
Not sure why it didn't change anything, perhaps you have another issue, but I assure you that it's supposed to be a POST param. It's my job to know this =). Also as Matthew mentioned, you need to specify the broadcast parameter. Also, also, you shouldn't have that trailing "/" at the end of your path. –  akdotcom Nov 17 '11 at 0:01
I know this thread is old, but isn't the broadcast parameter optional? I need to make sure because I'm stuck on a 400 as well. –  ratsimihah Apr 17 at 21:27
add comment

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


share|improve this answer
in fact you don't even need a venue_id, broadcast is the only required parameter. I would suggest passing a ll though if possible. –  Matthew Rathbone Oct 27 '11 at 20:23
Thanks! It wasn't required when I first coded this. However, it still gives me a 404. –  Élodie Petit Oct 28 '11 at 9:18
can you post the exact call you're making (without your oauth token)? You sure you're doing a POST and not a GET? –  Matthew Rathbone Oct 28 '11 at 14:37
The code above is the actual code I use. I just changed oauth_token and venue id before posting. –  Élodie Petit Oct 29 '11 at 8:03
Is this client-side javascript? –  Matthew Rathbone Nov 3 '11 at 15:12
show 1 more comment

Your Answer


