You can access our backend with any software that can read XML or make plain HTTP requests. If you wanted the XML of a candidate bio, a simple call the a URL like the following is all you need. Grab your key and try this out in your Web browser.
Here is an example of interfacing with our backend using PHP with the SimpleXML extension. This example uses our old District class.
We have three files here which will be described below.
- This file merges the HTML and data pulled from the PVS API. It's also the controler which initializes the data gathering object
- This file contains the various configuration we will need. Storing things like the auth key and server hostname.
- This file, while remarkably simple is what does the heavy lifting. It contacts the server, retrieves the XML and stores it in a SimpleXML data object