[cc-devel] Having a problem with call to API "details"

Lisa Brooks lisa at issuelab.org
Fri Sep 17 17:43:59 EDT 2010

Hi there -

We have been using the CC API with no problems for several months.
About a week ago we started having a problem with a call to "details".

We save the URI of the CC license to our database and then use PHP and
cURL to do a post request to retrieve the appropriate text as needed.
Here's the code we've been using without a hitch for months:

function getLicenseByURI($uri) // $uri eg.
   $ch = curl_init('http://api.creativecommons.org/rest/1.5/details');
   curl_setopt($ch, CURLOPT_POST, TRUE);
   curl_setopt($ch, CURLOPT_POSTFIELDS, 'license-uri=' . $uri);
   curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
   $result = curl_exec($ch);
   return $result;

Now, rather than returning the license text, this code returns this
error message:

   <message>A value for license-uri must be supplied.</message>

I read in the instructions that "Errors occuring from either invalid
input or server-side problems are returned as an XML block, with an
<error> top level element."

If I do a get by calling up
in my browser, all works fine.

I've tried changing the call to use 1.0, dev, staging -- nothing seems
to get the job done anymore.

Appreciate any help anyone can offer! Thanks!

Lisa M. Brooks
IssueLab: bringing nonprofit research into focus - http://www.issuelab.org
lisa at issuelab.org

More information about the cc-devel mailing list