Authentication: alle API Anfragen benötigen HTTP Basic Auth (Login)
posts/all | fetch all bookmarks by date or index range | |
posts/add | add a new bookmark | |
posts/delete | delete an existing bookmark | |
posts/get | get bookmark for a single date, or fetch specific items | |
posts/recent | fetch recent bookmarks | |
posts/dates | list dates on which bookmarks were posted | |
posts/update | check to see when a user last posted an item |
tags/get | fetch all tags | |
tags/rename | rename a tag on all posts |
get all bookmarks (by tag/date)
&tag={TAG}
(optional) Filter by this tag.
&start={xx}
(optional) Start returning posts this many results into the set.
&results={xx}
(optional) Return this many results.
&fromdt={CCYY-MM-DDThh:mm:ssZ}
(optional) Filter for posts on this date or later
&todt={CCYY-MM-DDThh:mm:ssZ}
(optional) Filter for posts on this date or earlier
&meta=yes
(optional) Include change detection signatures on each item
Add a post (bookmark)
&url={URL}
(required) the url of the item.
&description={...}
(required) the description of the item.
&extended={...}
(optional) notes for the item.
&tags={...}
(optional) tags for the item (comma delimited).
&dt={CCYY-MM-DDThh:mm:ssZ}
(optional) datestamp of the item (format "CCYY-MM-DDThh:mm:ssZ").
Requires a LITERAL "T" and "Z" like in ISO8601 example: "1984-09-01T14:21:31Z"
&replace=no
(optional) don't replace post if given url has already been posted.
&shared=yes
(optional) make the item public or private
Delete a post (bookmark)
&url={URL}
(required) the url of the item.
Returns one or more posts (bookmarks) on a single day matching the arguments.
If no date or url is given, most recent date will be used.
&tag={TAG}+{TAG}+...+{TAG}
(optional) Filter by this tag.
&dt={CCYY-MM-DDThh:mm:ssZ}
(optional) Filter by this date, defaults to the most recent date on which bookmarks were saved.
&url={URL}
(optional) Fetch a bookmark for this URL, regardless of date.
Note: Be sure to URL-encode the argument value.
&hashes={MD5}+{MD5}+...+{MD5}
(optional) Fetch multiple bookmarks by one or more URL MD5s regardless of date,
separated by URL-encoded spaces (ie. '+').
&meta=yes
(optional) Include change detection signatures on each item in a 'meta' attribute.
Returns a list of the most recent posts (bookmarks) , filtered by argument. Maximum 100.
&tag={TAG}
(optional) Filter by this tag.
&count={1..100}
(optional) Number of items to retrieve (Default:15, Maximum:100).
Returns a list of dates with the number of posts (bookmarks) at each date.
&tag={TAG}
(optional) Filter by this tag
Returns the last update time for the user, as well as the number of new items in the user's inbox since it was last visited
<none>
Returns a list of tags and number of times used by a user.
<none>
Rename an existing tag with a new tag name.
&old={TAG}
(required) Tag to rename.
&new={TAG}
(required) New tag name.
(Beispiel: posts/all API Request)
<?php // ---------------------------------------------- $username = 'YourUsername'; $passwort = 'YourPassword'; $bservice = 'http://webgalaxy.12hp.de/bookmark/';
$bservice = rtrim($bservice, '/');
$bservice = str_replace('http://','',$bservice);
$b_method = 'posts/all'; ## $b_method = 'posts_all.php'; $serviceurl = 'http://'.$username.':'.$passwort.'@'.$bservice.'/api/'.$b_method.''; $searchtag = 'favoriten'; // ---- search for tag or leave blank ---- $res_limit = '10'; // ---- results limit (maximum items) ---- $parameter = '?tag='.$searchtag.'&results='.$res_limit.'&meta=yes'; $apigeturl = $serviceurl.$parameter; // ---------------------------------------------- print "<br />\n"; print "<br />DEBUG\n"; print "<br />\n"; // ---------------------------------------------- // ------------- Result XML String -------------- $res_str = file_get_contents($apigeturl); $res_nfo = htmlentities($res_str); print "<pre>\n"; print_r($res_nfo); print "</pre>\n"; print "<br />\n"; print "<br />\n"; print "<br />\n"; // ---------------------------------------------- // ------------- Result PHP Object -------------- $res_obj = simplexml_load_file($apigeturl); print "<pre>\n"; print_r($res_obj); print "</pre>\n"; print "<br />\n"; print "<br />\n"; print "<br />\n"; // ---------------------------------------------- ?>
... mehr Infos zur API siehe auch: delicious.com/developers