产品详情
API参数 携号转网查询 调用地址: http,https://xiehaozhuanwang.api.bdymkt.com/xiehaozhuanwang 请求方式: POST 支持格式: application/x-www-form-urlencoded 调用工具: 去调试 请求参数(Headers) 请求参数(Query) 请求参数(Body)
- 名称
- 类型
- 是否必须
- 示例值
- 描述
- mobile
- string
- true
- --
- 手机号码
<dependency>
<groupId>com.baidubce</groupId>
<artifactId>api-explorer-sdk</artifactId>
<version>1.0.0</version>
</dependency>
import com.baidubce.http.ApiExplorerClient;
import com.baidubce.http.AppSigner;
import com.baidubce.http.HttpMethodName;
import com.baidubce.model.ApiExplorerRequest;
import com.baidubce.model.ApiExplorerResponse;
// 携号转网查询 Java示例代码
public class RequestDemo {
public static void main(String[] args) {
String path = "http://gwgp-vcx3jxrnzbi.n.bdcloudapi.com/xiehaozhuanwang";
ApiExplorerRequest request = new ApiExplorerRequest(HttpMethodName.POST, path);
request.setCredentials("您的 access key", "您的 secret key");
request.addHeaderParameter("Content-Type", "application/x-www-form-urlencoded");
ApiExplorerClient client = new ApiExplorerClient(new AppSigner());
try {
ApiExplorerResponse response = client.sendRequest(request);
// 返回结果格式为Json字符串
System.out.println(response.getResult());
} catch (Exception e) {
e.printStackTrace();
}
}
}
点击复制代码
正常返回示例 {"jobid":"20200426162622270271277","bizno":"000100150000598","requestsn":"1587889580334","responsetime":"20200426162627180","consumestate":"true","errcode":"C0000","errmsg":"查询成功","result":{"currentcarrier":"当前运营商","currentprovince":"当前省份","currentcity":"当前城市","originbasecarrier":"原基础运营商","isnumberportability":"是否携号转网","currentbasiccarrier":"当前基础运营商"},"encresult":""}
失败返回示例 {"jobid":"20200426162622270271277","bizno":"000100150000598","requestsn":"1587889580334","responsetime":"20200426162627180","consumestate":"true","errcode":"C0096","errmsg":"查询失败","result":{},"encresult":""}
错误码定义
