/// <summary> /// Get the list of users this user follows. /// Required scope: relationships. /// </summary> /// <returns>JSON result string.</returns> public async Task <string> GetFollowsAsync(long userId) { using (HttpClient httpClient = new HttpClient()) { var response = await httpClient.GetAsync(RelationshipEndpointUrlsFactory.CreateUserFollowedByUrl(userId, this.accessToken)); string responseContent = await response.Content.ReadAsStringAsync(); if (response.IsSuccessStatusCode) { return(responseContent); } else { throw new InstagramAPIException(responseContent); } } }
/// <summary> /// Get the list of users this user is followed by. /// Required scope: relationships. /// </summary> /// <returns>JSON result string.</returns> public async Task <string> GetFollowedByAsync(string accessToken) { using (HttpClient httpClient = new HttpClient()) { Uri uri = RelationshipEndpointUrlsFactory.CreateUserFollowedByUrl(accessToken); if (this.EnforceSignedRequests) { uri = uri.AddParameter("sig", Utilities.GenerateSig(InstagramAPIEndpoints.UserFollowsEndpoint, this.ClientSecret, uri.Query)); } var response = await httpClient.GetAsync(uri); string responseContent = await response.Content.ReadAsStringAsync(); if (response.IsSuccessStatusCode) { return(responseContent); } else { throw new InstagramAPIException(responseContent); } } }