Bite API FAQ


1. What does action ID mean and what actionID do I have to use for function billAccount?

Action ID describes process for which account can be billed using function billAccount or openBillingTransaction.
  • Use action ID 374 (sendContent), if you want to bill account for the content (such as java games, mp3 files or other) download from your wap page;
  • Use action ID 380 (Browse), if you want to bill account for the wap page browse;
  • Use action ID 350 (BillAccount), if you need to bill for other purpose.




2. We just tried to connect and got "Login failed. No such user!".

Please check if you use the right provider authentication data - username and password. Attention: authentication data (username and password) for SMPP services are different from SOAP services.




3. Trying to get msisdn using IP address, we get the error "no such customer record".

To resolve msisdn using IP address is not possible in Latvia, in the near future this function will not work in Lithuania either. Please use account id to resolve msisdn.




4. We don't get Bite Account headers, when we connecting to our wap page.

Please ask your Bite manager if your subdomain or domain you use is added to the list of domains, which can get Bite headers.




5. Could you provide example how to send SMS through API:

PHP example:

<?php
$s = new soapclient($services_url.$port."?wsdl");

$s->setCredentials($user,$password);
$s->setHeaders("<provider-service><service-id>$service_id</service-id></provider-service>");

 
$param = array('acount_ids' => $account_ids, 'msisdns' => $msisdns,
		'billAmount' => $bill_amount, 'billCurrency' => $bill_currency,
		'smsSender' => $sms_sender, 'smsBody' => $sms_body, 'smsLanguage' => $sms_language,
		'smsHeaders' => null,
		'startDeliveryTime' => null, 'endDeliveryTime' => null,
		'giveNotification' => false);

 
$res = $s->call('sendSMS', $param, "http://biteapi.metasite.net/messaging",
"http://biteapi.metasite.net/messaging/sendSMS");
?>




6. How can we get our customer's Account ID?

Finding out the phone number is not possible directly - first you have to obtain Account ID, and then, using SOAP function, you can find out the corresponding MSISDN (phone number). Account ID is included in all WAP or HTTP request headers to your site. To start seeing Account ID, please make sure that the following have been done:

1. Your wap site domain is AccountID-enabled by BITE. Only registered domains receive Account IDs. Registration should be requested by email.
2. You are testing your wap site using BITE SIM card, and you are connecting with your mobile phone using APN WAP to your site. Only if you connect like the real customer will you see the Account ID.
3. Your script is correctly programmed to retrieve the headers.


PHP example:

<?php
$headers = getallheaders();
$accountId = $headers['Bite-Account-ID'];
?>

Attention! Please ask your Bite manager if subdomain or domain you use is added to the list of domains, which can get Bite headers. Both first level domains (xxx.com) and second level domains (wap.xxx.com) are each configured separately. If you use many domains (wap1.xxx.com, wap2.xxx.com) etc, consider reducing their number.




7. Can we get any statistics of transactions we made?

Your transactions statistics find here: http://mms.bite.lt/dsadmin/admlt.php. For authorization data ask by e-mail partner_support@bite.lt.



8. Please provide example of sendWAPPush/sendSMS function usage with MSISDNs array as parameter.

PHP example of sendWAPPush function usage (msisdns parameter is passed as array of type long).

<?php
require_once('lib/nusoap/nusoap.php'); 
 
$wsdl = "http://soap.bite.lt/biteapi/services/MessagingPort?wsdl";
$password = 'xxx';
$user = 'xxx';
$service_id = xxx;
$msisdn = '370xxxxxxxx';
 
$client = new soapclient($wsdl);
$headerString = "<provider-service><service-id>$service_id</service-id></provider-service>";
$client->setHeaders($headerString);
$client->setCredentials($user, $password);
 
$param = array(
'acount_ids' => null,
'msisdns' => array(new soapval('item', 'long', $msisdn)),
'URL' => 'http://wap.bite.lt',
'title' => 'BitePlius',
'expirationTime' => new soapval('expirationTime', 'date', '2099-01-01T00:00:00Z'),
'language' => 'LT',
'billAmount' => (float)0.0,
'billCurrency' => 'LTL',
'startDeliveryTime' => new soapval('startDeliveryTime', 'date', date("Y-m-d")."T00:00:00Z"), 
'endDeliveryTime' => new soapval('endDeliveryTime', 'date', date("Y-m-d")."T00:00:00Z"),
'giveNotification' => false);
 
var_dump($client->call('sendWAPPush', $param, "http://biteapi.metasite.net/messaging", 
"http://biteapi.metasite.net/messaging/sendWAPPush"));
 
echo '<h2>Request</h2><pre>' . htmlspecialchars($client->request, ENT_QUOTES) . '</pre>';
echo '<h2>Response</h2><pre>' . htmlspecialchars($client->response, ENT_QUOTES) . '</pre>';
echo '<h2>Debug</h2><pre>' . htmlspecialchars($client->debug_str, ENT_QUOTES) . '</pre>';
?>


PHP example of sendSMS function usage (msisdns parameter is passed as array of type long).

<?php
require_once('lib/nusoap/nusoap.php'); 
 
$wsdl = "http://soap.bite.lt/biteapi/services/MessagingPort?wsdl";
$password = 'xxx';
$user = 'xxx';
$service_id = xxx;
$msisdn = '370xxxxxxxx';
 
$client = new soapclient($wsdl);
$headerString = "<provider-service>
<service-id>$service_id</service-id></provider-service>";
$client->setHeaders($headerString);
$client->setCredentials($user, $password);
 
$param = array(
'acount_ids' => null,
'msisdns' => array(new soapval('item', 'long', $msisdn)),
'billAmount' => (float)0.0,
'billCurrency' => 'LTL',
'smsSender' => '123',
'smsBody' => 'test msg',
'smsLanguage' => 'LT',
'smsHeaders' => null,
'startDeliveryTime' => new soapval('startDeliveryTime', 
'date', date("Y-m-d")."T00:00:00Z"), 
'endDeliveryTime' => new soapval('endDeliveryTime', 
'date', date("Y-m-d")."T00:00:00Z"),
'giveNotification' => false);
 
 
var_dump($client->call('sendSMS', $param, "http://biteapi.metasite.net/messaging", 
"http://biteapi.metasite.net/messaging/sendSMS"));
 
echo '<h2>Request</h2><pre>' . htmlspecialchars($client->request, ENT_QUOTES) . '</pre>';
echo '<h2>Response</h2><pre>' . htmlspecialchars($client->response, ENT_QUOTES) . '</pre>';
echo '<h2>Debug</h2><pre>' . htmlspecialchars($client->debug_str, ENT_QUOTES) . '</pre>';
?>



© 2005-2007 UAB "BITE Lietuva", SIA "BITE Latvija"     © 2005-2007 UAB "Metasite Business Solutions"