Skip to content
Jun 25 / kkrizka

Problems with the Digg API

I was trying to get my S2R application to work again, but it would not because of a trivial change in the Digg API. I have no idea when this happened, but it must have been some time ago. Anyways, I kept getting the following error: “A Digg API request is missing the callback argument.” A quick google for it didn’t produce any results, only that it is error number 1002, so I had to try different examples shown in the API documentation. After trail and error, I found the solution; you have to add the type=[xml,json,php,javascript] query to the request to indicate how you want the results listed. Morever you also have to add an appkey query; this can be any URL and so far it only serves for statistical purposes. Finally, make sure to set the User-Agent HTTP header in your script. In PHP, this can be done by 1 simple line:

ini_set(“user_agent”, “Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)”);

It doesn’t really matter what you set it to.

This post only applies to those that wrote old applications to use the Digg API before there was an official documentation. For those of you that are new, you already learned all this if you followed the Basic Concepts tutorial provided by Digg.com

Leave a comment