public UserInfoModel UpdatProfilePhoto(string photo)
        {
            var    serverUrl     = "https://api.foursquare.com/v2/users/self/update";
            var    argsDict      = new UsersArgsDictionary(_accessToken).UpdatePhotoArgsDictionary(photo);
            string postData      = QueryStringHelper.BuildPostData(argsDict);
            var    userInfoModel = _httpClient.SendPostRequest <UserInfoModel, string>(serverUrl, postData).Result;

            return(userInfoModel);
        }
        public UserInfoModel SetPings(string userId, bool value)
        {
            var    serverUrl     = "https://api.foursquare.com/v2/users/" + userId + "/setpings";
            var    argsDict      = new UsersArgsDictionary(_accessToken).SetPingsArgsDictionary(value);
            string postData      = QueryStringHelper.BuildPostData(argsDict);
            var    userInfoModel = _httpClient.SendPostRequest <UserInfoModel, string>(serverUrl, postData).Result;

            return(userInfoModel);
        }
Beispiel #3
0
        //in later version
        //public UserBadgesModel UserBadges(string userId)
        //{
        //    if (!IsAuthenticated())
        //        return null;
        //    if (string.IsNullOrEmpty(userId))
        //        userId = "self";
        //    var serverUrl = "https://api.foursquare.com/v2/users/" + userId + "/badges";
        //    var argsDict = new UsersArgsDictionary(_accessToken).UserRequestsArgsDictionary();
        //    var queryString = QueryStringHelper.BuildQueryString(argsDict);
        //    var requestUrl = string.Concat(serverUrl, queryString);
        //    var userBadgesModel = _httpClient.SendGetRequest<UserBadgesModel>(requestUrl).Result;
        //    return userBadgesModel;
        //}

        //Checked
        public UserCheckinsModel UserCheckins(string userId = null, int?limit = null, int?offset = null, string sort = null, long?afterTimestamp = null, long?beforeTimestamp = null)
        {
            if (userId == null)
            {
                userId = "self";
            }
            var serverUrl         = "https://api.foursquare.com/v2/users/" + userId + "/checkins";
            var argsDict          = new UsersArgsDictionary(_accessToken).UserCheckinsArgsDictionary(limit, offset, sort, afterTimestamp, beforeTimestamp);
            var queryString       = QueryStringHelper.BuildQueryString(argsDict);
            var requestUrl        = string.Concat(serverUrl, queryString);
            var userCheckinsModel = _httpClient.SendGetRequest <UserCheckinsModel>(requestUrl).Result;

            return(userCheckinsModel);
        }
        public UserVenueHistoryModel UserVenueHistory(string userId = null, string categoryId = null, long?afterTimestamp = null, long?beforeTimestamp = null)
        {
            if (userId == null)
            {
                userId = "self";
            }
            var serverUrl             = "https://api.foursquare.com/v2/users/" + userId + "/venuehistory";
            var argsDict              = new UsersArgsDictionary(_accessToken).UserVenueHistoryArgsDictionary(categoryId, afterTimestamp, beforeTimestamp);
            var queryString           = QueryStringHelper.BuildQueryString(argsDict);
            var requestUrl            = string.Concat(serverUrl, queryString);
            var userVenueHistoryModel = _httpClient.SendGetRequest <UserVenueHistoryModel>(requestUrl).Result;

            return(userVenueHistoryModel);
        }
        public UserTodosModel UserTodos(string userId = null, double?latitude = null, double?longitude = null, string sort = null)
        {
            if (userId == null)
            {
                userId = "self";
            }
            var serverUrl      = "https://api.foursquare.com/v2/users/" + userId + "/todos";
            var argsDict       = new UsersArgsDictionary(_accessToken).UserTodosArgsDictionary(latitude, longitude, sort);
            var queryString    = QueryStringHelper.BuildQueryString(argsDict);
            var requestUrl     = string.Concat(serverUrl, queryString);
            var userTodosModel = _httpClient.SendGetRequest <UserTodosModel>(requestUrl).Result;

            return(userTodosModel);
        }
        public UserPhotosModel UserPhotos(string userId = null, int?limit = null, int?offset = null)
        {
            if (userId == null)
            {
                userId = "self";
            }
            var serverUrl       = "https://api.foursquare.com/v2/users/" + userId + "/photos";
            var argsDict        = new UsersArgsDictionary(_accessToken).UserPhotosArgsDictionary(limit, offset);
            var queryString     = QueryStringHelper.BuildQueryString(argsDict);
            var requestUrl      = string.Concat(serverUrl, queryString);
            var userPhotosModel = _httpClient.SendGetRequest <UserPhotosModel>(requestUrl).Result;

            return(userPhotosModel);
        }
