REVISION HISTORY | ||
---|---|---|
Ver | Description of Change | Implementation Date |
1.0 | Initial release | 2024.06.20 |
1.01 | Added IX.4 Save on resources | 2024.08.07 |
1.02 | Added tid and ctxid fields as response of Transaction Callback. (The fields were already present but was forgotten on the documentation) |
2024.11.24 |
This document covers the following:
If you discover any security vulnerabilities, please report them immediately to ^DOMAINDESC^ admin.
This document is strictly confidential and is covered by NDA. Distribution of this document in any form will require written permission from ^DOMAINDESC^.
The following configuration is the quickest way to start using the API services:
This is not the most secure setup. Please read the remaining of the API document (particularly Chapter V - Setting up) to know more how to secure your connection.
At this point, you can start performing API request. There are three API commands available:
To perform account balance inquiry, you can use the following codes:
Loading, please wait...
Edit the above code and replace the User Name and Password with the one from API Account Management
Upon execution, the API system will return JSON format response:
Loading, please wait...
If there are no errors, you will receive a result similar to the above. The fields are described as follows:
If there are errors, the rescode will be a non-zero number and the ab, cb, and curr fields will be absent from the result. Refer to rescode list for the complete list.
To perform load request, you can use the following codes:
Loading, please wait...
Just like in the bal command, replace User Name and Password with the one from API Account Management.
There are three (3) additional fields required by load command, these are :
For the pcode field, you can use TSTS5 as product. Normally, the test product TSTS5 will be made available for you, if not, please contact ^DOMAINDESC^ admin. For this test product, it does not matter what you put in dst field, but it needs to have a value or it will return an error or a non-zero rescode.
Finally, edit the ctxid with your own tracking ID and make sure your ctxid is unique for each load request or it will return an error. Only characters a-z, A-Z, 0-9, underscore (_), dash (-), and period (.) is allowed, any other characters will be filtered out. The ^DOMAINDESC^ system checks for duplicate ctxid for the last 2 hours. If you use the same ctxid within the last 2 hours, it will return a 131 rescode or "duplicate request error".
Upon execution, the API system will return JSON format response:
Loading, please wait...
If there are no errors, you will receive a result similar to the above. The fields are described as follows:
The status field will normally return QUEUED and the tid is the assigned Transaction ID for this request. Take note of the tid field, this is required when performing the next step, which is the status command.
If there are errors, the rescode will be a non-zero number and the status and tid fields will not be present from the response. Refer to rescode list for the complete list.
To perform status query, you can use the following codes:
Loading, please wait...
Just like in the bal command, replace User Name and Password with the one from API Account Management.
An additional field is required by status command:
The tid field, comes from your previous load command as server response.
Please note that you can only use the
Upon execution, the API system will return JSON format response:
Loading, please wait...
If there are no errors, you will receive a result similar to the above. The fields are described as follows:
The result can be grouped into three (3) parts:
The complete list of Response Messages and Statuses can be viewed from their respective dedicated pages.
If there are errors in the API request, the rescode will be a non-zero number and only rescode and resmsgfields are available. Refer to rescode list for the complete list.
Please take extra attention to the following detail in the next paragraph.
As mentioned earlier, the res group (i.e. rescode and resmsg) are the result of API request. A rescode of 0 means there were no errors in the API request. The status group are the status of the load request. For example, below is an example of a successful API command (hence, rescode=0), but the load request failed (status_id=-1), with the respmsg_code being "TELCO_DECLINED".
Loading, please wait...
It is also possible to receive the following status command result when you invoke the status command too early after issuing the load command.
Loading, please wait...
This means the load request is still being processed. Typically, a load request is fulfilled after 15 to 20 seconds. The best practice is to use the Transaction Callback. If you want to use the status command, wait 15 seconds after the load command and poll every 15 to 20 seconds after.
load command -> wait 15 to 20 seconds -> status command -> poll every 15 to 20 seconds.
The first step is to create an API account, this is done by
going through
API Account Management and clicking the
button
at the lower part of the page. You will then be presented with a form
asking for Name and Detail.
The Name and Detail fields does not hold any
importance when performing API transactions. The Name field
will be used on tables and pulldown list and the Detail field
can be used as personal notes for the API account. Click the "add" button
at the button of the form to complete this process.
Next is to edit your API account to configure some settings and preferences. To edit, click the edit button at the left side of the table entry. It will go to a page with more setting options for your API account.
The first information you will see is the apicode. Upon creating an API Account, the system will generate a unique code designated as apicode. Depending on your selected Authentication Mode, you may or may not need to use the apicode.
This API comes in three (3) authentication modes. Depending on the selected mode, the required parameter changes. Below are the list of Authentications Modes with detailed description and required fields to send to the API system.
This is the most basic authentication mode, and is also the most unsecure method. The authentication only requires username and password. You can type your desired username and password at the designated fields. You can also use the generate button () to automatically generate a secure password.
During API request call, the username and password will be sent directly as parameters.
Field Name | Field Value |
---|---|
username | User Name |
passwd | Password |
This authentication mode is more secure than the Standard UN/PW Pair, but the procedure is also more complex. Similar with the Standard UN/PW Pair, you can type your desired username and password at the designated fields. You can also use the generate button () to automatically generate a secure password.
During API request call, you will need to send apicode and auth fields instead of username and password.
Field Name | Field Value |
---|---|
apicode | API Code |
auth | SHA256( User Name + SHA256(Password) ) |
As mentioned under V.1 API Information, the apicode is generated and the first item when you edit your API Account.
The auth field is generated by first performing SHA256 on the password, then concatenate username and the SHA256 password. Finally, perform SHA256 on the concatenated string. The apicode and final SHA256 data designated as auth will be sent as parameters to the API webhook.
Token-based authentication is similar to SHA256 UN/PW Pair but instead of the client providing the username and password fields, the API system will generate the token utilizing the full 32-characters making it harder to guess. Token-based authentication is as secure (or even more secure depending on how complex the username and password) than the SHA256 UN/PW Pair and less complicated to setup.
During API request call, you will need to send apicode and token fields instead of username and password.
Field Name | Field Value |
---|---|
apicode | API Code |
token | Token |
Remember to save your password and token. ^DOMAINDESC^ does not save your passwords and tokens in clear text. They are hashed using SHA256 before being sent to the servers for storage. This means you cannot retrieve your passwords and tokens from this page or anywhere else. If you forget your passwords or tokens, you will need to regenerate them.
This API comes in two (2) security modes.
This mode relies only on your selected authentication mode. As soon as the API client sends the load command, the API system will immediately process the request.
Callback Authentication is similar to Two-Factor Authentication
or 2FA. The purpose of this Security Mode is to confirm the request
made by remote server to ensure that the request is valid, authorized, and intentional.
The API System will connect to the clients' system to confirm the request made by the client. This only works with load command. Upon sending a load command, the API system will send the following information to the Security Callback URL:
Field Name | Field Value |
---|---|
ctxid | Client Transaction ID |
For Lucidy API, it is expected that the client's system will validate the ctxid sent to the Security Callback URL. The client's system must respond with "ctxid approved". Any response will result a non-zero rescode.
When this mode is selected, Security Callback URL field will appear and is required. This is the client's system that will validate the request.
This is the list of IP Addresses that will be allowed to perform API request for this API account. Ensure you only type one IP per line or it will cause problem blocking all your request. Just leave this field blank if you do not want to use IP Whitelisting.
Do not rely on IP Whitelisting as security measure, there are ways to spoof the IP Address. Best practice is to use strong Authentication Mode such as SHA256 UN/PW Pair or Token-based and use Security Callback.
This is where the API system will send the status of your previously initiated transaction through the load command.
The Transaction Callback URL is optional, if you do not provide the URL, you can still get the status of your load command by polling the API System using the status command. However, polling can waste the resources of both the API System and the Client's System. The use of Transaction Callback is highly recommended for smoother operation and using only the status command after five (5) minutes has passed without receiving status update through the Transaction Callback URL.
The API System will send the following fields:
Key | Value |
---|---|
tid | Transaction ID assigned by the API |
ctxid | Client Transaction ID assigned by client (your Transaction ID) |
status | Status of request in numeric format. Click here for the complete list. |
status_detail | Translation of 'status' field. |
respmsg | Response Message in numeric format Click here for the complete list. |
respmsg_code | Short code translation of 'respmsg' field. |
respmsg_detail | Longer translation of 'respmsg' field. |
The complete list of Response Messages and Statuses can be viewed from their respective dedicated pages.
The Disabled switch is for disabling the API Account in case needed by the API client to disable their access temporarily or permanently. When the account is first created, the API account is defaulted to disabled.
Do not forget to set Disabled to OFF before you perform or send API commands.
This button will save any changes you made to the API Account. Be sure to save your changes before using the Test features of the API Account editor.
Use this button to delete the API account. It is best to delete or disable account that you will not use to minimize any potential security risk.
There are three (3) API commands available, bal, load, and status.
The bal command will return the available and current balances of your account.
To initiate a bal command, you only need to include the following fields to your authentication fields.
Field Name | Field Value |
---|---|
state | pao_api |
cmd | bal |
The API System will then reply with a JSON formatted string with fields defined as follows:
The system will return JSON string with the following fields:
Key | Value |
---|---|
rescode | rescode list |
resmsg | Detailed info about the rescode |
ab | Available Balance of the account. |
cb | Current Balance of the account. |
curr | Currency of the balances |
Available Balance is the amount at your disposal when performing load transactions. If the product value is greater than your Available Balance, your load transaction request will fail with an insufficient fund error message.
Current Balance is the amount that does not include any pending transactions.
To understand the difference between the two, let us assume a scenario. You have a
balance of 1,000 and you wanted a product that cost 100.
ab: 1000
cb: 1000
product cost: 100
When you initiate a load transaction request, the API system will normally reply with
QUEUED. At this point, if you perform balance request, you should have the following result:
ab: 900
cb: 1000
It means, only 900 is available for your next load transaction, but since the
load transaction request is not yet complete, you may have 1,000 balance depending
on the outcome of the first load transaction. Eventually, the load transaction request
will be complete and there can be two outcome:
If the transaction is SUCCESSFUL:
ab: 900
cb: 900
If the transaction FAILED:
ab: 1000
cb: 1000
The load command is used when you want to request a product or to initiate a load transaction request.
To initiate a load command, you need to include the following fields to your authentication fields:
Field Name | Field Value |
---|---|
state | pao_api |
cmd | load |
pcode | List of Products |
dst | Destination of Load (i.e. Mobile number, Account number, or Subscriber Number) |
amt | Amount if product allows incremental value |
ctxid | Client Transaction ID |
The pcode or "Product Code" is the product being requested. To view
the list of products available to your API Account, go to the
API Account Management and click the button
at the left side of the account and check the "Tagged Products". To view details about the product,
go to Products Listing. You can also request ^DOMAINDESC^ admin
for the list.
The dst is the destination of the product being requested. This can be mobile number, account number, or subscriber number depending on the requirement of the product.
The amt is the amount parameter required by incremental products or products that allows arbitrary amount instead of fixed amount. Provide the amt parameter if the product requires it.
The ctxid is the Transaction ID of the client's backend system. This is for client's own tracking of transaction on the client-side system. Only characters a-z, A-Z, 0-9, underscore (_), dash (-), and period (.) is allowed, any other characters will be filtered out. The ^DOMAINDESC^ system checks for duplicate ctxid for the last 2 hours. If you use the same ctxid within the last 2 hours, it will throw a 131 error or duplicate request error.
The API system will return JSON string with the following fields:
Key | Value |
---|---|
rescode | rescode list |
resmsg | Detailed info about the rescode |
tid | Transaction ID |
status | Status of request |
Transaction ID ortid is the ^DOMAINDESC^'s side transaction ID in contrast with ctxid which is the client side or your own side of transaction ID. You will use Transaction ID or tid when searching for the transaction on ^DOMAINDESC^'s system side like when asking for support or checking the Products Sales list.
Finally, the status key returns the status of the load request. This will normally return QUEUED, meaning the request is queued for processing, otherwise, it will return FAILED for any errors. The complete list of statuses can be viewed here
The status command is used to get the status of the load transaction request or load command.
To initiate a status command, you need to include the following field to your authentication fields.
Field Name | Field Value |
---|---|
state | pao_api |
cmd | status |
tid | Transaction ID |
tid is the Transaction ID returned by the load command operation.
The API system will return JSON string with the following fields:
Key | Value |
---|---|
rescode | rescode list |
status | Status of request in numeric format. Click here for the complete list. |
status_detail | Translation of 'status' field. |
respmsg | Response Message in numeric format Click here for the complete list. |
respmsg_code | Short code translation of 'respmsg' field. |
respmsg_detail | Longer translation of 'respmsg' field. |
To easily understand the returned values, we can reorder the returned keys as follows:
And then group them as follows:
The res group (i.e. rescode and resmsg) are the result of API request. A rescode of 0 means there were no errors in the API request. The status group are the status of the load request. For example, below is an example of a successful API command (hence, rescode=0), but the load request failed (status_id=-1), with the respmsg_code being "TELCO_DECLINED".
Loading, please wait...
It is also possible to receive the following status command result when you invoke the status command too early after issuing the load command.
Loading, please wait...
This means the load request is still being processed. Typically, a load request is fulfilled after 15 to 20 seconds. The best practice is to use the Transaction Callback. If you want to use the status command, wait 15 seconds after the load command and poll every 5 to 10 seconds after.
load command -> wait 15 to 20 seconds -> status command -> poll every 5 to 10 seconds.
Lucidy API uses HTTP-based webhook. All API transactional request are performed via the webhook. Lucidy API accepts both POST and GET methods, but POST is strongly recommended.
The webhook URL is as follows:
^rooturl^shin/lite.p
Here are example codes from commonly used programming languages to demonstrate how the webhook URL is being used:
Loading, please wait...
Loading, please wait...
Loading, please wait...
Loading, please wait...
Loading, please wait...
For more examples of different programming languages, please contact ^DOMAINDESC^ admin.
The API Account Management comes with built-in testing facilities to quickly validate the API configuration and to assist the users in understanding how ^DOMAINDESC^'s' API system works.
To use the testing facility, go to the API Account Management and click the edit button at the left side of the table entry. First, configure your API account.
Set API Version to Lucidy.
Set the Authentication Mode. Notice that the quick explainer panel at the right side of the page updates as you change the Authentication Mode. For demonstration purposes, set the Authentication Mode to Standard UN/PW Pair.
Type your desired User Name and Password. For demonstration purposes, use the the following :
The test credentials will change everytime you refresh this page. You can update your API Account to follow the guide, or take mental notes on the possible difference of result.
Set the the Security Mode. Just like the Authentication Mode, the quick explainer panel at the right side of the page updates as you change the Security Mode. For demonstration purposes, set the Security Mode to Plain Authentication.
Finally, set the Disabled switch to OFF position.
In summary, we used the following configuration for demonstration purposes:
Finally, press the button to save the configuration.
Now that everything is configured, locate the Webhook panel at the right side of the page. Locate the "Choose the type of request" selection within the Webhook panel. For the first test, select "Balance".
Scroll-down to the "Testing" panel and skip over the forms until you reach the sample source code. Review the source code; if the source code does not exist, press the "Refresh Code" button. You should see something like this:
Loading, please wait...
To test the code, scroll further down to locate the "Try" button. Click the "Try" button to test your configuration.
If there are no errors, a pop-up similar to the example below should appear:
The API system will always return rescode = 0 if the API command succeeded and there are
no errors, otherwise, it will return a non-zero rescode.
Refer to rescode list
for the complete list. Here is an example of a failed API command with a non-zero rescode,
particularly, rescode = 201 or "Authentication failure".
If you get a successful result at this point, the rest should be easy. The only difference between the bal command and the other commands are the additional parameters. If you are having problem, do not hesitate to contact ^DOMAINDESC^ support for assistance.
To test the load command, scroll up to the part where you are asked to "Choose the type of request", then select LOAD. You will be presented with additional fields for testing . For this test, use the following info:
After making the changes, press the "Refresh Code" button to update the sample source code. It should show something similar to this:
Loading, please wait...
Just like in the bal command, click the "Try" button to test your configuration.
If there are no errors, a pop-up similar to the example below should appear:
For load command, the status = QUEUED should be generally expected. The complete list of statuses can be viewed here. Notice also the tid field. This is the assigned Transaction ID for this load request request. The corresponding Transaction ID form field is updated automatically but you should note that this is used later in status command.
Here's an example of a failed load command. If you recall in our
previous chapters, the Client Transaction ID or ctxid is
being checked for duplicates within the last two (2) hours of transactions.
To reproduce this error, the same Client Transaction ID is used in
the last two (2) hours.
Finally, to test status command, scroll up again to the part where you are asked to "Choose the type of request", then select STATUS. You will be presented with additional fields for testing. If you recall during load command, a successful load should return a tid field. This should be automatically entered to the "Transaction ID" form field, if not, key-in the tid value from the received result into the "Transaction ID" form field.
After making the changes, press the "Refresh Code" button to update the sample source code. It should show something similar to this:
Loading, please wait...
Just like in the bal and load commands, click the "Try" button to test your configuration.
If there are no errors, a pop-up similar to the example below should appear:
In this example, the request is currently queued and waiting to be processed.
Click the links for the complete list of:
And here is an example of a successfully fulfilled load request.
Use the testing facility to try out different settings and configuration combination.
This is a list of security considerations and best practice recommendations for a safe, secure, and efficient API operations.
When performing API request, make sure to always use https on the Webhook URL.
While in API Management and editing the API account, there is a feature located at the right side of the page called Security Assessment which looks similar to this:
Based on the selected Authentication Mode and Security Mode, the following is your security assessment:
Higher bar in green means very secure, while low bar in red means the selected combination of authentication and security is not ideal.
This section automatically updates depending on selected API configurations. To get a higher security score, here are some suggestions:
After sending out load request command, it could be tempting to use status command repeatedly until the requested load transaction is completed. This is called polling and can be a huge waste of resources for both the client and the ^DOMAINDESC^ system. The recommended or best practice is to configure your Transaction Callback URL and wait for the API system to send your system the result of the transaction result. In case your system did not receive any result after five (5) minutes, that is the best time to use the status command.
status command should be used to follow-up a request and not for polling status.
The API system has speed limits to avoid wasting of resources. Following are the limits:
Speed Limits | ||
---|---|---|
command | limit | |
bal | 15 sec | |
load | 1 sec | |
status | 1 sec | |
status per tid | 15 sec | |
load per dst | 60 sec |
This is applied per API account. Every API account has their own limits. This means you can only perform bal command every 15 seconds.
The speed limit for all load command is 1 sec, but the speed limit for specific dst or destination is 60 seconds.
The speed limit for all status command is 1 sec, but the speed limit for specific tid or Transaction ID is 15 seconds.
These limits should be enough for bulk loading but not too much that would spam the uplink or telco suppliers.
With the limits in mind, here is how a transaction flow might look like:
This section list down all commonly encountered problems and solutions or procedures on how to mitigate them. The list may grow so check this section first before requesting for support.
The common problem when creating a program involving HTTP POST is the confusion with how the data is being passed on. Let us take this php code as an example:
Loading, please wait...
There are a couple places where a mistake can take place. Failure to properly defined the 'state' => 'pao_api' is one. Failing to build the query array is another. Then there is this 'content' parameter not being defined and assigned with the $postdata variable.
The key takeaway here is to make sure you understand how to send postdata parameters on the programming language you are using. The error "Unknown Action" means the state (or action) parameter is not defined or does not contain the value 'pao_api', or is not being properly sent to the API server.
If you are getting "Authentication Failure" even though you are sure you have the correct credentials, consider the following:
If you encounter other problems not listed here, please contact ^DOMAINDESC^ support. We will be glad to assist you, and understand better the common pitfalls of our API system so we can enhance and improve it.
// Fill-in the required information: var username = "-replace with your User Name-"; var passwd = "-replace with your Password-"; var request = $j.ajax({ type: "POST", url: "^rooturl^/shin/lite.p", data: { "state" : "pao_api", "cmd" : "bal", "username" : username, "passwd" : passwd } }); request.done(function( msg ) { alert( "Server returned : " + msg ); }); request.fail(function( jqXHR, textStatus ) { alert( "Request failed: " + textStatus ); });
{ "ab": "100.00", "cb": "100.00", "curr": "EUR", "rescode": "0", "resmsg": "No error" }
// Fill-in the required information: var username = "-replace with your User Name-"; var passwd = "-replace with your Password-"; var pcode = "TSTS5"; // Product Code var dst = "09121234567"; // Destination Number or Mobile var ctxid = "1"; // Client Transaction ID var request = $j.ajax({ type: "POST", url: "^rooturl^/shin/lite.p", data: { "state" : "pao_api", "cmd" : "load", "username" : username, "passwd" : passwd "pcode" : pcode, "dst" : dst, "ctxid" : ctxid, } }); request.done(function( msg ) { alert( "Server returned : " + msg ); }); request.fail(function( jqXHR, textStatus ) { alert( "Request failed: " + textStatus ); });
{ "rescode": "0", "resmsg": "No error", "status": "QUEUED", "tid": "4912458" }
// Fill-in the required information: var username = "-replace with your User Name-"; var passwd = "-replace with your Password-"; var tid = "4912458"; // Transaction ID var request = $j.ajax({ type: "POST", url: "^rooturl^/shin/lite.p", data: { "state" : "pao_api", "cmd" : "status", "tid" : tid, "username" : username, "passwd" : passwd } }); request.done(function( msg ) { alert( "Server returned : " + msg ); }); request.fail(function( jqXHR, textStatus ) { alert( "Request failed: " + textStatus ); });
{ "rescode": "0", "resmsg": "No error", "respmsg": "0", "respmsg_code": "NOP", "respmsg_detail": "Normal Operation", "status_detail": "Queued", "status_id": "0" }
{ "rescode": "0", "resmsg": "No error", "respmsg": "2", "respmsg_code": "SUCCESS", "respmsg_detail": "Loading Successful", "status_detail": "Processed", "status_id": "3" }
{ "rescode": "0", "resmsg": "No error", "respmsg": "1005", "respmsg_code": "TELCO_DECLINED", "respmsg_detail": "FAILED! Please check the number and try again.", "status_detail": "Failed", "status_id": "-1" }
username = "-replace with your User Name-"; passwd = "-replace with your Password-"; curl \ -d "state=pao_api" \ -d "cmd=bal" \ -d "apicode=$username" \ -d "auth=$passwd" \ -X POST \ ^rooturl^shin/lite.p
url="^rooturl^shin/lite.p" username = "-replace with your User Name-"; passwd = "-replace with your Password-"; lynx --dump --source "${url}?state=pao_api;cmd=bal;username=${username};passwd=${passwd}"
// Specify the URL and data $url = '^rooturl^shin/lite.p'; $username = "-replace with your User Name-"; $passwd = "-replace with your Password-"; $postdata = http_build_query( array( 'state' => 'pao_api', 'cmd' => 'bal', 'username' => $username, 'passwd' => $passwd ) ); $params = array( 'http' => array( 'method'=>'POST', 'header'=>'Content-type: application/x-www-form-urlencoded', 'content'=> $postdata ) ); $ctx = stream_context_create($params); $fp = fopen($url, 'rb', false, $ctx); $response = stream_get_contents($fp); echo $response;
// Fill-in the required information: var username = "-replace with your User Name-"; var passwd = "-replace with your Password-"; var request = $j.ajax({ type: "POST", url: "^rooturl^/shin/lite.p", data: { "state" : "pao_api", "cmd" : "bal", "username" : username, "passwd" : passwd } }); request.done(function( msg ) { alert( "Server returned : " + msg ); }); request.fail(function( jqXHR, textStatus ) { alert( "Request failed: " + textStatus ); });
// Fill-in the required information: val apiUrl = "^rooturl^/shin/lite.p"; val username = "-replace with your User Name-"; val passwd = "-replace with your Password-"; // Create the form post parameter val formParam = ArrayList<String>() formParam.add("state=pao_api") formParam.add("cmd=bal") formParam.add("username=$username") formParam.add("passwd=$passwd") val formData = formParam.joinToString(separator=";") val url = URL(apiUrl) val connection = url.openConnection() as HttpURLConnection // Set the request method to POST connection.requestMethod = "POST" // Enable input/output streams connection.doOutput = true connection.doInput = true // Write the JSON payload to the request val outputStreamWriter = OutputStreamWriter(connection.outputStream) outputStreamWriter.write(formData) outputStreamWriter.flush() // Get the response code (optional) val responseCode = connection.responseCode val responseMsg = connection.responseMessage val responseContent = connection.readContent() Log.d(ContentValues.TAG, "sendToPAOAPI: "+responseCode) Log.d(ContentValues.TAG, "sendToPAOAPI: "+responseMsg) Log.d(ContentValues.TAG, "sendToPAOAPI: "+responseContent) // Close the output stream and connection connection.disconnect()
// Fill-in the required information: var username = "^demo_un^"; // User Name var passwd = "^demo_pw^"; // Password var request = $j.ajax({ type: "POST", url: "^rooturl^/shin/lite.p", data: { "state" : "pao_api", "cmd" : "bal", "username" : username, "passwd" : passwd } }); request.done(function( msg ) { alert( "Server returned : " + msg ); }); request.fail(function( jqXHR, textStatus ) { alert( "Request failed: " + textStatus ); });
// Fill-in the required information: var pcode = "TSTS5"; // Product Code var dst = "abcd1234"; // Destination Number or Mobile var amt = "0"; // Incremental Amount var ctxid = "1"; // Client Transaction ID var username = "^demo_un^"; // User Name var passwd = "^demo_pw^"; // Password var request = $j.ajax({ type: "POST", url: "^rooturl^/shin/lite.p", data: { "state" : "pao_api", "cmd" : "load", "pcode" : pcode, "dst" : dst, "amt" : amt, "ctxid" : ctxid, "username" : username, "passwd" : passwd } }); request.done(function( msg ) { alert( "Server returned : " + msg ); }); request.fail(function( jqXHR, textStatus ) { alert( "Request failed: " + textStatus ); });
// Fill-in the required information: var tid = "1"; // Transaction ID var username = "^demo_un^"; // User Name var passwd = "^demo_pw^"; // Password var request = $j.ajax({ type: "POST", url: "^rooturl^/shin/lite.p", data: { "state" : "pao_api", "cmd" : "status", "tid" : tid, "username" : username, "passwd" : passwd } }); request.done(function( msg ) { alert( "Server returned : " + msg ); }); request.fail(function( jqXHR, textStatus ) { alert( "Request failed: " + textStatus ); });