Updated on 2023-09-27 GMT+08:00

Querying the Home Area of a Number (getPhoneNoRegionInfo)

Scenario

Query the home area of a number. Mobile numbers and fixed-line phones are supported.

Method

POST

URI

https://Domain name/apiaccess/rest/cc-management/v1/phonearea/getPhoneNoRegionInfo. For example, the domain name is service.besclouds.com.

Request Description

Table 1 Request header parameters

No.

Parameter

Type

Mandatory or Not

Description

1

X-APP-KEY

String

No

App key field, which is the user ID. Contact the operation personnel to obtain the app key.

2

Authorization

String

Yes

Authentication field. The format is Bearer {Value of AccessToken returned by the tokenByAkSk interface}. (A space is required after Bearer.)

Table 2 Request body parameters

No.

Parameter

Type

Mandatory or Not

Description

1.1

phoneNo

String

Yes

11-digit mobile number or fixed-line phone number with an area code.

Response Description

  • Status code: 200
    Table 3 Response body parameters

    No.

    Parameter

    Type

    Mandatory or Not

    Description

    1.1

    returnCode

    String

    No

    Return code. The value 0 indicates success. Other values indicate failure.

    1.2

    description

    String

    No

    Return result description.

    1.3

    data

    Object

    No

    Mobile number home area information.

    1.3.1

    areaCode

    String

    No

    Area code.

    1.3.2

    province

    String

    No

    Province.

    1.3.3

    city

    String

    No

    City.

    1.3.4

    cityCode

    String

    No

    City code. Multiple city codes are separated by slashes (/). If a fixed-line phone number is queried, the city code may be empty.

    1.3.5

    isp

    String

    No

    Carrier: China Telecom, China Mobile, or China Unicom.

    For fixed-line phone query, a result indicating the carrier is unknown is returned.

    1.3.6

    postCode

    String

    No

    Postal code. Multiple city codes are separated by slashes (/). If a fixed-line phone number is queried, the postal code may be empty.

    1.3.7

    phoneNo

    String

    No

    First seven digits of a mobile number or area code of a fixed-line phone

  • Status code: 401

    Authorization failed: 1. Whether the parameter is correct and valid. 2. Check whether you have purchased related services. 3. Contact customer service to check the status of your account.

  • Status code: 404

    The request path may be incorrect.

  • Status code: 500

    The service fails or an internal exception occurs on the server due to incorrect parameters.

Error Codes

None

Example

Request header:

Content-Type: application/json
X-APP-KEY: **************************************
Authorization: Bearer **************************************

Request parameters:

{"phoneNo":"13020017****"}

Response parameters:

{
  "returnCode": "0",
  "data": {
    "areaCode": "110100",
    "province": "Beijing",
    "city": "Beijing",
    "cityCode": "010",
    "isp": "China Unicom",
    "postCode": "100000",
    "phoneNo": "1302001"
  },
  "description": "success"
}