BCI API Support Reference (version 1.0)


Usage - PHP Examples

The following simple examples illustrate how to use the BCI API from an application built using PHP 5 and SOAP.

Example 1: Authenticatation using SOAP

<?php // connect to the API service to authenticate $url = "http://api.bciaustralia.com/auth.cfc?wsdl"; try //try creating a soap object and call function dologin { $client = new SoapClient($url); $client->__setLocation("https://api.bciaustralia.com/auth.cfc"); $result = $client->doLogin(array('clientID' => "apiuser", 'password' => "dummypassword")); } catch (SoapFault $fault) //catch any error with failed attempt { echo "Login Failed with this error: ".$fault->faultstring; exit; } //continue with login and save token into variable $token = $result->return->entry->value;