Description:
A basic server-side web application using the PHP Programming Language. This example uses the XML API Interface through cURL, and parses the results using DOM XML. The example allows users to search using keywords and a basic category filter, and outputs most of the data found in the result set. This example contains code for making calls to Version 2 of the GetResearchResults API.
Download:
Requirements:
Installation:
1) Extract all files from the ZIP. Be sure to extract the files with Folder Names intact.
2) Open /basic/lib/APIBaseCall.php.
3) Replace the values on lines 26 thru 28 with your specific sandbox tokens.
4) Upload all files to a web accessable directory on your Website.
Now opening /basic/index.php on your web server should display an interface.
Troubleshooting:
When I try to load the page, I just see programming code. What's wrong?
Make sure that your webserver has PHP installed and enabled. If PHP 5.x is installed on your server, see this forum thread for tips on getting the example working.
When I try to load the page, it has an error about a cURL function not being found. What's missing?
Make sure the PHP installation on your web server has cURL enabled. Consult your web server and php documentation for instructions on how to do this.
When I try to load the page, it has an error about a DOM function not being found. What's missing?
Make sure the PHP installation on your web server has DOM XML enabled. Consult your web server and php documentation for instructions on how to do this.
When I make calls to the API, it takes a long time to get results. What's going on?
Check your cURL version. Older versions ( < 7.15.1 ) contained a bug when making calls to certain hosts while ipv6 is enabled. You can fix this issue by upgrading the cURL library on your server.
Preview: