/// <summary>
 /// For backward compatibility with old wrappers.
 /// </summary>
 public MemberMessageExchangeTypeCollection GetMemberMessages(string ItemID, MessageTypeCodeType MailMessageType, MessageStatusTypeCodeType MessageStatus)
 {
     this.ItemID          = ItemID;
     this.MailMessageType = MailMessageType;
     this.MessageStatus   = MessageStatus;
     Execute();
     return(MemberMessageList);
 }
        /// <summary>
        /// Retrieves a list of the messages buyers have posted about your
        /// active item listings.
        /// </summary>
        ///
        /// <param name="ItemID">
        /// The ID of the item the message is about.
        ///
        /// For ASQ messages, either the ItemID, or a date range
        /// (specified with StartCreationTime and EndCreationTime),
        /// or both must be included. ItemID is otherwise ignored.
        /// </param>
        ///
        /// <param name="MailMessageType">
        /// The type of message. Note that GetMemberMessages does not return
        /// messages when this field is set to AskSellerQuestion.
        /// </param>
        ///
        /// <param name="MessageStatus">
        /// The status of the message.
        /// </param>
        ///
        /// <param name="DisplayToPublic">
        /// If included in the request and set to True, only public messages (viewable
        /// in the Item listing) are returned. If omitted or set to False in the
        /// request, all messages (that match other filters in the request) are returned
        /// in the response.
        /// </param>
        ///
        /// <param name="StartCreationTime">
        /// Used as beginning of date range filter. If specified,
        /// filters the returned messages to only those with a
        /// creation date greater than or equal to the specified
        /// date and time.
        ///
        /// For CEM messages, StartCreationTime and EndCreationTime
        /// must be provided.
        ///
        /// For ASQ messages, either the ItemID, or a date range
        /// (specified with StartCreationTime and EndCreationTime),
        /// or both must be included.
        /// </param>
        ///
        /// <param name="EndCreationTime">
        /// Used as end of date range filter. If specified, filters
        /// the returned messages to only those with a creation date
        /// less than or equal to the specified date and time.
        ///
        /// For CEM messages, StartCreationTime and EndCreationTime
        /// must be provided.
        ///
        /// For ASQ messages, either the ItemID, or a date range
        /// (specified with StartCreationTime and EndCreationTime),
        /// or both must be included.
        /// </param>
        ///
        /// <param name="Pagination">
        /// Standard pagination argument used to reduce response.
        /// </param>
        ///
        /// <param name="MemberMessageID">
        /// An ID that uniquely identifies the message for a given user to be retrieved.
        /// Used for the AskSellerQuestion notification only.
        /// </param>
        ///
        /// <param name="SenderID">
        /// An eBay ID that uniquely identifies a user. For
        /// GetMemberMessages, this is the sender of the message. If
        /// included in the request, returns only messages from the
        /// specified sender.
        /// </param>
        ///
        public MemberMessageExchangeTypeCollection GetMemberMessages(string ItemID, MessageTypeCodeType MailMessageType, MessageStatusTypeCodeType MessageStatus, bool DisplayToPublic, DateTime StartCreationTime, DateTime EndCreationTime, PaginationType Pagination, string MemberMessageID, string SenderID)
        {
            this.ItemID            = ItemID;
            this.MailMessageType   = MailMessageType;
            this.MessageStatus     = MessageStatus;
            this.DisplayToPublic   = DisplayToPublic;
            this.StartCreationTime = StartCreationTime;
            this.EndCreationTime   = EndCreationTime;
            this.Pagination        = Pagination;
            this.MemberMessageID   = MemberMessageID;
            this.SenderID          = SenderID;

            Execute();
            return(ApiResponse.MemberMessage);
        }
