This is a simple monitor that makes a number of requests to the core Flickr API and validates their responses. Download the project and import it into SoapUI as described at …
The project has the following structure:
The Flickr API uses a single path to access many resources; /services/rest, the actual method is specified as a parameter (see example below).
The TestCase contains 4 simple requests that validate their responses correspondingly:
- Interestingness Request - gets the current list of Interestingness at flickr in JSON format and validates the response to contain 100 entries (which it actually won’t always do)
- Find User Request – searches for a user by username and validates the content of the XML response to contain that users details.
- Get Cameras – Gets a SOAP-formatted list of camera brands used in photos at Flickr and checks for the existence of a specific brand
- Find Places – Searches for the place “Stockholm” and validates that there is at least one hit in the JSON response
To be able to use the Flickr API you need an API-key, which you can get when registering with the Flickr “App Garden” (http://www.flickr.com/services/apps/create/apply). The sample project defines a “ApiKey” property at the project level which is to be set to that key. It is then used in all requests via standard property expansion:
As mentioned above - Flickr uses one path as entry point to all API calls, the actual method is specified as a query argument; “flickr.photos.search” in the example above.
Download Flickr Sample project