Using XML Web Services in Traditional ASP - Looking at the XML
(Page 2 of 4 )
Once you have your key, you should be able to get Flickr to give you an XML file back of data for which you ask. You can just browse to this data in your web browser and it will display the XML on the page.
In this example I am going to ask for all the photos in one of my sets. The URL you need to connect to is this one:
http://www.flickr.com/services/rest/?
method=flickr.photosets.getPhotos&api_key=[your_api_key]&photoset_id=
[your_set_id]
Where
method = This indicates the data you are after. In our case we want all the photos in a specific set, but there are many methods you can call; they are all well documented with examples and error codes at http://www.flickr.com/services/api/.
api_key = The API key which Flickr provided to you.
photoset_id = The ID number of the photoset you want to work with. To get the ID of the set, edit or organize the set from your Flickr home page, in the URL you should see a long number, this is the set ID.
Open up your browser, put in this URL and you should get something like the results below.
<rsp stat="ok">
<photoset id="72157600062159087" primary="454359661" owner="7389734@N03" ownername="beakersoft" page="1" per_page="500" pages="1" total="43">
<photo id="454359661" secret="4684abec3c" server="211" farm="1" title="Liberation" isprimary="1"/>
<photo id="454359589" secret="83272f352e" server="246" farm="1" title="Lancaster bomber" isprimary="0"/>
<photo id="454346424" secret="33687a2ee7" server="168" farm="1" title="Daniels hanmer" isprimary="0"/>
<photo id="465125882" secret="066c38a39d" server="207" farm="1"
title="The Bridge Burnley" isprimary="0"/>
</photoset>
</rsp>
This XML file is showing me details of all the photos in the set. We can then use this data in our application.
Next: Formatting the Data Using XSL >>
More ASP.NET Articles
More By Luke Niland