Exemple #1
0
        public static string GetEmailPostHistoryItem(RestCommand command, int emailPostID)
        {
            EmailPostHistoryItem emailPostHistoryItem = EmailPostHistory.GetEmailPostHistoryItem(command.LoginUser, emailPostID);

            if (emailPostHistoryItem.OrganizationID != command.Organization.OrganizationID)
            {
                throw new RestException(HttpStatusCode.Unauthorized);
            }
            return(emailPostHistoryItem.GetXml("EmailPostHistoryItem", true));
        }
Exemple #2
0
        public static string GetEmailPostHistory(RestCommand command)
        {
            EmailPostHistory emailPostHistory = new EmailPostHistory(command.LoginUser);

            emailPostHistory.LoadByOrganizationID(command.Organization.OrganizationID);

            if (command.Format == RestFormat.XML)
            {
                return(emailPostHistory.GetXml("EmailPostHistory", "EmailPostHistoryItem", true, command.Filters));
            }
            else
            {
                throw new RestException(HttpStatusCode.BadRequest, "Invalid data format");
            }
        }