请求示例:
{AppSecret}:签约后技术人员会提供
{url}:yinsihao.1oc.cn
{mid}: 通话记录中有mid的值
CURL
curl -i -k --get --include 'http://{url}/?module=yinsihao&file=apicalllog&job=record2text&mid={mid}' -H 'Authorization:你自己的AppSECRET'PHP
$host="http://{url}";
$path="/";
$method="GET";
$appsecret="{AppSecret}";
$headers=array();
array_push($headers,"Authorization:".$appsecret);
$querys="module=yinsihao&file=apicalllog&job=record2text&mid={mid}";
$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
public static void main(String[] args) {
String host = "http://{url}";
String path = "/";
String method = "GET";
String appsecret = "{AppSecret}";
Mapheaders = new HashMap();
headers.put("Authorization",appsecret);
Mapquerys = new HashMap();
querys.put("module", "yinsihao");
querys.put("file", "apicalllog");
querys.put("job", "record2text");
querys.put("mid", "{mid}");
try {
HttpResponse response = HttpUtils.doGet(host, path, method, headers, querys);
System.out.println(response.toString());
//获取response的body
//System.out.println(EntityUtils.toString(response.getEntity()));
} catch (Exception e) {
e.printStackTrace();
}
}Python
import urllib, urllib2, sys
import ssl
host = 'https://{url}'
path = '/'
method = 'GET'
appsecret = "{AppSecret}";
querys = 'module=yinsihao&file=apicalllog&job=record2text&mid={mid}'
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": {
"mid": "176769599998517",
"speechtotext": "喂哎你好"
}
}


