public static string GetEmailAddress(RestCommand command, int id) { EmailAddress emailAddress = EmailAddresses.GetEmailAddress(command.LoginUser, id); if (emailAddress.OrganizationID != command.Organization.OrganizationID) { throw new RestException(HttpStatusCode.Unauthorized); } return(emailAddress.GetXml("EmailAddress", true)); }