ImgurNet.ApiEndpoints.ConversationEndpoint.GetConversationListAsync C# (CSharp) Method

GetConversationListAsync() public method

Get list of all conversations for the authenticated in user
public GetConversationListAsync ( ) : Task>
return Task>
		public async Task<ImgurResponse<Conversation[]>> GetConversationListAsync()
		{
			if (ImgurClient.Authentication == null)
				throw new InvalidAuthenticationException("Authentication can not be null. Set it in the main Imgur class.");

			if (!(ImgurClient.Authentication is OAuth2Authentication))
				throw new InvalidAuthenticationException("You need to use OAuth2Authentication to call this Endpoint.");

			return
				await
					Request.SubmitImgurRequestAsync<Conversation[]>(Request.HttpMethod.Get, ConversationsUrl, ImgurClient.Authentication);
		}

Usage Example

		public async Task TestGetConversationList()
		{
			var imgurClient = await AuthenticationHelpers.CreateOAuth2AuthenticatedImgurClient();
			var conversationEndpoint = new ConversationEndpoint(imgurClient);
			var conversations = await conversationEndpoint.GetConversationListAsync();

			// Assert the Reponse
			Assert.IsNotNull(conversations.Data);
			Assert.AreEqual(conversations.Success, true);
			Assert.AreEqual(conversations.Status, HttpStatusCode.OK);
		}
All Usage Examples Of ImgurNet.ApiEndpoints.ConversationEndpoint::GetConversationListAsync