API Documentation

API Documentation

Interface Description: The client API provides HTTP URL-based interfaces. Custom interfaces can be provided based on requirements. All interfaces use UTF-8 encoding.

Chapter 1  Send Interface

1.1 Request URL

The request URL is the address called by the client API program, using the HTTP POST method. The address is:

http://sms.baich.cn:8888/sms.aspx

The entry URL generally does not change. If it does, API users will be notified.   

1.2Parameter Description

http://sms.baich.cn:8888/sms.aspx?action=send

 

Parameter

Meaning

Description

userid

Enterprise ID

Enterprise ID

account

Sender Account

User account, assigned by system administrator

password

Sender Password

Password associated with the user account

mobile

Recipient Numbers

Destination mobile numbers. Multiple numbers separated by commas (half-width)

content

Message Content

SMS message content

sendTime

Scheduled Send Time

Leave empty for immediate sending. Scheduled format: 2010-10-24 09:08:10

action

Task Command

Set to fixed value: send

checkcontent

Check Illegal Keywords

Set to 1 to enable checking. Default 0 for no checking

Example:

action=send&userid=12&account=account&password=password&mobile=15023239810,13527576163&content=content&sendTime=&checkcontent=1

1.3Return Value

After receiving the client HTTP request, the result is returned in XML format:

 

<?xml version="1.0" encoding="utf-8" ?>

<returnsms>

<returnstatus>status</returnstatus> ---------- Return status: Success returns Success, failure returns: Faild

<message>message</message> ---------- Return message: see table below

<remainpoint> remainpoint</remainpoint> ---------- Return remaining balance

 

<taskID>taskID</taskID>  -----------  Return task sequence ID

<successCounts>successCounts</successCounts> --Number of successful SMS: returns the count of successfully submitted messages

</returnsms>

 

Return Message

Description

ok

Submission successful

Username or password cannot be empty

Submitted username or password is empty

Content contains SQL injection characters

Contains SQL injection characters

Username or password incorrect

Indicates incorrect username or password

Mobile number cannot be empty

Submitted mobile number is empty

SMS content cannot be empty

Sending content is empty

Contains illegal characters:

Indicates illegal characters detected that cannot be sent

Sorry, the amount to send exceeds your current balance

For prepaid accounts, insufficient account balance detected

Other errors

Other database operation errors

 

Chapter 2 Balance & Sent Count Query Interface

2.1 Request URL

The request URL is the address called by the client API program, using the HTTP POST method.

http://sms.baich.cn:8888/sms.aspx

The entry URL generally does not change. If it does, API users will be notified.   

2.2Parameter Description

Parameter

Meaning

Description

userid

Enterprise ID

Enterprise ID

account

User Account

User account, assigned by system administrator

password

Account Password

Password associated with the user account

action

Task Name

Set to fixed value: overage

Example:

action=overage&userid=12&account=account&password=password

2.3Return Value

<?xml version="1.0" encoding="utf-8" ?>

<returnsms>

<returnstatus>status</returnstatus>-------Return status: Success returns Success, failure returns: Faild

<message>message</message>--------------Return message: see table below

<payinfo>payinfo</payinfo>--------------Return payment method: postpaid or prepaid

<overage>overage</overage>-------------Return number of messages sent

<sendTotal>sendTotal</sendTotal>----Return total points. For prepaid, returns total recharge points

</returnsms>

 

Return Message

Description

Returns empty

Query successful

Will return payment method, message count used, and total recharge points

Username or password cannot be empty

Submitted username or password is empty

Username or password incorrect

Indicates incorrect username or password

 

 

Chapter 3 Illegal Keyword Check

3.1 Request URL

The request URL is the address called by the client API program, using the HTTP POST method.

http://sms.baich.cn:8888/sms.aspx

The entry URL generally does not change. If it does, API users will be notified.   

3.2Parameter Description

Parameter

Meaning

Description

userid

Enterprise ID

Enterprise ID

account

User Account

User account, assigned by system administrator

password

Account Password

Password associated with the user account

action

Task Name

Set to fixed value: checkkeyword

content

Content to Check

Content to be checked

Example:

action=checkkeyword&userid=12&account=account&password=password&content=content

3.3Return Value

<?xml version="1.0" encoding="utf-8" ?>

<returnsms>

<message>message</message>--------------Return message: see table below

</returnsms>

 

Return Message

Description

Username or password cannot be empty

Submitted username or password is empty

Username or password incorrect

Indicates incorrect username or password

Contains illegal characters

Illegal keywords detected

No illegal characters

No illegal keywords detected

 

 

 

Chapter 4 Status Report Interface

4.1 Request URL

The request URL is the address called by the client API program, using the HTTP POST method.

http://sms.baich.cn:8888/statusApi.aspx

The entry URL generally does not change. If it does, API users will be notified.   

4.2Parameter Description

Parameter

Meaning

Description

userid

Enterprise ID

Enterprise ID

account

User Account

User account, assigned by system administrator

password

Account Password

Password associated with the user account

action

Task Name

Set to fixed value: query

Example:

action=query&userid=12&account=account&password=password

4.3Return Value

<?xml version="1.0" encoding="utf-8" ?>

<returnsms>

<statusbox>

<mobile>15023239810</mobile>-------------Corresponding mobile number

<taskid>1212</taskid>-------------Same batch task ID

<status>10</status>---------Status report----10: Sent successfully, 20: Send failed

<receivetime>2011-12-02 22:12:11</receivetime>-------------Receive time

</statusbox>

<statusbox>

<mobile>15023239811</mobile>

<taskid>1212</taskid>

<status>20</status>

<receivetime>2011-12-02 22:12:11</receivetime>

</statusbox>

</returnsms>

4.4Error Return Values — Status Report Request Error Format & Codes

<?xml version="1.0" encoding="utf-8" ?>

<returnsms>

<errorstatus>

<error>1</error>-------------Error code

<remark>Username or password cannot be empty</remark>-------------Error description

</errorstatus>

</returnsms>

1: Username or password cannot be empty

2: Username or password incorrect

3: This user is not authorized to view status reports

4: Invalid parameters

Chapter 5 Inbound Message Interface

5.1 Request URL

The request URL is the address called by the client API program, using the HTTP POST method.

http://sms.baich.cn:8888/callApi.aspx

The entry URL generally does not change. If it does, API users will be notified.   

5.2Parameter Description

Parameter

Meaning

Description

userid

Enterprise ID

Enterprise ID

account

User Account

User account, assigned by system administrator

password

Account Password

Password associated with the user account

action

Task Name

Set to fixed value: query

Example:

action=query&userid=12&account=account&password=password

5.3Return Value

<?xml version="1.0" encoding="utf-8" ?>

<returnsms>

<callbox>

<mobile>15023239810</mobile>-------------Corresponding mobile number

<taskid>1212</taskid>-------------Same batch task ID

<content>Hello, I don't need it</content>---------Inbound content

<receivetime>2011-12-02 22:12:11</receivetime>-------------Receive time

</callbox>

<callbox>

<mobile>15023239811</mobile>

<taskid>1212</taskid>

<content>Hello, what is the route for this event</content>

<receivetime>2011-12-02 22:12:11</receivetime>

</callbox>

</returnsms>

5.4Error Return Values — Inbound Message Request Error Format & Codes

<?xml version="1.0" encoding="utf-8" ?>

<returnsms>

<errorstatus>

<error>1</error>-------------Error code

<remark>Username or password cannot be empty</remark>-------------Error description

</errorstatus>

</returnsms>

1: Username or password cannot be empty

2: Username or password incorrect

3: This user is not authorized to view status reports

4: Invalid parameters