号码0月租 不限号码数量
支持正规行业,API接入

支持扫码挪车应用场景的API接入,单向隐私彻底解决隐私号被标记,车主不接外地号码的问题。

扫码挪车虚拟号

【API接口】隐私号API接口对接文档(AXE)

发布时间:2025-05-01 17:21:34 编辑:管理员

注意:

1、隐私号每次请求都必须从API获取,不需要从自己的通话记录或者绑定记录里面调用。

2、通话录音保留30天,如需永久保存,请务必下载到自己的服务器。

请求示例:

{AppSecret}:签约后技术人员会提供

{url}:yinsihao.1oc.cn

{returnurl} 需要URL编码,通话记录结果会POST至此URL。(选填)

{mobphone} 被叫手机号/或者固定电话(必填)

{bmobphone} 主叫号码(选填。尽量填写,后期可以选线路更多)

{xmobphone} 分机号,如1568(选填,解绑时必填,默认留空随机分配)

{bindtime} 绑定时长(单位分钟,如10,表示10分钟,选填)(当{bindtime} = -1,且有{mobphone}和{xmobphone}时,表示解绑这个分机号)

{cph} 车牌号(扫码挪车合作商,建议填写,其他行业不填)

CURL

curl-i-k--post--include"http://{url}/?module=yinsihao&file=apibind&action=getprivacynumber&mobphone={mobphone}&cph={cph}&bindtime={bindtime}&returnurl={returnurl}"-H"Authorization:{AppSecret}"

PHP

$host="http://{url}";
$path="/";
$method="POST";
$appsecret="{AppSecret}";
$headers=array();
array_push($headers,"Authorization:".$appsecret);
array_push($headers,"Content-Length:0");
$querys="module=yinsihao&file=apibind&action=getprivacynumber&mobphone={mobphone}&cph={cph}&bindtime={bindtime}&returnurl={returnurl}";
$bodys="";
$url=$host.$path."?".$querys;
$curl=curl_init();
curl_setopt($curl,CURLOPT_CUSTOMREQUEST,$method);
curl_setopt($curl,CURLOPT_URL,$url);
curl_setopt($curl,CURLOPT_HTTPHEADER,$headers);
curl_setopt($curl,CURLOPT_FAILONERROR,false);
curl_setopt($curl,CURLOPT_RETURNTRANSFER,true);
curl_setopt($curl,CURLOPT_HEADER,true);
if(1==strpos("$".$host,"https://"))
{
curl_setopt($curl,CURLOPT_SSL_VERIFYPEER,false);
curl_setopt($curl,CURLOPT_SSL_VERIFYHOST,false);
}
var_dump(curl_exec($curl));

JAVA

publicstaticvoidmain(String[]args){
Stringhost="http://{url}";
Stringpath="/";
Stringmethod="GET";
Stringappsecret="{AppSecret}";
Mapheaders=newHashMap();
headers.put("Authorization",appsecret);
Mapquerys=newHashMap();
querys.put("module","yinsihao");
querys.put("file","apibind");
querys.put("action","getprivacynumber");
querys.put("mobphone","{mobphone}");
querys.put("cph","{cph}");
querys.put("bindtime","{bindtime}");
querys.put("returnurl","{returnurl}");//通话记录回调地址
try{
/**
*重要提示如下:
*HttpUtils请从
*https://github.com/aliyun/api-gateway-demo-sign-java/blob/master/src/main/java/com/aliyun/api/gateway/demo/util/HttpUtils.java
*下载
*
*相应的依赖请参照
*https://github.com/aliyun/api-gateway-demo-sign-java/blob/master/pom.xml
*/
HttpResponseresponse=HttpUtils.doGet(host,path,method,headers,querys);
System.out.println(response.toString());
//获取response的body
//System.out.println(EntityUtils.toString(response.getEntity()));
}catch(Exceptione){
e.printStackTrace();
}
}

Python

importurllib,urllib2,sys
importssl
host="http://{url}"
path="/"
method="POST"
appsecret="{AppSecret}";
querys="module=yinsihao&file=apibind&action=getprivacynumber&mobphone={mobphone}&cph={cph}&bindtime={bindtime}&returnurl={returnurl}"
bodys={}
url=host+path+"?"+querys
request=urllib2.Request(url)
request.add_header("Authorization",appsecret)
ctx=ssl.create_default_context()
ctx.check_hostname=False
ctx.verify_mode=ssl.CERT_NONE
response=urllib2.urlopen(request,context=ctx)
content=response.read()
if(content):
print(content)

失败响应

{
"code":400,//指返回结果码,并非http状态码
"msg":"域名校验失败",
}

成功响应

{
"code":200,
"msg":"ok",
"data":{
"xmobphone":"17305150036",//隐私号
"sbid":"17223184122084",//唯一id号
"starttime":1722318412,//号码绑定开始时间
"endtime":1722318532,//号码绑定结束时间
}
}

通话记录POST至returnurl地址,数据如下:

{
"sbid"=>""
"sb_id"=>""//同一记录,sb_id是一样的
"xmobphone"=>""//隐私号
"bmobphone"=>""//主叫号码
"mobphone"=>""//被叫号码
"thsc"=>""//通话时长(秒)
"mid"=>""//唯一ID,查询录音转文字的时候需要
"startime"=>""//X号码绑定时间(时间戳)
"endtime"=>""//X号码有效期结束时间(时间戳)
"call_starttime"=>""//呼叫开始时间(时间戳)
"call_endtime"=>""//呼叫结束时间(时间戳)
"status"=>""//通话状态(具体查看状态码)
"recordurl"=>""//录音地址
"bj_province"=>""//被叫号码所在省份
"bj_city"=>""//被叫号码所在城市
"bj_sp"=>""//被叫号码所在运营商
"zj_province"=>""//主叫号码所在省份
"zj_city"=>""//主叫号码所在城市
"zj_sp"=>""//主叫号码所在运营商
"op_answer_time"=>""//被叫接听时间(时间戳)
}

客户端收到结果后返回:

success