protected override void ExecuteInternal() { this.Message = null; GetMemberMessagesCall apiCall = new GetMemberMessagesCall(this.ApiContext); apiCall.ApiRequest.MemberMessageID = this.MessageId; apiCall.ApiRequest.DetailLevel = new DetailLevelCodeTypeCollection(); apiCall.ApiRequest.DetailLevel.Add(DetailLevelCodeType.ReturnHeaders); apiCall.ApiRequest.MailMessageType = MessageTypeCodeType.AskSellerQuestion; apiCall.Execute(); if (apiCall.HasWarning) { string message = apiCall.ApiException.Message; // TODO; } if (apiCall.HasError) { string message = apiCall.ApiException.Message; // TODO: } if (apiCall.ApiResponse != null && apiCall.ApiResponse.MemberMessage != null && apiCall.ApiResponse.MemberMessage.Count > 0) { this.Message = apiCall.ApiResponse.MemberMessage[0]; } }
public void GetMemberMessages() { GetMemberMessagesCall api = new GetMemberMessagesCall(this.apiContext); api.DetailLevelList = new DetailLevelCodeTypeCollection(); api.DetailLevelList.Add(DetailLevelCodeType.ReturnMessages); api.DisplayToPublic = false; api.MailMessageType = MessageTypeCodeType.AskSellerQuestion; api.MessageStatus = MessageStatusTypeCodeType.Unanswered; // Time filter System.DateTime calTo = System.DateTime.Now; System.DateTime calFrom = calTo.AddHours(-1); api.StartCreationTime = calFrom; api.EndCreationTime = calTo; // Make API call. api.Execute(); TestData.MemberMessages = api.ApiResponse.MemberMessage; }