Okay. You're right actually. I was for whatever reason thinking that
this is not the case. Perhaps I made an error in my initial coding, but
I went back and tried the json_encode function again, and it performed
as you said, which also is how the documentation says it should behave.

This is my test code:


//$query = '{"key~":"/about/*"}';
$query = json_encode(array('key~'=>'\/about\/*'));
echo $query . "\n";
$curlRsc = curl_init();
$url = "" . urlencode($query) .
echo "{$url}\n";
curl_setopt($curlRsc, CURLOPT_URL, $url);
curl_setopt($curlRsc, CURLOPT_HEADER, 1);
curl_setopt($curlRsc, CURLOPT_RETURNTRANSFER, 1);
$results = curl_exec($curlRsc);
echo $results;
echo curl_error($curlRsc) . "\n";

And this is the output, which behaves as expected:


HTTP/1.1 200 OK
Connection: close
Content-type: application/json
Content-Length: 560
Date: Thu, 05 Jun 2008 22:56:28 GMT
Server: lighttpd/1.4.15

{"status": "ok", "result": ["\/about\/architecture", "\/about\/banned",
"\/about\/calendar", "\/about\/catalog", "\/about\/contact",
"\/about\/faq", "\/about\/help", "\/about\/help\/libraries",
"\/about\/help\/oclc", "\/about\/help\/upload", "\/about\/infogami-dc",
"\/about\/jobs", "\/about\/lib", "\/about\/ol_info_sheet",
"\/about\/olmeeting2008", "\/about\/oln", "\/about\/pagelist",
"\/about\/people", "\/about\/press", "\/about\/publishers",
"\/about\/relnote", "\/about\/sample_publisher_letter",
"\/about\/schema", "\/about\/tech", "\/about\/vision"]}

Anyhow, thanks for the gentle nudge. The API seems to work just fine
after all!

David Cloutman <[log in to unmask]>
Electronic Services Librarian
Marin County Free Library

-----Original Message-----
From: Code for Libraries [mailto:[log in to unmask]] On Behalf Of
Jonathan Rochkind
Sent: Thursday, June 05, 2008 3:16 PM
To: [log in to unmask]
Subject: [CODE4LIB] refworks developer documentation?

Does anyone know where, if anywhere, I find documentation on the ways to
send references to RefWorks for importing?

Not having any luck on their website. I know I've seen it before
though.  I remember there were a variety of formats and methods you
could send things to RefWorks for an import. Must be documentation
somewhere?  I bet some code4libber has done this before.


Jonathan Rochkind
Digital Services Software Engineer
The Sheridan Libraries
Johns Hopkins University
rochkind (at)

Email Disclaimer: