China Telecom has recently opened its capability platform. Now this project is in beta1 state. Using the capability platform, developers can easily call the various capabilities provided by China Telecom through a unified API, including voice call (multi-party calls), SMS, IVR, and GpsOne positioning capabilities, and integrate these capabilities into their own special applications, through the MM platform of China Telecom, we promote, sell, and obtain profits from 3G users of China Telecom. Compared with the iPhone and Android platforms, the capability Open Platform of China Telecom is closer to the operator's core business and can be used rationally to create more unique applications.
This article uses a text message application as an example to see how simple it is.
Step 1: register a user as an AP of the Capability opening platform;
Step 2: Open the platform for user login capability;
Step 3: purchase the SMS capability interface ;(Free during Beta)
Step 4: Call the capability Open Platform authentication interface to obtain the authentication code;
Step 5: Call the SMS sending interface after obtaining the authentication code.
Interface Description
Authentication Interface :
AuthrequestvalueThe format is as follows:
Timestamp + "$" + apid + "$" + apuseraccount + "$" + funid + "$" + authenticator
The generation of authenticatorAlgorithmAs follows:
Authenticator = base64 (sha1 (timestamp + "$" + apid + "$" + apuseraccount + "$" + funid + "$" + apkey ))
The apkey is the key issued to the AP by the capability opening platform.
Response Message
AuthresponsevalueThe format is as follows:
Result + "$" + transactionid + "$" + token + "$" + errordescription + "$" + Timestamp
SMS sending interface:
WhereSendmsgrequestvalueThe format is as follows:
Token + "$" + phone + "$" + MSG + "$" + from
Response Message
SendmsgresponsevalueFormat:
Result
Application access
Access Process Overview
When an application is connected to the capability open platform, the following two aspects are involved:
(1) The application complies with the application access specifications of the Capability opening platform and can obtain the user's apkey from the capability opening level.
(2) The application complies with the API access specifications of the Capability Open Platform and can call a wide range of API interfaces provided by capability open platform.
To connect an application to a capability-based Open Platform, follow these three steps:
(1). Apply for an AP account through the capability opening platform
(2). Call the authentication interface to obtain the authentication code
(3). Use the obtained authentication code to call the API
Development Instance
C # example
Public Void Sendmsg (){ // 1. Call the capability control authentication interface to obtain the token String Authresult = Amcpforap. Auth (authinterfaceurl, apid, funcid, apuserid, apkey ); String [] Authresults = Authresult. Split ('$ '); Int Result = Int32.parse (authresults [ 0 ]); If (Result = 0 ){ // Verification Code String Token = Authresults [ 2 ]; // Receiving number String Num1 = " 13888888888 " ; // Message Content String MSG = " Hello " ; // Send phone number String From = "" ; // Send message This . Send (token, num1, MSG, from );} // 2. If the user does not exist, call the registration interface to register Else If (Result = - 10020 ){ String [] Registerresults = Amcpforap. apuserregister (int32.parse (apid), apuserid, " 02888888888 " , Apkey, " Http: // localhost/interfaceforap. asmx " ). Split ('$ '); Int Registerresult = Int32.parse (registerresults [ 0 ]); If (Registerresult ! = 0 ){ Return ;} // 3. Call the capability control authentication interface again to obtain the token. Authresult = Amcpforap. Auth (authinterfaceurl, apid, funcid, apuserid, apkey); authresults = Authresult. Split ('$'); Result = Int32.parse (authresults [ 0 ]); If (Result = 0 ){ // Verification Code String Token = Authresults [ 2 ]; // Receiving number String Num1 = This . Txtphonenumber. Text. Trim (); // Message Content String MSG = This . Txtmsg. Text. Trim (); // Send phone number String From = "" ; // Send message This . Send (token, num1, MSG, from );} Else { Return ;}} Else { Return ;}} Private Void Send ( String Token, String Num1, String MSG, String From ){ // Generate request string String Sendmsgrequest = " Http: // 118.123.249.4/IMS/ghsendim. php? Sendmsgrequest = " + Token + " $ " + Num1 + " $ " + Psocryptography. convertstringtobase64string (MSG) + " $ " + From; This . Textbox1.text = Sendmsgrequest; // Send SMS String Sendresult = Amcpforap. getpagefromurl (sendmsgrequest ); If ( ! Sendresult. indexof ( " 200 " ) > 0 ){ // Failed to send Return ;}}
FAQs
1. What is AP?
A: Application Service Provider.
2. What is a token?
The Credential generated by the capability Control Platform, which must be presented when the AP calls the capability.
3. Do you have any qualification requirements for registering as a capability opening platform user?
A: You only need a fixed mobile phone number and a personal ID card number.
4. Formal Environment Introduction
A: In the formal environment, developers operate on real data. The operations performed will affect the real transaction data. The application can only access the official environment in the online test and running status, and the number of calls will be limited.
Good news
If you are using a Tianyi mobile phone, if you want to develop the 3G business of China Telecom, join us,
Capability Open Platform address: http://www.ctopen.cn/hurry to register, most of the capabilities during beta are free.
If you are interested in writing a blog about the capability opening platform, please contact me and have the opportunity to getFree long talkBig Gift Packs