OZEKI
NG SMS Gateway
"The World's most reliable SMS gateway software!"
info@ozekisms.com
Tel.: 00 36 52 532 731
Overview Quick start Download Manual How to buy FAQ Contact Us
OZEKI NG SMS Gateway - Product Guide

setcredits Contents | SearchUrlencode

Home > Product Manual > Developers Guide > HTTP SMS API > Billing methods > addcredits

SMS Gateway SMS Gateway Home

  Product Manual
  Introduction
  SMS technology
  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 Sharp 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
  FAQ
  Feature list
  Commercial Information
  Search
 


Automated phone calls?
Ozeki Phone System XE VoIP PBX software is an advanced PBX built for automated voice calls and 2 way SMS messaging. It has outstanding APIs for software developers. It can be used for:

Phone calls from SQL
Phone calls from HTTP
Voice and SMS applications

Callcenter developers
If you are working on telephone solutions, please check out the Ozeki VoIP SIP SDK.
It can be used to create VoIP client and server software.

Contact Us!
If you wish to get further information, do not hesitate to contact us!

E-mail: info@ozekisms.com

If you have a technical question, please submit a support request on-line.

HTTP SMS API - addcredits

(available in version: Ozeki NG SMS Gateway v3.0.1 or newer)

This method can be used to add or deduct credits from the balance of a user. The credit limit of a user specifies how many messages the user can send and receive. If you use want to increase or decrease the balance, use this method. This method is better then the setcredits method if you want to do a relative change in the balance, because you don't have to worry about messages being sent in the time between your query and your update of the current balance.

Example URL Request

http://127.0.0.1:9501/api?action=addcredits&username=admin&password=abc123&useraccount=john&add=244

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>getcredits</action>
   <data>
      <account>
         <username>john</username>
         <balance>744</balance>
      </account>
   </data>
</response>

Description

To add credits to the balance of a user account use the following URL format:

http://127.0.0.1:9501/api?action=addcredits&username=UUUUU&password=PPPPP&useraccount=AAAAA&add=VVVVV

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 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 will be changed, should be substituted for AAAAA. The amount you want to add should be put into VVVVV. If you want to take credits away, VVVVV should be a negative number.

Request parameters

Parameter Description Possible values Example M/O*
action Specifies the HTTP API command addcredits action=addcredits 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 urlencoced. string value, maximum length is 16 characters password=abc123 M
useraccount Specifies the name of the user account, whose balance is going to be increased or decreased. 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
add Specifies the amount that should be added to the user account. Use a positive number to increase the balance, or set this parameter to a negative number and the balance of the user account will be decreased. int value add=244 M

* M = Mandatory parameter, O = Optional parameter

Response parameters
(xml response format)

Parameter Description Possible values Example
account Contains the balance of a user account in an XML structure  
 <account>
         <username>john</username>
         <balance>744</balance>
      </account>
account.username Identifies the user account. string value, maximum length is 16 characters <username>john</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>744</balance>




Next page: Urlencode
Copyright © 2000 - 2014 Ozeki Informatics Ltd.
All rights reserved

Software PBX for Windows | VoIP SDK   |   Legal information   |   Privacy policy   |   Terms of use
Please, address your inquiries to info@ozekisms.com