コード例 #1
0
        protected override void Execute()
        {
            string phoneNo = this.phoneNoField.Value;
            string from    = this.fromField.Value;
            string secret  = this.secretField.Value;

            APIConnector apiConnector = this.CreateConnector(from, secret);
            string       id           = apiConnector.LookupPhone(phoneNo);

            if (id != null)
            {
                System.Console.WriteLine(id);
            }
        }
コード例 #2
0
        /// <summary>
        /// Wrapper to id lookup via phone number <see cref="Threema.MsgApi.APIConnector.LookupPhone"/>
        /// </summary>
        /// <param name="phoneNo">Phone number for lookup</param>
        /// <param name="from">Sender id</param>
        /// <param name="secret">Sender secret</param>
        /// <param name="apiUrl">Optional api url</param>
        /// <returns>id</returns>
        public string LookupPhone(string phoneNo, string from, string secret, string apiUrl = APIConnector.DEFAULTAPIURL)
        {
            APIConnector apiConnector = this.CreateConnector(from, secret, apiUrl);

            return(apiConnector.LookupPhone(phoneNo));
        }