Friday, March 7, 2008

Feature of the Week: Tags for Resources

If you're using the API and are interested in all tags users have assigned to a specific resource, you now have the possibility to get the tags by using the API-URL with the parameter "resource=[hash]" (together with the parameter "resourcetype"). E.g., a request to /api/tags?resourcetype=bookmark&resource=64122a860e632f5ed0148740e25239e6 gives you all tags for the bookmark with the hash 64122a860e632f5ed0148740e25239e6. This allows you to include all tags related to a resource in your application.

Please note, that you have to use the interHash of a resource (as given in the XML output of the API) for this functionality. Further information can be found in the API documentation.

Note: When using hashes of BibTeX posts from the BibSonomy web interface links (e.g., /bibtex/295b16cdb7731d697234d355fc4e68fe3), one must be careful to pick the "correct" hash. In the links all intra-hashes currently have a "2" and all inter-hashes a "1" prepended and are thus 33 characters long (compare /bibtex/295b16cdb7731d697234d355fc4e68fe3/emanuel with /bibtex/1148dc0c64433f631174b5fc419597dd6). This is to distinguish several types of hashes in the web interface (the "old" intra-hashes which started with a "0" still work!). So when using a hash from the web interface, care must be taken that it is really an intra-hash (e.g., starts with a "2") and before querying the API the preceeding "2" must be removed.
We will shortly extend the API to also accept 33 characters long intra-hashes.

Popular Posts