调用DescribePhoneNumberAttribute接口获取号码当前服务运营商、归属地和携号转网信息。

使用说明

本接口用于获取号码当前服务运营商、归属地和携号转网信息。

QPS限制

本接口的单用户QPS限制为6000次/秒。超过限制,API调用会被限流,这可能会影响您的业务,请合理调用。

授权信息

默认仅限阿里云账号使用本接口,RAM用户只有在被授予了相关API操作权限后方可使用。具体请参见RAM用户权限

调试

您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。

请求参数

名称 类型 是否必选 示例值 描述
Action String DescribePhoneNumberAttribute

系统规定参数。取值:DescribePhoneNumberAttribute

PhoneNumber String 1511234****

要查询的手机号码。

返回数据

名称 类型 示例值 描述
Code String OK

请求状态码。取值:

  • OK:成功。
  • isp.NUMBER_NON_EXISTENT:传入的手机号查不到归属结果。
  • isv.INVALID_PARAMETERS:非法参数。
  • isp.SYSTEM_ERROR:网元系统异常。
  • isp.QPS_LIMIT:触发QPS限制。
Message String OK

状态码的描述。

RequestId String CC3BB6D2-2FDF-4321-9DCE-B38165CE4C47

请求ID。

PhoneNumberAttribute Object

号码归属信息。

BasicCarrier String 中国移动

基础运营商。详细说明,请参见下表字段含义。取值:

  • 中国移动
  • 中国联通
  • 中国电信
Carrier String 中国移动

实际运营商(含虚拟运营商),如果存在携号转网,则为携转后的运营商。详细说明,请参见下表字段含义。

IsNumberPortability Boolean false

是否携号转网。

NumberSegment Long 1511234

号段。

City String 杭州

号码归属城市。

Province String 浙江

号码归属省份。

BasicCarrier和Carrier字段含义:

手机号段归属

是否有携号转网

BasicCarrier字段返回结果

Carrier字段返回结果

基础运营商号段

携转后基础运营商(中国移动、中国联通、中国电信)

携转后基础运营商(中国移动、中国联通、中国电信)

基础运营商号段

基础运营商(中国移动、中国联通、中国电信)

基础运营商(中国移动、中国联通、中国电信)

虚拟运营商号段

暂不支持

基础运营商(中国移动、中国联通、中国电信)

虚拟运营商(如:阿里云通信等)

示例

请求示例

http(s)://dytnsapi.aliyuncs.com/?Action=DescribePhoneNumberAttribute
&PhoneNumber=1511234****
&公共请求参数

正常返回示例

XML格式

HTTP/1.1 200 OK
Content-Type:application/xml

<DescribePhoneNumberAttributeResponse>
    <Code>OK</Code>
    <Message>OK</Message>
    <RequestId>CC3BB6D2-2FDF-4321-9DCE-B38165CE4C47</RequestId>
    <PhoneNumberAttribute>
        <BasicCarrier>中国移动</BasicCarrier>
        <Carrier>中国移动</Carrier>
        <IsNumberPortability>false</IsNumberPortability>
        <NumberSegment>1511234</NumberSegment>
        <City>杭州</City>
        <Province>浙江</Province>
    </PhoneNumberAttribute>
</DescribePhoneNumberAttributeResponse>

JSON格式

HTTP/1.1 200 OK
Content-Type:application/json

{
  "Code" : "OK",
  "Message" : "OK",
  "RequestId" : "CC3BB6D2-2FDF-4321-9DCE-B38165CE4C47",
  "PhoneNumberAttribute" : {
    "BasicCarrier" : "中国移动",
    "Carrier" : "中国移动",
    "IsNumberPortability" : false,
    "NumberSegment" : 1511234,
    "City" : "杭州",
    "Province" : "浙江"
  }
}

错误码

HttpCode 错误码 错误信息 描述
400 InvalidParameter The specified parameter is invalid. 非法参数
400 PhoneNumberNotfound The queried number is not found. 传入的手机号未查到归属结果
400 OutOfService The ISV is out of service. 业务已停机
400 Product.Unsubscript You have not subscribed to the specified product. 未订阅该功能
400 Queries.Repeated You can only query phoneNumber once every 60 seconds. 60秒内重复查询
400 Ram.PermissionDeny You are not authorized to perform the operation. 权限不足
400 System.LimitControl The system is under flow control. 系统限流控制
400 Unknown.ResourceOwnerId The resource does not belong to the current user. 资源不属于当前用户
400 InvalidParameter The specified mobile phone number is invalid. 非法号码
400 Ram.CheckFailed You did not pass the ARM permission check. RAM权限校验失败
400 Product.NotOrdered You have not ordered this product (offer). 未订购该产品

访问错误中心查看更多错误码。