Пример #1
0
        /// <summary>
        /// Lookup an ID by email address. The email address will be hashed before
        /// being sent to the server.
        /// </summary>
        /// <param name="email">the email address</param>
        /// <returns>the ID, or null if not found</returns>
        public string LookupEmail(string email)
        {
            try
            {
                Dictionary <string, string> getParams = MakeRequestParams();

                byte[] emailHash = CryptTool.HashEmail(email);

                return(DoGet(new Uri(this.apiUrl + "lookup/email_hash/" + DataUtils.ByteArrayToHexString(emailHash)), getParams));
            }
            catch (FileNotFoundException)
            {
                return(null);
            }
        }
Пример #2
0
        /// <summary>
        /// Lookup an ID by phone number. The phone number will be hashed before
        /// being sent to the server.
        /// </summary>
        /// <param name="phoneNumber">the phone number in E.164 format</param>
        /// <returns>the ID, or null if not found</returns>
        public string LookupPhone(string phoneNumber)
        {
            try
            {
                Dictionary <string, string> getParams = MakeRequestParams();

                byte[] phoneHash = CryptTool.HashPhoneNo(phoneNumber);

                return(DoGet(new Uri(this.apiUrl + "lookup/phone_hash/" + DataUtils.ByteArrayToHexString(phoneHash)), getParams));
            }
            catch (FileNotFoundException)
            {
                return(null);
            }
        }