From a0e5e90b04a861affaa380902d775562a264251d Mon Sep 17 00:00:00 2001 From: James Jory Date: Fri, 18 Jul 2014 13:38:48 -0700 Subject: [PATCH] Added support for venue claim endpoint. --- pom.xml | 2 +- .../fi/foyt/foursquare/api/FoursquareApi.java | 21 +++++++++++++++++++ 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 2bdd38e..6192932 100755 --- a/pom.xml +++ b/pom.xml @@ -3,7 +3,7 @@ fi.foyt foursquare-api jar - 1.0.5-VinTank + 1.0.6-VinTank Foursquare API diff --git a/src/main/java/fi/foyt/foursquare/api/FoursquareApi.java b/src/main/java/fi/foyt/foursquare/api/FoursquareApi.java index 31fc382..e0cb3ae 100644 --- a/src/main/java/fi/foyt/foursquare/api/FoursquareApi.java +++ b/src/main/java/fi/foyt/foursquare/api/FoursquareApi.java @@ -971,6 +971,27 @@ public Result venuesSearch(String ll, Double llAcc, Double a } + /** + * Allows the authenticated user to claim a venue. This is a non-public API that requires permission from + * Foursquare for your application's client ID. + * + * @see https://developer.foursquare.com/docs/venues/claim. + * + * @param id the venue id for the venue being claimed + * @param visible whether authenticated user should be shown as a venue manager on the venue page + * @return Result object + * @throws FoursquareApiException when something unexpected happens + */ + public Result venueClaim(String id, boolean visible) throws FoursquareApiException { + try { + ApiRequestResponse response = doApiRequest(Method.POST, "venues/" + id + "/claim", true, "visible", visible); + return new Result(response.getMeta(), null); + } catch (JSONException e) { + throw new FoursquareApiException(e); + } + } + + /** * handle parsing a venue search result and parsing the data * @param response