Discussion:
[cc-devel] cc-devel Digest, Vol 65, Issue 4
Lisa Brooks
2011-01-25 20:00:53 UTC
Permalink
Hi there -

Recently -- within the last couple of weeks or so -- one of our processes
here that relies on a call to the CC API stopped working.

We use cURL and PHP to post data to the CC API and get back the license URI.
Here's the function that we use -- this hasn't been changed in months:

function makeCCLicense($commercial, $derivatives, $jurisdiction)
{
$ch = curl_init('
http://api.creativecommons.org/rest/1.5/license/standard/get');
curl_setopt($ch, CURLOPT_POST, TRUE);
curl_setopt($ch, CURLOPT_POSTFIELDS, 'commercial=' . $commercial .
'&derivatives=' . $derivatives . '&jurisdiction=' . $jurisdiction);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
$result = curl_exec($ch);
curl_close($ch);
....}

I've been testing for clues and have set this up to print the contents of
the $result variable to the screen. I get "None". I used to get something
like "http://creativecommons.org/licenses/by-nc-nd/3.0/us/", depending on
the chooser's choices.

I've run out of things to check/tweak on our side. I'm now wondering if we
are experiencing this problem due to the changes that you all just did to
the API?

Appreciate any help you 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
Send cc-devel mailing list submissions to
cc-devel at lists.ibiblio.org
To subscribe or unsubscribe via the World Wide Web, visit
http://lists.ibiblio.org/mailman/listinfo/cc-devel
or, via email, send a message with subject or body 'help' to
cc-devel-request at lists.ibiblio.org
You can reach the person managing the list at
cc-devel-owner at lists.ibiblio.org
When replying, please edit your Subject line so it is more specific
than "Re: Contents of cc-devel digest..."
1. Re: CC REST API Updated for Public Domain Mark (Asheesh Laroia)
----------------------------------------------------------------------
Message: 1
Date: Tue, 25 Jan 2011 10:16:44 -0500 (EST)
From: Asheesh Laroia <asheesh at asheesh.org>
To: cc-devel at lists.ibiblio.org
Subject: Re: [cc-devel] CC REST API Updated for Public Domain Mark
Message-ID: <alpine.DEB.2.00.1101251014510.30434 at rose.makesad.us>
Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed
Hello everyone,
This morning, the CC REST API was updated to include support for the
Public Domain Mark and to deprecate the issuing of the retired Public
Domain Certification and Dedication. We have also added a new element,
`deprecated`, in license responses, that denotes whether or not the
issued license has been deprecated by Creative Commons. These changes
affect all versions of the REST API, excluding 1.0.
This is a bit of a late reply, but -- it's *great* to see the 'deprecated'
metadata showing up in the REST API. That's excellent.
And the new Public Domain stuff Mark work been a long time coming. A lot
of CC fans really appreciate the work CC is doing on revising that, and so
it's a really welcome sign that it's stable enough to land in the API.
-- Asheesh.
--
You will triumph over your enemy.
------------------------------
_______________________________________________
cc-devel mailing list
cc-devel at lists.ibiblio.org
http://lists.ibiblio.org/mailman/listinfo/cc-devel
End of cc-devel Digest, Vol 65, Issue 4
***************************************
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ibiblio.org/pipermail/cc-devel/attachments/20110125/94c61e6c/attachment.html
John Doig
2011-01-25 20:09:09 UTC
Permalink
Hello Lisa,

The issue appears to be that you are attempting to POST to an URL that
does not accept POST requests. If you change the line:

$ch =
curl_init('http://api.creativecommons.org/rest/1.5/license/standard/get');

to:

$ch =
curl_init('http://api.creativecommons.org/rest/1.5/license/standard/issue');

then your call to the API will return a result other than "None."

For more information about the 'issue' and 'get' API calls, you can view
the API's documentation at
http://api.creativecommons.org/docs/readme_15.html#license-class-get.
Hope this helps resolve your issue!

-John Doig
Post by Lisa Brooks
Hi there -
Recently -- within the last couple of weeks or so -- one of our
processes here that relies on a call to the CC API stopped working.
We use cURL and PHP to post data to the CC API and get back the
license URI. Here's the function that we use -- this hasn't been
function makeCCLicense($commercial, $derivatives, $jurisdiction)
{
$ch =
curl_init('http://api.creativecommons.org/rest/1.5/license/standard/get'
<http://api.creativecommons.org/rest/1.5/license/standard/get%27>);
curl_setopt($ch, CURLOPT_POST, TRUE);
curl_setopt($ch, CURLOPT_POSTFIELDS, 'commercial=' . $commercial .
'&derivatives=' . $derivatives . '&jurisdiction=' . $jurisdiction);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
$result = curl_exec($ch);
curl_close($ch);
....}
I've been testing for clues and have set this up to print the contents
of the $result variable to the screen. I get "None". I used to get
something like "http://creativecommons.org/licenses/by-nc-nd/3.0/us/",
depending on the chooser's choices.
I've run out of things to check/tweak on our side. I'm now wondering
if we are experiencing this problem due to the changes that you all
just did to the API?
Appreciate any help you can offer - thanks!
~Lisa
Lisa M. Brooks
Co-director
IssueLab: bringing nonprofit research into focus - http://www.issuelab.org
lisa at issuelab.org <mailto:lisa at issuelab.org>
773-649-1790
On Tue, Jan 25, 2011 at 12:21 PM, <cc-devel-request at lists.ibiblio.org
Send cc-devel mailing list submissions to
cc-devel at lists.ibiblio.org <mailto:cc-devel at lists.ibiblio.org>
To subscribe or unsubscribe via the World Wide Web, visit
http://lists.ibiblio.org/mailman/listinfo/cc-devel
or, via email, send a message with subject or body 'help' to
cc-devel-request at lists.ibiblio.org
<mailto:cc-devel-request at lists.ibiblio.org>
You can reach the person managing the list at
cc-devel-owner at lists.ibiblio.org
<mailto:cc-devel-owner at lists.ibiblio.org>
When replying, please edit your Subject line so it is more specific
than "Re: Contents of cc-devel digest..."
1. Re: CC REST API Updated for Public Domain Mark (Asheesh Laroia)
----------------------------------------------------------------------
Message: 1
Date: Tue, 25 Jan 2011 10:16:44 -0500 (EST)
From: Asheesh Laroia <asheesh at asheesh.org
<mailto:asheesh at asheesh.org>>
To: cc-devel at lists.ibiblio.org <mailto:cc-devel at lists.ibiblio.org>
Subject: Re: [cc-devel] CC REST API Updated for Public Domain Mark
Message-ID: <alpine.DEB.2.00.1101251014510.30434 at rose.makesad.us
<mailto:alpine.DEB.2.00.1101251014510.30434 at rose.makesad.us>>
Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed
Hello everyone,
This morning, the CC REST API was updated to include support for the
Public Domain Mark and to deprecate the issuing of the retired
Public
Domain Certification and Dedication. We have also added a new
element,
`deprecated`, in license responses, that denotes whether or not the
issued license has been deprecated by Creative Commons. These
changes
affect all versions of the REST API, excluding 1.0.
This is a bit of a late reply, but -- it's *great* to see the 'deprecated'
metadata showing up in the REST API. That's excellent.
And the new Public Domain stuff Mark work been a long time coming. A lot
of CC fans really appreciate the work CC is doing on revising that, and so
it's a really welcome sign that it's stable enough to land in the API.
-- Asheesh.
--
You will triumph over your enemy.
------------------------------
_______________________________________________
cc-devel mailing list
cc-devel at lists.ibiblio.org <mailto:cc-devel at lists.ibiblio.org>
http://lists.ibiblio.org/mailman/listinfo/cc-devel
End of cc-devel Digest, Vol 65, Issue 4
***************************************
_______________________________________________
cc-devel mailing list
cc-devel at lists.ibiblio.org
http://lists.ibiblio.org/mailman/listinfo/cc-devel
John Doig
2011-01-26 01:28:07 UTC
Permalink
Hello again Lisa,

After first replying to your issue earlier today, I realized that you
were right in your assumption that a change must have been introduced by
the recent updates made to the API.

The /license/standard/get API call was supposed to only support HTTP GET
requests, but looking back on the old codebase reveals that this wasn't
always the case. HTTP POST requests were being supported even though our
doc's said otherwise.

I've updated our existing codebase to be backwards compatible and accept
POST requests to the /license/standard/get call. Changing your code is
no longer necessary, but I would still recommend changing the URL of the
API call to ../issue if you insist on making POST requests.

Apologies for not accepting responsibility earlier on and thank you for
bringing this issue to our attention!

Thanks,
-John Doig
Post by John Doig
Hello Lisa,
The issue appears to be that you are attempting to POST to an URL that
$ch =
curl_init('http://api.creativecommons.org/rest/1.5/license/standard/get');
$ch =
curl_init('http://api.creativecommons.org/rest/1.5/license/standard/issue');
then your call to the API will return a result other than "None."
For more information about the 'issue' and 'get' API calls, you can
view the API's documentation at
http://api.creativecommons.org/docs/readme_15.html#license-class-get.
Hope this helps resolve your issue!
-John Doig
Post by Lisa Brooks
Hi there -
Recently -- within the last couple of weeks or so -- one of our
processes here that relies on a call to the CC API stopped working.
We use cURL and PHP to post data to the CC API and get back the
license URI. Here's the function that we use -- this hasn't been
function makeCCLicense($commercial, $derivatives, $jurisdiction)
{
$ch =
curl_init('http://api.creativecommons.org/rest/1.5/license/standard/get'
<http://api.creativecommons.org/rest/1.5/license/standard/get%27>);
curl_setopt($ch, CURLOPT_POST, TRUE);
curl_setopt($ch, CURLOPT_POSTFIELDS, 'commercial=' . $commercial .
'&derivatives=' . $derivatives . '&jurisdiction=' . $jurisdiction);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
$result = curl_exec($ch);
curl_close($ch);
....}
I've been testing for clues and have set this up to print the
contents of the $result variable to the screen. I get "None". I used
to get something like
"http://creativecommons.org/licenses/by-nc-nd/3.0/us/", depending on
the chooser's choices.
I've run out of things to check/tweak on our side. I'm now wondering
if we are experiencing this problem due to the changes that you all
just did to the API?
Appreciate any help you can offer - thanks!
~Lisa
Lisa M. Brooks
Co-director
IssueLab: bringing nonprofit research into focus -
http://www.issuelab.org
lisa at issuelab.org <mailto:lisa at issuelab.org>
773-649-1790
On Tue, Jan 25, 2011 at 12:21 PM, <cc-devel-request at lists.ibiblio.org
Send cc-devel mailing list submissions to
cc-devel at lists.ibiblio.org <mailto:cc-devel at lists.ibiblio.org>
To subscribe or unsubscribe via the World Wide Web, visit
http://lists.ibiblio.org/mailman/listinfo/cc-devel
or, via email, send a message with subject or body 'help' to
cc-devel-request at lists.ibiblio.org
<mailto:cc-devel-request at lists.ibiblio.org>
You can reach the person managing the list at
cc-devel-owner at lists.ibiblio.org
<mailto:cc-devel-owner at lists.ibiblio.org>
When replying, please edit your Subject line so it is more specific
than "Re: Contents of cc-devel digest..."
1. Re: CC REST API Updated for Public Domain Mark (Asheesh Laroia)
----------------------------------------------------------------------
Message: 1
Date: Tue, 25 Jan 2011 10:16:44 -0500 (EST)
From: Asheesh Laroia <asheesh at asheesh.org
<mailto:asheesh at asheesh.org>>
To: cc-devel at lists.ibiblio.org <mailto:cc-devel at lists.ibiblio.org>
Subject: Re: [cc-devel] CC REST API Updated for Public Domain Mark
Message-ID: <alpine.DEB.2.00.1101251014510.30434 at rose.makesad.us
<mailto:alpine.DEB.2.00.1101251014510.30434 at rose.makesad.us>>
Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed
Hello everyone,
This morning, the CC REST API was updated to include support for the
Public Domain Mark and to deprecate the issuing of the retired
Public
Domain Certification and Dedication. We have also added a new
element,
`deprecated`, in license responses, that denotes whether or not the
issued license has been deprecated by Creative Commons. These
changes
affect all versions of the REST API, excluding 1.0.
This is a bit of a late reply, but -- it's *great* to see the 'deprecated'
metadata showing up in the REST API. That's excellent.
And the new Public Domain stuff Mark work been a long time coming. A lot
of CC fans really appreciate the work CC is doing on revising that, and so
it's a really welcome sign that it's stable enough to land in the API.
-- Asheesh.
--
You will triumph over your enemy.
------------------------------
_______________________________________________
cc-devel mailing list
cc-devel at lists.ibiblio.org <mailto:cc-devel at lists.ibiblio.org>
http://lists.ibiblio.org/mailman/listinfo/cc-devel
End of cc-devel Digest, Vol 65, Issue 4
***************************************
_______________________________________________
cc-devel mailing list
cc-devel at lists.ibiblio.org
http://lists.ibiblio.org/mailman/listinfo/cc-devel
Loading...