- Product Manual
- Introduction
- Installation Guide
- User Guide
- Developers Guide
- Tutorials
- ASP SMS API
- PHP SMS API
- HTTP SMS API
- Send message
- Receive message
- Billing methods
- getcredits
- setcredits
- addcredits
- Urlencode
- Select operator
- Operate with single message
- Query the addressbook
- Operations with message folders
- Examples
- User handling
- Service Provider Connection Handling
- Reporting API
- Dynamic SMPP parameters
- SQL SMS API
- C# SMS API
- AJAX SMS API
- Delphi SMS API
- Cpp SMS API
- Java SMS API
- VB.NET SMS API
- Python SMS API
- Perl SMS API
- TCL/TK SMS API
- Coldfusion SMS API
- VB 6 SMS API
- Examples and Solutions
- Appendix
- SMS FAQ
- Feature list
- Commercial Information
- Search
Ozeki brings you outstanding
SMS Gateway technology. Use our SMS Server products on Windows,Linux, or Android
C# SMS API
Developers can use our C# SMS API to send SMS from C#.Net. The C# SMS API comes with full source code
PHP SMS API
The ozeki PHP SMS gateway software can be used to send SMS from PHP and to receive SMS usig PHP on your website
SMPP SMS Gateway
SMS service providers use our SMPP gateway solution, that offers a high performance SMPP server and SMPP client gateway with amazing routing capabilities
HTTP SMS API - setcredits
(available in version: Ozeki NG SMS Gateway v3.0.1 or newer)
This method can be used to modify the balance of a user account. The credit limit of a user account specifies how many messages the user can send and receive. You can use the setcredits method to set the balance to a specific value.
Example URL Request
http://127.0.0.1:9501/api?action=setcredits&username=admin&password=abc123&useraccount=admin&newbalance=500
Example Response
HTTP/1.1 200 OK Content-Type: application/xml Content-Length: 824 <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE smsapi PUBLIC "-//OZEKI//DTD XML 1.0//EN" "http://www.ozekisms.com/DTD/smsapi.xml"> <response> <action>setcredits</action> <data> <account> <username>admin</username> <balance>500</balance> </account> </data> </response>
Description
To modify the credit limit of a user account use the following URL format:
http://127.0.0.1:9501/api?action=setcredits&username=UUUUU&password=PPPPP&useraccount=AAAAA&newbalance=BBBBB
For 127.0.0.1, you should substitute the host name or the IP address of the computer your SMS gateway is installed on. The port number 9501 is the default HTTP port number of the Ozeki NG SMS gateway.
The username and the password of the admin account should be substituted for "UUUUU" and "PPPPP". No other users can modify the credit limits of an account. The username of the account whose balance is about to be updated, should be substituted for AAAAA. The new balance should be specified in the newbalance parameter (BBBBB).
If the newbalance parameter is left empty the balance will not be modified.
Request parameters
Parameter | Description | Possible values | Example | M/O* |
action | Specifies the HTTP API command | setcredits | action=setcredits | M |
username | This should be set to "admin", since only the admin account can update credit information in the server. | string value, maximum length is 16 characters | username=admin | M |
password | This should be set to the "password" of admin, since only the admin account can update credit information in the server. The password should be urlencoded. | string value, maximum length is 16 characters | password=abc123 | M |
useraccount | Specifies the name of the user account, whose balance is going to be changed. If this parameter is not specified, the balance of the admin account will be changed. | string value, maximum length is 16 characters | useraccount=john | O |
newbalance | Specifies the new balance. The balance of the user account identified by the useraccount parameter will be changed to this value. If this parameter is not specified, the balance of the user account will not be changed. | int value | newbalance=500 | M |
Response parameters
(xml response format)
Parameter | Description | Possible values | Example |
account | Contains the balance of a user account in an XML structure | <account> <username>admin</username> <balance>123</balance> </account> |
|
account.username | Identifies the user account. | string value, maximum length is 16 characters | <username>admin</username> |
account.balance | Contains the balance of the user account after the change. If this value is less then or equal to zero, the user cannot send SMS messages. | integer value | <balance>123</balance> |
More information
- HTTP SMS API
- HTTP SMS API - sendmessage method
- HTTP SMS API - receivemessage method
- HTTP SMS API - billing method
- HTTP SMS API - getcredits
- HTTP SMS API - setcredits
- HTTP SMS API - addcredits
- Supported character sets
- FAQ of the Ozeki NG SMS Gateway