/// <summary> /// Get information about a relationship to another user. /// Required scope: relationships. /// </summary> /// <returns>JSON result string.</returns> public async Task <string> GetRelationshipInfoAsync(long userId) { using (HttpClient httpClient = new HttpClient()) { var response = await httpClient.GetAsync(RelationshipEndpointUrlsFactory.CreateRelationshipUrl(userId, this.accessToken)); string responseContent = await response.Content.ReadAsStringAsync(); if (response.IsSuccessStatusCode) { return(responseContent); } else { throw new InstagramAPIException(responseContent); } } }
/// <summary> /// Get information about a relationship to another user. /// Required scope: relationships. /// </summary> /// <returns>JSON result string.</returns> public async Task <string> GetRelationshipInfoAsync(long userId, string accessToken) { using (HttpClient httpClient = new HttpClient()) { Uri uri = RelationshipEndpointUrlsFactory.CreateRelationshipUrl(userId, accessToken); if (this.EnforceSignedRequests) { uri = uri.AddParameter("sig", Utilities.GenerateSig(string.Format(InstagramAPIEndpoints.RelationshipEndpoint, userId), 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); } } }