Exemple #3
0
        public EbayServiceResponse <IEnumerable <MemberMessage> > GetMemberMessage(string token, DateTime from, DateTime to, MessageTypeCodeType messageTypeCodeType,
                                                                                   MessageStatusTypeCodeType messageStatusTypeCode)
        {
            var apiContext = CreateApiContext(apiServerUrl, ruName, appId, devId, certId, token);
            var response   = new EbayServiceResponse <IEnumerable <MemberMessage> >();

            try
            {
                var apiCall    = new GetMemberMessagesCall(apiContext);
                var timeFilter = new TimeFilter(from, to);
                var messages   = apiCall.GetMemberMessages(timeFilter, messageTypeCodeType, messageStatusTypeCode);
                var result     = new List <MemberMessage>();
                foreach (MemberMessageExchangeType message in messages)
                {
                    var memberMessage = new MemberMessage
                    {
                        ParentMessageId  = message.Question.ParentMessageID,
                        MessageId        = message.Question.MessageID,
                        MessageStatus    = message.MessageStatus.ToString(),
                        ItemId           = message.Item != null ? message.Item.ItemID : string.Empty,
                        QuestionType     = message.Question.QuestionType.ToString(),
                        SenderId         = message.Question.SenderID,
                        SenderEmail      = message.Question.SenderEmail,
                        RecipientId      = message.Question.RecipientID[0],
                        Body             = message.Question.Body,
                        CreatedDate      = message.CreationDate,
                        LastModifiedDate = message.LastModifiedDate
                    };
                    result.Add(memberMessage);
                }
                response.Result = result;
            }
            catch (Exception ex)
            {
                response.Error = ex.Message;
            }
            return(response);
        }
 /// <summary>
 /// For backward compatibility with old wrappers.
 /// </summary>
 public MemberMessageExchangeTypeCollection GetMemberMessages(DateTime TimeFrom, DateTime TimeTo, MessageTypeCodeType MailMessageType, MessageStatusTypeCodeType MessageStatus)
 {
     this.CreateTimeFilter = new TimeFilter(TimeFrom, TimeTo);
     this.MailMessageType  = MailMessageType;
     this.MessageStatus    = MessageStatus;
     Execute();
     return(MemberMessageList);
 }
 /// <summary>
 /// For backward compatibility with old wrappers.
 /// </summary>
 public MemberMessageExchangeTypeCollection GetMemberMessages(TimeFilter CreateTimeFilter, MessageTypeCodeType MailMessageType, MessageStatusTypeCodeType MessageStatus)
 {
     this.CreateTimeFilter = CreateTimeFilter;
     this.MailMessageType  = MailMessageType;
     this.MessageStatus    = MessageStatus;
     Execute();
     return(MemberMessageList);
 }
		/// <summary>
		/// For backward compatibility with old wrappers.
		/// </summary>
		public MemberMessageExchangeTypeCollection GetMemberMessages(DateTime TimeFrom, DateTime TimeTo, MessageTypeCodeType MailMessageType, MessageStatusTypeCodeType MessageStatus)
		{
			this.CreateTimeFilter = new TimeFilter(TimeFrom, TimeTo);
			this.MailMessageType = MailMessageType;
			this.MessageStatus = MessageStatus;
			Execute();
			return MemberMessageList;
		}
		/// <summary>
		/// For backward compatibility with old wrappers.
		/// </summary>
		public MemberMessageExchangeTypeCollection GetMemberMessages(TimeFilter CreateTimeFilter, MessageTypeCodeType MailMessageType, MessageStatusTypeCodeType MessageStatus)
		{
			this.CreateTimeFilter = CreateTimeFilter;
			this.MailMessageType = MailMessageType;
			this.MessageStatus = MessageStatus;
			Execute();
			return MemberMessageList;
		}
		/// <summary>
		/// For backward compatibility with old wrappers.
		/// </summary>
		public MemberMessageExchangeTypeCollection GetMemberMessages(string ItemID, MessageTypeCodeType MailMessageType, MessageStatusTypeCodeType MessageStatus)
		{
			this.ItemID = ItemID;
			this.MailMessageType = MailMessageType;
			this.MessageStatus = MessageStatus;
			Execute();
			return MemberMessageList;
		}
		/// <summary>
		/// Retrieves a list of the messages buyers have posted about your
		/// active item listings.
		/// </summary>
		/// 
		/// <param name="ItemID">
		/// The ID of the item the message is about.
		/// 
		/// For ASQ messages, either the ItemID, or a date range
		/// (specified with StartCreationTime and EndCreationTime),
		/// or both must be included. ItemID is otherwise ignored.
		/// </param>
		///
		/// <param name="MailMessageType">
		/// The type of message. Note that GetMemberMessages does not return
		/// messages when this field is set to AskSellerQuestion.
		/// </param>
		///
		/// <param name="MessageStatus">
		/// The status of the message.
		/// </param>
		///
		/// <param name="DisplayToPublic">
		/// If included in the request and set to True, only public messages (viewable
		/// in the Item listing) are returned. If omitted or set to False in the
		/// request, all messages (that match other filters in the request) are returned
		/// in the response.
		/// </param>
		///
		/// <param name="StartCreationTime">
		/// Used as beginning of date range filter. If specified,
		/// filters the returned messages to only those with a
		/// creation date greater than or equal to the specified
		/// date and time.
		/// 
		/// For CEM messages, StartCreationTime and EndCreationTime
		/// must be provided.
		/// 
		/// For ASQ messages, either the ItemID, or a date range
		/// (specified with StartCreationTime and EndCreationTime),
		/// or both must be included.
		/// </param>
		///
		/// <param name="EndCreationTime">
		/// Used as end of date range filter. If specified, filters
		/// the returned messages to only those with a creation date
		/// less than or equal to the specified date and time.
		/// 
		/// For CEM messages, StartCreationTime and EndCreationTime
		/// must be provided.
		/// 
		/// For ASQ messages, either the ItemID, or a date range
		/// (specified with StartCreationTime and EndCreationTime),
		/// or both must be included.
		/// </param>
		///
		/// <param name="Pagination">
		/// Standard pagination argument used to reduce response.
		/// </param>
		///
		/// <param name="MemberMessageID">
		/// An ID that uniquely identifies the message for a given user to be retrieved.
		/// Used for the AskSellerQuestion notification only.
		/// </param>
		///
		/// <param name="SenderID">
		/// An eBay ID that uniquely identifies a user. For
		/// GetMemberMessages, this is the sender of the message. If
		/// included in the request, returns only messages from the
		/// specified sender.
		/// </param>
		///
		public MemberMessageExchangeTypeCollection GetMemberMessages(string ItemID, MessageTypeCodeType MailMessageType, MessageStatusTypeCodeType MessageStatus, bool DisplayToPublic, DateTime StartCreationTime, DateTime EndCreationTime, PaginationType Pagination, string MemberMessageID, string SenderID)
		{
			this.ItemID = ItemID;
			this.MailMessageType = MailMessageType;
			this.MessageStatus = MessageStatus;
			this.DisplayToPublic = DisplayToPublic;
			this.StartCreationTime = StartCreationTime;
			this.EndCreationTime = EndCreationTime;
			this.Pagination = Pagination;
			this.MemberMessageID = MemberMessageID;
			this.SenderID = SenderID;

			Execute();
			return ApiResponse.MemberMessage;
		}
Exemple #10
0
        static void GetMemberMessage(EbayService service, string token, DateTime from, DateTime to, MessageTypeCodeType messageTypeCodeType,
                                     MessageStatusTypeCodeType messageStatusTypeCode)
        {
            var result = service.GetMemberMessage(token, from, to, messageTypeCodeType, messageStatusTypeCode);

            if (result.HasError)
            {
                Console.WriteLine("GetMemberMessage : " + result.Error);
            }
            else
            {
                Console.WriteLine("GetMemberMessage : " + result.Result.Count());
            }
        }