public async Task <IActionResult> GifSearch([FromQuery] GifSearchQuery gifSearchQuery) { var gifs = await this._chatService.SearchGifAsync(gifSearchQuery); return(new OkObjectResult(gifs)); }
public async Task <dynamic> SearchGifAsync(GifSearchQuery gifSearchQuery) { var url = $"https://api.tenor.com/v1/search?q={gifSearchQuery.Q}&key=LIVDSRZULELA&limit=8&anon_id=3a76e56901d740da9e59ffb22b988242"; var response = await _httpClient.GetAsync(url); var dataAsString = await response.Content.ReadAsStringAsync(); return(JsonConvert.DeserializeObject <dynamic>(dataAsString)); }