Skip to Content.
Sympa Menu

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

cc-devel AT lists.ibiblio.org

Subject: Developer discussion for Creative Commons technology and tools

List archive

Chronological Thread  
  • From: Lisa Brooks <lisa AT issuelab.org>
  • To: cc-devel AT lists.ibiblio.org
  • Subject: [cc-devel] Having a problem with call to API "details"
  • Date: Fri, 17 Sep 2010 16:43:59 -0500

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:

[code]
function getLicenseByURI($uri) // $uri eg.
http://creativecommons.org/licenses/by-nc-nd/3.0/us/
{
$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);
curl_close($ch);
return $result;
}
[/code]

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

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

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
http://api.creativecommons.org/rest/1.5/details?license-uri=http://creativecommons.org/licenses/by-nc-nd/3.0/us/
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

Lisa M. Brooks
Co-director
IssueLab: bringing nonprofit research into focus - http://www.issuelab.org
lisa AT issuelab.org
773-649-1790




Archive powered by MHonArc 2.6.24.

Top of Page