Cell Phone Number Service (CPNS) provides API operations that you can call to query the status of phone numbers based on your business requirements. This helps you simplify business operations and manage costs. You can integrate CPNS with your business systems by using programming methods. This topic describes the basic information and precautions for calling API operations to perform debugging on CPNS.
OpenAPI Explorer introduction
Alibaba Cloud provides OpenAPI Explorer for you to efficiently understand and use the API operations of various Alibaba Cloud services. OpenAPI Explorer integrates the following features for API operations: intelligent search, documentation, online debugging, SDK obtaining, CodeSample, call error diagnosis, and call statistics. In OpenAPI Explorer, you can call API operations of Alibaba Cloud services and view API requests and responses. In addition, OpenAPI Explorer automatically generates the corresponding SDK sample code to facilitate use of Alibaba Cloud services. For more information, see What is an API?
Version description
CPNS provides API operations that you can call to query phone number status, query ported phone numbers, query registration locations of phone numbers, and verify user information. This allows you to integrate CPNS with your business system.
Alibaba Cloud APIs use version numbers to manage the lists of operations of major versions of cloud service APIs.
For example, CPNS currently supports the list of operations of version 2023-01-01
. 2023-01-01
is an API version number rather than a date. Users are presented with the latest public information about the API. 2023-01-01
is not the last update date of the API.
API version | Description |
We recommend that you use this version of API operations. |
Online debugging
CPNS provides features such as API debugging in OpenAPI Explorer. Before you call API operations, you must understand the following information provided by CPNS: versions, endpoints, API styles, and calling methods.
Debugging
You can perform API debugging at https://api.alibabacloud.com/api/Dytnsapi/2023-01-01/.
Endpoint description
Select an endpoint based on the region where your resource resides to reduce latency.
The global endpoint is dytnsapi.aliyuncs.com
. For more information, see Endpoints.
Identities
After you log on to OpenAPI Explorer with your Alibaba Cloud account, OpenAPI Explorer uses your Alibaba Cloud account to debug API operations online by default.
Identity | Supported |
Yes | |
No | |
No |
Integration methods
CPNS allows you to integrate CPNS with your business systems by using different integration methods such as SDKs based on your business requirements.
Alibaba Cloud SDKs
Alibaba Cloud provides SDKs in multiple programming languages, including Java, C#, Go, Python, TypeScript + Node.js, PHP, and C++. API operations can be directly called through the SDKs integrated into your applications. SDKs encapsulate information including signature logic, timeout mechanism, and retry mechanism and return structured response objects based on specifications, which provide convenience for developers. For more information, see Alibaba Cloud SDKs.
For more information about the supported SDKs in different programming languages and the installation of dependencies, see SDK reference.
Alibaba Cloud CLI
Alibaba Cloud Command Line Interface (Alibaba Cloud CLI) allows you to use
aliyun
commands to interact with other Alibaba Cloud services to manage your Alibaba Cloud resources. For more information, see What is Alibaba Cloud CLI?Alibaba Cloud CLI cannot be used to call CPNS.
ROS
Resource Orchestration Service (ROS) is an Alibaba Cloud service that can simplify the management of cloud computing resources. You can create a template to describe the cloud computing resources such as Elastic Compute Service (ECS) and ApsaraDB RDS instances that you need, as well as the relationship between the resources. ROS automatically creates and configures all the resources based on the template to implement automated deployment and O&M. For more information, see What is ROS?
ROS cannot be used to call CPNS.
Encapsulation of requests for API operations
If none of the preceding methods meets your business requirements, you can encapsulate requests for API operations and call the corresponding operation. This method is not recommended. For more information, see Request syntax and signature method V3.
Usage notes
If an error is returned after you call an API operation of Cell Phone Number Service, you must check whether the request parameters and values are valid based on the returned error code. For more information, see Cell Phone Number Service - Error Codes.
You can also visit OpenAPI problem diagnosis to perform self-service diagnostics based on the returned request ID or SDK error information.