|
||||||||||||||||||
Account Query Web Services HTTP API |
||||||||||||||||||
|
Using the Account Query Web Services you can programatically, and securely, query your account(s) to determine various pieces of information such as your account balance. These can be very useful when writing your own applications that leverage our messaging gateway, for example. This document assumes you are already familiar with the HTTP Web Services API and how to use it. If you have not read this, please do so prior to trying to use these services. We strongly urge you to use HTTPS when connecting to our servers and to use HTTP POST instead of GET. By doing so you will ensure you have a secure connection over which to send your account details and messages. Available CreditYou must specify your account Username and PIN number, along with the empty AvailableCredit tag.
If the Username and PIN are correct the response will include the credit on that account.
For example: POST /webservices/http/queryaccount HTTP/1.1Host: www.csoft.co.uk:80 Content-Type: application/x-www-form-urlencoded; charset="utf-8" Content-Length: 64 Username=ANOther.12345&PIN=123456&AvailableCredit= The response will be your available credit AvailableCredit=GBP 15.2345 An incorrect Username or PIN would return MessageIdentifier=-1&Report=2&Text=Invalid%20Login | ||||||||||||||||||
Available MessagesYou can query your approximate available premiere messages. You must include your Username and PIN to identify the account and to authenticate yourself. Note that this is the number of premier messages, not economy messages, and that the calculation of your messages is done using the current tariff you are on at that moment.
If the Username and PIN are correct the response will include the messages on that account.
POST /webservices/http/queryaccount HTTP/1.1 Host: www.csoft.co.uk:80 Content-Type: application/x-www-form-urlencoded; charset="utf-8" Content-Length: 64 Username=ANOther.12345&PIN=123456&AvailableMessages= The response will be your approximate available messages AvailableMessages=1002 An incorrect Username or PIN will return MessageIdentifier=-1&Report=2&Text=Invalid Login | ||||||||||||||||||
Permitted ReplyTo ListYou can get a list of valid ReplyTo values for your account by using the PermittedReplyTo call with the account Username and PIN. The ReplyTo field is used when sending messages and is where the messages appear to come from when read by the recipient. If you have two-way numbers or an Originator Address configured, these will be returned by this call. These values can be used in a drop-down list, for example, in your own application/website.
If the Username and PIN are correct the response will include the values you are permitted to use in the ReplyTo when sending messages.
POST /webservices/http/queryaccount HTTP/1.1 This will produce a response which includes a comma separated list of valid values.
HTTP/1.1 200 OK Dealing with Errors
|
||||||||||||||||||
|
|
||||||||||||||||||