Access Keys:
Skip to content (Access Key - 0)


Introduction

This is a quick and easy example of how to use the BOS Rest services in PHP. It is by no means production worthy and is just a very simple example that returns the telephone number of the queried BOS user. There is no error handling etc.

Assumptions

The example assumes the following:

  1. The base url is http://bos2.bulletinwireless.net/newrest/REST/BOS/Customer/username/.
  2. A valid BOS user is being queried.
  3. A valid authorised BOS user is making the query.
  4. The PHP script is located at http://webmail.bulletin.net/temp/sample.php.

Components

The first component of the example is a very basic HTML form used to submit the BOS user we want to query and the authorised user name and password submitting the query. The source code is below:

The second component of the example is the PHP script. The script does the following:

  1. Gets the username, userid and password from the HTML form.
  2. Builds the url to submit.
  3. Submits the url and gets a response.
  4. Loads the response as an XML string.
  5. Queries the namespace referred to in the returned XML string
  6. Gets all elements in the XML.
  7. Gets and prints the telephone number element.

The source code for the script is below:

Try it.

To try the example enter a valid BOS username to query, a valid BOS userid making the query and password for the userid, then click the submit button.

You should see a plain page with the following:

The phone number for BOS user (username you entered) is (whatever phone number is)


This quick and easy PHP sample will return the phone number of the BOS username entered.

Enter the BOS username to query:

Enter the authorised BOS userid:

Enter the password for authorised BOS userid:


Adaptavist Theme Builder (3.1.4) Powered by Atlassian Confluence, the Enterprise Wiki. (Version: 2.5.2 Build:#807 May 20, 2007)
Important Links: --- Bug / Task Tracker --- CRM System --- Bulletin Online --- SDK --- Glossary --- FlexTXT --- Ask the Oracle