/// <summary> /// 完成验证后,用BizToken调用本接口获取结果信息,BizToken生成后三天内(3\*24\*3,600秒)可多次拉取。 /// </summary> /// <param name="req"><see cref="GetDetectInfoRequest"/></param> /// <returns><see cref="GetDetectInfoResponse"/></returns> public GetDetectInfoResponse GetDetectInfoSync(GetDetectInfoRequest req) { JsonResponseModel <GetDetectInfoResponse> rsp = null; try { var strResp = this.InternalRequestSync(req, "GetDetectInfo"); rsp = JsonConvert.DeserializeObject <JsonResponseModel <GetDetectInfoResponse> >(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return(rsp.Response); }
public DetectInfo GetDetectInfo(string bizToken, string ruleId = "") { if (string.IsNullOrEmpty(ruleId)) { ruleId = Options.CurrentValue.RuleId; } ClientProfile clientProfile = new ClientProfile(); HttpProfile httpProfile = new HttpProfile(); httpProfile.Endpoint = "faceid.tencentcloudapi.com"; clientProfile.HttpProfile = httpProfile; FaceidClient client = new FaceidClient(GetCredential(), Options.CurrentValue.Region, clientProfile); GetDetectInfoRequest req = new GetDetectInfoRequest(); string strParams = new { RuleId = ruleId, BizToken = bizToken }.ToJson(); req = GetDetectInfoRequest.FromJsonString <GetDetectInfoRequest>(strParams); GetDetectInfoResponse resp = client.GetDetectInfoSync(req); var res = resp.DetectInfo.DeserializeJson <DetectInfo>(); res.DetectInfoContent = resp.DetectInfo; return(res); }