/// <summary> /// Remove a like on this media by the currently authenticated user. /// Required scope: likes /// </summary> public async Task <string> DeleteLikeAsync(string mediaId) { using (HttpClient httpClient = new HttpClient()) { var response = await httpClient.DeleteAsync(LikeEndpointsUrlsFactory.CreateDELETELikeUrl(mediaId, this.accessToken)); string responseContent = await response.Content.ReadAsStringAsync(); if (response.IsSuccessStatusCode) { return(responseContent); } else { throw new InstagramAPIException(responseContent); } } }
/// <summary> /// Remove a like on this media by the currently authenticated user. /// Required scope: likes /// </summary> /// <param name="accessToken" type="string"> /// <para> /// A valid access token. /// </para> /// </param> public async Task<string> DeleteLikeAsync(string mediaId, string accessToken) { using (HttpClient httpClient = new HttpClient()) { Uri uri = LikeEndpointsUrlsFactory.CreateDELETELikeUrl(mediaId, accessToken); if (this.EnforceSignedRequests) { uri = uri.AddParameter("sig", Utilities.GenerateSig(string.Format(InstagramAPIEndpoints.LikesEndpoint, mediaId), this.ClientSecret, uri.Query)); } var response = await httpClient.DeleteAsync(uri); string responseContent = await response.Content.ReadAsStringAsync(); if (response.IsSuccessStatusCode) { return responseContent; } else { throw new InstagramAPIException(responseContent); } } }