Beispiel #7
0
        //Checked
        public SearchUsersModel SearchUsers(string phone = null, string email = null, string twitter = null, string twitterSource = null, string fbid = null, string name = null)
        {
            if (!IsAuthenticated())
            {
                return(null);
            }

            string serverUrl        = "https://api.foursquare.com/v2/users/search/";
            var    argsDict         = new UsersArgsDictionary(_accessToken).SearchUsersArgsDictionary(phone, email, twitter, twitterSource, fbid, name);
            var    queryString      = QueryStringHelper.BuildQueryString(argsDict);
            var    requestUrl       = string.Concat(serverUrl, queryString);
            var    searchUsersModel = _httpClient.SendGetRequest <SearchUsersModel>(requestUrl).Result;

            return(searchUsersModel);
        }
Beispiel #8
0
        //Checked
        public FriendRequestsModel FriendRequests()
        {
            if (!IsAuthenticated())
            {
                return(null);
            }

            string serverUrl           = "https://api.foursquare.com/v2/users/requests/";
            var    argsDict            = new UsersArgsDictionary(_accessToken).UserRequestsArgsDictionary();
            var    queryString         = QueryStringHelper.BuildQueryString(argsDict);
            var    requestUrl          = string.Concat(serverUrl, queryString);
            var    friendRequestsModel = _httpClient.SendGetRequest <FriendRequestsModel>(requestUrl).Result;

            return(friendRequestsModel);
        }
Beispiel #9
0
        //Checked
        public LeaderboardModel LeaderBoard(int?neighbors = null)
        {
            if (!IsAuthenticated())
            {
                return(null);
            }

            string serverUrl        = "https://api.foursquare.com/v2/users/leaderboard/";
            var    argsDict         = new UsersArgsDictionary(_accessToken).UserLeaderboardArgsDictionary(neighbors);
            var    queryString      = QueryStringHelper.BuildQueryString(argsDict);
            var    requestUrl       = string.Concat(serverUrl, queryString);
            var    leaderBoardModel = _httpClient.SendGetRequest <LeaderboardModel>(requestUrl).Result;

            return(leaderBoardModel);
        }
Beispiel #10
0
        //Checked
        public UserInfoModel User(string userId)
        {
            if (!IsAuthenticated())
            {
                return(null);
            }

            if (userId == null)
            {
                userId = "self";
            }
            string serverUrl     = "https://api.foursquare.com/v2/users/" + userId;
            var    argsDict      = new UsersArgsDictionary(_accessToken).UserInfoArgsDictionary();
            var    queryString   = QueryStringHelper.BuildQueryString(argsDict);
            var    requestUrl    = string.Concat(serverUrl, queryString);
            var    userInfoModel = _httpClient.SendGetRequest <UserInfoModel>(requestUrl).Result;

            return(userInfoModel);
        }
Beispiel #11
0
        //Checked
        public UserListsModel UserLists(string userId = null, string group = null, double?latitude = null, double?longitude = null)
        {
            if (!IsAuthenticated())
            {
                return(null);
            }

            if (userId == null)
            {
                userId = "self";
            }

            var serverUrl      = "https://api.foursquare.com/v2/users/" + userId + "/lists";
            var argsDict       = new UsersArgsDictionary(_accessToken).UserListsArgsDictionary(group, latitude, longitude);
            var queryString    = QueryStringHelper.BuildQueryString(argsDict);
            var requestUrl     = string.Concat(serverUrl, queryString);
            var userListsModel = _httpClient.SendGetRequest <UserListsModel>(requestUrl).Result;

            return(userListsModel);
        }