这个集成,能说一下,服务端
MessagePreventionResponse response = client.GetAcsResponse(request);
这个
response,我要判断哪些返回信息,才能确定别人在盗刷短信呢
如果不是用的阿里云短信服务,也能用这个业务风控来监测发验证码的界面吗?
using System;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using System.Collections.Generic;
using System.Collections;
using Aliyun.Acs.Core;
using Aliyun.Acs.Core.Profile;
using Aliyun.Acs.Jaq.Model.V20161123;
namespace UnitTestProject1
{
/// <summary>
/// 其他业务风险防控接口详情:https://help.aliyun.com/document_detail/47493.html
/// </summary>
[TestClass]
public class TestMessagePrevention
{
IAcsClient client = null;
[TestInitialize]
public void SetUp()
{
//YOUR ACCESS_KEY、YOUR ACCESS_SECRET请替换成您的阿里云accesskey id和secret
IClientProfile profile = DefaultProfile.GetProfile("cn-hangzhou", "YOUR ACCESS_KEY", "YOUR ACCESS_SECRET");
client = new DefaultAcsClient(profile);
DefaultProfile.AddEndpoint("cn-hangzhou", "cn-hangzhou", "Jaq", "jaq.aliyuncs.com");
}
[TestMethod]
public void Test()
{
MessagePreventionRequest request = new MessagePreventionRequest();
// 必填参数
request.PhoneNumber = "";
request.Ip = "客户端来源IP";
request.ProtocolVersion = "1.0";
request.Source = 1;//业务风险来源。1:PC网页;2:移动网页;3:android ;4:其它; 5: ios
request.JsToken = "";//对应前端页面的afs_token,source来源为1&2&4时,必填;
request.SDKToken = "";//对应sdk中获取的wtoken,source来源为3&5时,必填;
// 选填参数
request.Email = "";
request.UserId = "";
request.IdType = 1;
request.CurrentUrl = "";
request.Agent = "";
request.Cookie = "";
request.SessionId = "";
request.MacAddress = "";
request.Referer = "";
request.UserName = "";
request.CompanyName = "";
request.Address = "";
request.IDNumber = "";
request.BankCardNumber = "";
request.RegisterDate = 123L;
request.RegisterIp = "";
request.LoginDate = 1L;
request.LoginIp = "";
request.ExtendData = "";
try
{
MessagePreventionResponse response = client.GetAcsResponse(request);
// TODO
}
catch (Exception e)
{
Console.WriteLine(e.ToString());
}
}
}
}