PVS API Pre-built Libraries

We have simple libraries for use with our API backend. We have is Java, PHP, and VisualBasic along with some third-party provided libraries and modules.

We have a class for each section of data and are named accordingly. Each class has methods to access smaller pieces of data or to access the data in different ways. You can see documentation on each method from the menu on the right.

PHP

The PHP libraries require PHP 5 with the SimpleXML extension and "allow_url_fopen" set to 'On' in php.ini.

Using the libraries is fairly simple. You initialize the object with the name one of the methods and any arguments needed in an array. Then a call go getXmlObj() can be made to retrieve a SimpleXML object to work with. Let's say you wanted to get information on a bill...

Now $xml_object is a SimpleXML object representative of the XML structure. Here's a small cut from the XML itself.

Let's say you wanted to get the candidateId of the candidate. You could simply access it like this:

And anything with repeating rows like say, committee memberships would just be treated as an array.