public static string GetPhoneNumbersViewItem(RestCommand command, int phoneID)
        {
            PhoneNumbersViewItem phoneNumbersViewItem = PhoneNumbersView.GetPhoneNumbersViewItem(command.LoginUser, phoneID);

            if (phoneNumbersViewItem.OrganizationID != command.Organization.OrganizationID)
            {
                throw new RestException(HttpStatusCode.Unauthorized);
            }
            return(phoneNumbersViewItem.GetXml("PhoneNumbersViewItem", true));
        }
        public static string GetPhoneNumber(RestCommand command, ReferenceType refType, int refID, int phoneID)
        {
            PhoneNumbersViewItem item = PhoneNumbersView.GetPhoneNumbersViewItem(command.LoginUser, phoneID);

            if (item.RefType != refType && item.RefID != refID)
            {
                throw new RestException(HttpStatusCode.Unauthorized);
            }
            if (!DataUtils.IsReferenceValid(command.LoginUser, refType, refID))
            {
                throw new RestException(HttpStatusCode.Unauthorized);
            }

            return(item.GetXml("PhoneNumber", true));
        }