Table of Content
Parameter table key:
* | Required parameter |
1 | Available for VoIP agents only |
2 | Available for Callingcard agents only |
3 | Used by the internal "Transaction Control System". (Not available for all agents) |
4 | Sensitive information, communicated and stored as plain text. Provide at your own risk. (Agent API system will never postback the sensitive information) |
Protocol Description
GBNE Agent API allows clients' applications to securely connect
directly to the GBNE Application/Web Server and submit transaction data. All
requests will be initiated by the client. The client submits the data as HTTP-Post.
The Http Post must consist of a set of fields that are required for each transaction,
and a set of fields that are optional. The server responds with an XML document
of transaction data and result via same HTTP stream (Note: GBNE Agent API
XML document is NOT SOAP compliant).
XML document has common structure for all transactions except for the output
section where you will receive the command specific result (details on the XML
document structure is on the "Command Output section").
To implement, a developer would design a script that does the following:
Command Execution (HTTP Request)
In order to execute GBNE Agent API commands (commands), you
need to post a HTTP request with all the required parameters and other optional
parameters to http://agent.gbne.net/api/agentapi.php
Following is a list of required parameters common to all commands.
Parameter | Type | Description |
---|---|---|
api_agent* | string (16) | API username assigned to your agent account by GBNE. |
api_agent_password* | string (16) | Correct password for the above username |
api_command* | integer | Command ID you need to execute (Refer "Commands") |
Sample HTTP request:
Note: Above sample shows the minimum HTTP header information for your understanding, your actual request may/will include much other information depending on the browser or the programming language you use.
Command Output (XML Document)
For all the requests you make (via HTTP post) Agent API system response with a XML document via same HTTP stream. XML document win always confirm to the following structure.
As you can see in the above sample Agent API response is an XML document with the root node "gbne_agent_api". Root node contains 3 sub-nodes Response, Request and Output.
Response Section
This sub node of the XML document indicates the system's internal status of the
command execution process.
Sub-node | Type | Description |
---|---|---|
code | integer | API command status. This will be 0 (Zero) when command is successfully executed. And incase of the failure "code" will contain the corresponding error value (Refer "Error Codes") |
message | string | Descriptive text corresponding to the code |
Request Section
This section contains some statistics related to the HTTP request you have posted.
Content of this section should always be submitted when reporting an issue related
to the Agent API.
Sub-node | Type | Description |
---|---|---|
transaction_id | string (35) | A unique identifier assigned to each command execution process. |
transaction_datetime | datetime | Date and time system received the HTTP request for the command execution. (in "YYYY-MM-DD HH:MM:SS AM/PM" format) |
remote_ip | string (15) | IP address of the HTTP request origination. |
remote_host | string | Host name of the remote system. This could be blank depending on the parameters of HTTP header. |
parameters | xml node | Collection of all the parameters and their values your request has posted (except for the "api_agent_password" parameter and its value). You can use this data to verify your request. |
Output Section
This is the final first-level sub node of the XML document. Content of this
sub-node will differ from command to command. Refer each command's output for
details
Commands
Command ID | Name | Details |
---|---|---|
101 | Account Signup | |
102 | Trigger Callback | Callback products only |
103 | Get Calling Plan List | VoIP agents only |
104 | Get DID Group List | VoIP agents only |
105 | Balance Update | |
106 | Get Call Records | |
107 | Get Call Rates | |
108 | Get/Set Account Status | |
109 | ANI Register | Callingcard products only |
110 | View Account | |
111 | Voicemail | VoIP agents only |
112 | Update Customer Information | |
113 | Recharge Calling Plan | VoIP agents only |
114 | Change Calling Plan | VoIP agents only |
115 | Assigns MAC Address | VoIP agents only |
116 | View Transactions | |
117 | Remove Child DID | VoIP agents only |
118 | Add Child DID | VoIP agents only |
119 | View Call Forwarding Configuration | VoIP agents only |
120 | Set Call Forwarding | VoIP agents only |
121 | Second Line Signup | VoIP agents only |
122 | VoIP Box Details | VoIP agents only |
123 | Web Site Content |
Command - 101:Account Signup
This command enables you to configure and activate a customer account (Callingcard, Callback or VoIP). Account signup fetch a next available PIN from agent's "Retail Accounts" product and issue it to the customer by activating it, if you don't have unused PINs left in your retail product, this command will fail.
Account activation on signup depends on the agent account's
configuration. If your agent account is set to "Signup Post Authorization"
mode account will be created as an inactive/pending. Before customer use this
account you need to authorize it from GBNE Agent MIS customer maintenance section.
You can configure you agent account to send a notification to a URL on your
website on customer account post authorization, this will cause the system to
post PIN of the authorized customer account to your URL. In addition to the
PIN, HTTP post will contain a parameter named "command" with
value "POSTAUTHORIZE" in order to indicate that this is a
post authorization notification.
If your agent account is set to online account authorization, customer accounts
will be automatically activated at signup and be ready to use.
Account signup command takes in following parameters:
Parameter | Type | Description |
---|---|---|
account_balance* | double | Prepaid account balance used for web callback and toll free calls. |
account_calling_plan1 | integer | Must be a valid id of a calling plan belongs to retail product of the agent. Invalid calling plan id will cause an error and stop the command from proceeding. You can get a list of available calling plans by executing the command 103. |
account_did_code1 | string (3) | 3 digit (string) area code of the DID you want to assigned to this account. If provided area code is invalid or there are no available phone numbers in that are, command will fail. You can get a list of available DID groups (area codes) by executing the command 104. |
voip_box_id1 | integer | If not provided a VoIP box (phone adapter hardware) will not be issued for the account. You can get a list of available VoIP boxes by executing the command 122. |
registered_phone2 | string (32) | |
customer_first_name | string (30) | |
customer_last_name | string (30) | |
customer_phone | string (20) | |
customer_email | string (50) | Invoices will only be emailed to customer if email address is available |
customer_password | string (16) | If not provided, system will generate a password for each customer profile |
customer_ip3 | string (15) | |
customer_address_street1 | string (30) | Billing address of the customer. |
customer_address_street2 | string (30) | |
customer_address_city | string (30) | |
customer_address_state | string (20) | |
customer_address_zipcode | string (10) | |
customer_address_country | string (50) | |
shipping_address_street1 | string (30) | Shipping address. This address will be used to ship VoIP hardware. |
shipping_address_street2 | string (30) | |
shipping_address_city | string (30) | |
shipping_address_state | string (20) | |
shipping_address_zipcode | string (10) | |
shipping_address_country | string (50) | |
creditcard_number3,4 | string (20) | Customer credit cards are never charged by GBNE. Agent must do the credit card validation and charge the customer. This information is collected only for the reference of agents. |
creditcard_expiration_month3 | integer | |
creditcard_expiration_year3 | integer | |
creditcard_security_code3 | string (3) | |
creditcard_holder | string (50) |
System will respond with following data on the Output block of the XML document
On Successful Signup
On Failed Signup
Account signup may fail due to following reasons
Error Code | Description |
---|---|
1 | Provided calling plan id is invalid. Calling plan must belong to the "Retail Accounts" product of the agent. |
2 | Provided DID area code is invalid or there are no available phone numbers in the group. |
3 | Agent doesn't have a "Retail Accounts" product |
4 | No available (unused) PINs in the agent's retail product. |
5 | Agent doesn't have enough credit for the transaction. |
101 | Customer credit card provided for the transaction is blacklisted by the "Transaction Control System" |
102 | Customer IP provided for the transaction is blacklisted by the "Transaction Control System" |
103 | Customer email address provided for the transaction is blacklisted by the "Transaction Control System" |
201 | Customer credit card provided for the transaction exceeds the limits allowed by "Transaction Control System" |
202 | Customer IP provided for the transaction exceeds the limits allowed by "Transaction Control System" |
203 | Customer email address provided for the transaction exceeds the limits allowed by "Transaction Control System" |
Command - 102:Trigger Callback
This command enables you to trigger web callback.
Trigger callback command takes in following parameters:
Parameter | Type | Description |
---|---|---|
account_number* | string | Customer account number (PIN) |
call_origination* | string | Caller (origination) phone number. |
call_origination_extension | string | |
call_destination | string | Destination phone number |
call_delay | integer | If a number is provided, system will delay the call in "call_delay" minutes. |
System will respond with following data on the Output block of the XML document
On Successful Signup
On Failed Signup
Trigger callback may fail due to following reasons
Error Code | Description |
---|---|
1 | Customer account provided for the call is invalid |
2 | Customer account is inactive |
3 | Customer account doesn't have enough credit |
4 | Customer account has expired |
5 | Customer account already inuse (active call on same account) |
6 | Caller (Origination) phone number is invalid |
7 | Destination phone number is invalid |
8 | Technical failure |
9 | Delay parameter exceeds the allowed limit (1 to 10080 minutes) |
Command - 103:Get Calling Plan List
This command returns all the calling plans and their related information of the agent's "Retail Accounts" product.
Get calling plan list command takes in following parameters:
Parameter | Type | Description |
---|---|---|
calling_plan_id | integer | If provided a valid calling plan id, only details of that plan will be returned. |
System will respond with following data on the Output block of the XML document. If there are no calling plans, output sub-node will be empty.
Get calling plan list doesn't have any error codes.
Command - 104:Get DID Group List
This command returns all the DID area codes and their related information.
Get DID group list command takes in following parameters:
Parameter | Type | Description |
---|---|---|
did_group_id | integer | If provided a valid DID group id, only details of that DID group will be returned. |
did_group_code | string | Area code (NPA) of the DID group |
System will respond with following data on the Output block of the XML document. If there are no DID groups, output sub-node will be empty.
Get DID group list doesn't have any error codes.
Command - 105:Balance Update
This command enables you to adjust or view balance (prepaid) of a single account.
Balance update command takes in following parameters:
Parameter | Type | Description |
---|---|---|
account_number* | string | |
adjustment_method* | ENUM (string) | Valid values are "VIEW", "EXACT", "CREDIT" and "DEBIT". See details of each value below. |
adjustment_amount | double | If amount is not provided it's assumed as 0 (Zero) |
Parameter "adjustment_method".
Value | Description |
---|---|
VIEW | No changes will be done to the account balance. Returns the balance details. |
EXACT | Account balance is set to the exact amount passed in "adjustment_amount" parameter. |
CREDIT | Amount passed in "adjustment_amount" parameter is credited to the customer account. |
DEBIT | Amount passed in "adjustment_amount" parameter is taken off from the customer account. |
System will respond with following data on the Output block of the XML document.
Balance update doesn't have any error codes.
Command - 106:Get Call Records
Returns the call record of a customer account during a specified period.
Get call records command takes in following parameters:
Parameter | Type | Description |
---|---|---|
account_number* | string | |
date_from | datetime | If not provided, all the call records from account activation date up-to-date will be returned. Date/time should be in "YYYY-MM-DD HH:mm:SS" format. |
date_to | datetime | If not provided, all the call records from account activation date up-to-date will be returned. Date/time should be in "YYYY-MM-DD HH:mm:SS" format. |
record_page | integer | If not provided, all the records pages will be returned |
record_page_size | integer | If not provided, all the records pages will be returned |
sort_flag | integer | see below for the details |
Parameter "sort_flag".
Value | Description |
---|---|
1 | Sort call records by call date/time. This is the default value for this parameter . |
3 | Sort by cost of the call. |
System will respond with following data on the Output block of the XML document.
Parameter "call_type".
Value | Description |
---|---|
CB | Callback |
TF | Toll-free |
S2P | VoIP to regular phone |
P2S | Regular phone to VoIP |
S2S | VoIP to VoIP |
P2F | Forwarded to regular phone |
S2F | Forwarded to VoIP |
VM | Voice mail access |
Get call records may fail due to following reasons
Error Code | Description |
---|---|
1 | Customer account provided is invalid |
Command - 107:Get Call Rates
Returns the call rates of an agent product based on access number or calling plan.
Get call rates command takes in following parameters:
Parameter | Type | Description |
---|---|---|
access_number* | string | Respective Toll-free number for callingcard rates, "VOIP" for VoIP rates or "CALLBACK" for callback rates. |
calling_plan_id | integer | Required if "access_number" is "VOIP".* |
destination_letter | string (1) | If provided only the rates of destination names starting with "destination_letter" will be returned. |
System will respond with following data on the Output block of the XML document.
Get call rates may fail due to following reasons
Error Code | Description |
---|---|
1 | Failed to determine agent product/rate for the provided access number or calling plan. |
Command - 108:Get/Set Account Status
Returns or adjust the status of a customer account.
Get/Set account status command takes in following parameters:
Parameter | Type | Description |
---|---|---|
account_number* | string | |
account_status | integer | Valid values are 1 (One) or 0 (Zero).
If not provided command only returns the account status. |
System will respond with following data on the Output block of the XML document.
Get/Set account status may fail due to following reasons
Error Code | Description |
---|---|
1 | Customer account provided is invalid |
Command - 109:ANI Register
Register a phone number with a callingcard account for automatic account recognition.
ANI register command takes in following parameters:
Parameter | Type | Description |
---|---|---|
account_number* | string | |
new_ani_list | CSL | Comma seperated list of ANIs (phone numbers) to be registered with the account. |
delete_ani_list | CSL | Comma seperated list of ANIs (phone numbers) to be unregistered with the account. |
System will respond with following data on the Output block of the XML document.
ANI register may fail due to following reasons
Error Code | Description |
---|---|
1 | Customer account provided is invalid |
Command - 110:View Account
Registers the customer and account details by account number (PIN), VoIP phone number (DID) or serial number.
View account command takes in following parameters:
Parameter | Type | Description |
---|---|---|
search_using* | ENUM (string) | see detail below |
search_for* | string | value to search for |
Parameter "search_using".
Value | Description |
---|---|
PIN | Search by account number |
DID | Search by VoIP phone number |
SERIAL | Search by account serial number |
System will respond with following data on the Output block of the XML document.
View account may fail due to following reasons
Error Code | Description |
---|---|
1 | Account not found |
Command - 111:Voicemail
This command performs several sub functions based on the "sub_command" parameter. All functions are related to VoIP account's voice mail access feature.
Voicemail command takes in following parameters:
Parameter | Type | Description |
---|---|---|
voip_did* | string | |
sub_command | ENUM (string) | See detail below. Default (no "sub_command" will return the VM folder content. |
vm_name | string | |
vm_email | string | |
vm_password | string | |
vm_folder | string |
Parameter "sub_command".
Value | Description |
---|---|
ADD_EXTENSION | Enable voicemail box for the account |
DELETE_EXTENSION | Disable voicemail box for the account |
MSG_REMOVE | Delete voicemail message |
MSG_PLAY | Play voicemail message |
System will respond with following data on the Output block of the XML document.
or (if "MSG_PLAY")
Voicemail may fail due to following reasons
Error Code | Description |
---|---|
1 | VoIP phone number (DID) provided is invalid |
2 | Failed to play message |
3 | Failed to delete message |
Command - 112:Update Customer Information
Update customer profile details. Only provided details will be updated in the customer profile, if not provided those values will remain unchanged.
Update customer information command takes in following parameters:
Parameter | Type | Description |
---|---|---|
account_number* | string | |
account_calling_plan | integer | |
customer_first_name | string (30) | |
customer_last_name | string (30) | |
customer_phone | string (20) | |
customer_email | string (50) | |
customer_password | string (16) | |
customer_address_street1 | string (30) | |
customer_address_street2 | string (30) | |
customer_address_city | string (30) | |
customer_address_state | string (20) | |
customer_address_zipcode | string (10) | |
customer_address_country | string (50) | |
shipping_address_street1 | string (30) | |
shipping_address_street2 | string (30) | |
shipping_address_city | string (30) | |
shipping_address_state | string (20) | |
shipping_address_zipcode | string (10) | |
shipping_address_country | string (50) |
System will respond with following data on the Output block of the XML document.
Update customer information may fail due to following reasons
Error Code | Description |
---|---|
1 | Provided calling plan id is invalid. Calling plan must belong to the "Retail Accounts" product of the agent. |
2 | Customer account is invalid |
Command - 113:Recharge Calling Plan
Manually pay the calling plan monthly amount.
Recharge calling plan command takes in following parameters:
Parameter | Type | Description |
---|---|---|
account_number* | string | |
recharge_amount | double | Amount to add to prepaid account balance |
System will respond with following data on the Output block of the XML document.
Recharge calling plan may fail due to following reasons
Error Code | Description |
---|---|
1 | Customer account is invalid |
2 | Calling plan id is invalid |
3 | Agent doesn't have enough credit for the transaction. |
Command - 114:Change Calling Plan
Move customer account to a different calling plan.
Change calling plan command takes in following parameters:
Parameter | Type | Description |
---|---|---|
account_number* | string | |
new_plan* | integer |
System will respond with following data on the Output block of the XML document.
Change calling plan may fail due to following reasons
Error Code | Description |
---|---|
1 | Customer account is invalid |
2 | Calling plan id is invalid |
Command - 115:Assigns MAC Address
Assign a MAC address (VoIP hardware) to newly signup account.
Assign MAC address command takes in following parameters:
Parameter | Type | Description |
---|---|---|
account_number* | string | |
new_plan* | integer |
System will respond with following data on the Output block of the XML document.
Assign MAC address may fail due to following reasons
Error Code | Description |
---|---|
1 | Customer account is invalid |
2 | Assignment failed (mostly due to boxes not available) |
Command - 116:View Transactions
Returns transactions of the customer during a specified period.
View transactions command takes in following parameters:
Parameter | Type | Description |
---|---|---|
account_number* | string | |
date_from | datetime | If not provided, all the transaction records from account activation date up-to-date will be returned. Date/time should be in "YYYY-MM-DD HH:mm:SS" format. |
date_to | datetime | If not provided, all the transaction records from account activation date up-to-date will be returned. Date/time should be in "YYYY-MM-DD HH:mm:SS" format. |
record_page | integer | If not provided, all the records pages will be returned |
record_page_size | integer | If not provided, all the records pages will be returned |
System will respond with following data on the Output block of the XML document.
Parameter "transaction_type".
Value | Description |
---|---|
AUTO_PAY | Automatic payment |
PLAN | Calling plan manual payment |
BALUP | Balance update |
RECHG | Prepaid balance recharge |
SIGNUP | Account signup |
EX_DID | Additional DID purchase |
BOX | VoIP hardware purchase |
View transactions may fail due to following reasons
Error Code | Description |
---|---|
1 | Customer account is invalid |
2 | No transactions found |
Command - 117:Remove Child DID
Remove additional VoIP phone number (DID).
Remove child DID command takes in following parameters:
Parameter | Type | Description |
---|---|---|
account_number* | string | |
chid_did* | string |
System will respond with following data on the Output block of the XML document.
Remove child DID plan may fail due to following reasons
Error Code | Description |
---|---|
1 | Customer account is invalid |
2 | Technical failure |
Command - 118:Add Child DID
Add additional VoIP phone number (DID).
Add child DID command takes in following parameters:
Parameter | Type | Description |
---|---|---|
account_number* | string | |
did_group_id* | integer |
System will respond with following data on the Output block of the XML document.
Add child DID plan may fail due to following reasons
Error Code | Description |
---|---|
1 | Customer account is invalid |
2 | Technical failure |
Command - 119:View Call Forwarding Configuration
View VoIP call forwarding configuration.
View call forwarding configuration command takes in following parameters:
Parameter | Type | Description |
---|---|---|
account_number* | string |
System will respond with following data on the Output block of the XML document.
View call forwarding configuration may fail due to following reasons
Error Code | Description |
---|---|
1 | Customer account is invalid |
2 | Technical failure |
Command - 120:Set Call Forwarding
Enable/disable VoIP call forwarding feature.
Set call forwarding command takes in following parameters:
Parameter | Type | Description |
---|---|---|
account_number* | string | |
forward_number | string |
System will respond with following data on the Output block of the XML document.
Set call forwarding may fail due to following reasons
Error Code | Description |
---|---|
1 | Customer account is invalid |
2 | Technical failure |
Command - 121:Second Line Signup
This command enables you to add a second phone line (account) to an existing customer profile.
Second line signup command takes in following parameters:
Parameter | Type | Description |
---|---|---|
account_number* | string | |
account_balance* | double | Prepaid account balance used for web callback and toll free calls. |
account_calling_plan1 | integer | Must be a valid id of a calling plan belongs to retail product of the agent. Invalid calling plan id will cause an error and stop the command from proceeding. You can get a list of available calling plans by executing the command 103. |
account_did_code1 | string (3) | 3 digit (string) area code of the DID you want to assigned to this account. If provided area code is invalid or there are no available phone numbers in that are, command will fail. You can get a list of available DID groups (area codes) by executing the command 104. |
registered_phone2 | string (32) | |
customer_ip3 | string (15) | |
creditcard_number3,4 | string (20) | Customer credit cards are never charged by GBNE. Agent must do the credit card validation and charge the customer. This information is collected only for the reference of agents. |
creditcard_expiration_month3 | integer | |
creditcard_expiration_year3 | integer | |
creditcard_security_code3 | string (3) | |
creditcard_holder | string (50) |
System will respond with following data on the Output block of the XML document
Second line signup may fail due to following reasons
Error Code | Description |
---|---|
1 | Provided calling plan id is invalid. Calling plan must belong to the "Retail Accounts" product of the agent. |
2 | Provided DID area code is invalid or there are no available phone numbers in the group. |
3 | Agent doesn't have a "Retail Accounts" product |
4 | No available (unused) PINs in the agent's retail product. |
5 | Agent doesn't have enough credit for the transaction. |
6 | Customer account is invalid. |
101 | Customer credit card provided for the transaction is blacklisted by the "Transaction Control System" |
102 | Customer IP provided for the transaction is blacklisted by the "Transaction Control System" |
103 | Customer email address provided for the transaction is blacklisted by the "Transaction Control System" |
201 | Customer credit card provided for the transaction exceeds the limits allowed by "Transaction Control System" |
202 | Customer IP provided for the transaction exceeds the limits allowed by "Transaction Control System" |
203 | Customer email address provided for the transaction exceeds the limits allowed by "Transaction Control System" |
Command - 122:VoIP Box Details
Get the list of available VoIP hardware.
VoIP box details command takes in following parameters:
Parameter | Type | Description |
---|---|---|
voip_box_id | integer | If provided a valid box id, only details of that VoIP box will be returned. |
System will respond with following data on the Output block of the XML document. If there are no VoIP boxes, output sub-node will be empty.
VoIP box details doesn't have any error codes.
Command - 123:Web Site Content
Get the content defined in the Agent MIS.
Web site content command takes in following parameters:
Parameter | Type | Description |
---|---|---|
content_key | string | If provided a valid key, only content of that key will be returned. |
System will respond with following data on the Output block of the XML document. If there are no key/data, output sub-node will be empty.
or (if key provided)
VoIP box details doesn't have any error codes.
Error Codes
Error Code | Description |
---|---|
2 | Invalid "api_command" value. |
3 | Technical failure |
4 | Agent username/password invalid |
5 | Agent does not have access to Agent API or command |
6 | Required parameter is missing |
7 | Invalid value (by type) passed to a parameter |
8 | Command specific failure. More details on the "output" section. |