Ejemplo n.º 1
0
        BaseResponse <Badge> IBadges.GetAllTaggedBadges(BadgeFilters filters, string inName)
        {
            var apiParams = filters.GetQueryParams();
            var url       = $"{_baseApiUrl}/badges/tags" + $"?key={_apiKey}&{apiParams}";
            var response  = _httpClient.GetAsync(url).Result.Content.ReadAsStringAsync().Result;
            var apiResult = response.DeserializeJson <Data <Badge> >().ValidateApiResponse();

            return(apiResult);
        }
Ejemplo n.º 2
0
        BaseResponse <Badge> IBadges.GetRecentlyAwardedBadgesByIds(List <string> ids, BadgeFilters filters)
        {
            var apiParams   = filters.GetQueryParams();
            var url         = $"{_baseApiUrl}/badges/";
            var idsToEncode = string.Join(";", ids.ToArray());

            url = url + $"{HttpUtility.UrlEncode(idsToEncode)}/recipients" + $"?key={_apiKey}&{apiParams}";
            var response  = _httpClient.GetAsync(url).Result.Content.ReadAsStringAsync().Result;
            var apiResult = response.DeserializeJson <Data <Badge> >().ValidateApiResponse();

            return(apiResult);
        }