Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Message from discussion Some REST API questions

Received: by 10.216.28.8 with SMTP id f8mr19601wea.14.1299108550227;
        Wed, 02 Mar 2011 15:29:10 -0800 (PST)
X-BeenThere: zotero-dev@googlegroups.com
Received: by 10.216.20.18 with SMTP id o18ls149391weo.1.p; Wed, 02 Mar 2011
 15:29:08 -0800 (PST)
Received: by 10.216.29.134 with SMTP id i6mr20304wea.9.1299108548934;
        Wed, 02 Mar 2011 15:29:08 -0800 (PST)
Received: by 10.216.29.134 with SMTP id i6mr20303wea.9.1299108548880;
        Wed, 02 Mar 2011 15:29:08 -0800 (PST)
Return-Path: <pjke...@gmail.com>
Received: from mail-wy0-f169.google.com (mail-wy0-f169.google.com [74.125.82.169])
        by gmr-mx.google.com with ESMTPS id f60si58959wes.2.2011.03.02.15.29.07
        (version=TLSv1/SSLv3 cipher=OTHER);
        Wed, 02 Mar 2011 15:29:07 -0800 (PST)
Received-SPF: pass (google.com: domain of pjke...@gmail.com designates 74.125.82.169 as permitted sender) client-ip=74.125.82.169;
Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of pjke...@gmail.com designates 74.125.82.169 as permitted sender) smtp.mail=pjke...@gmail.com; dkim=pass (test mode) header...@gmail.com
Received: by mail-wy0-f169.google.com with SMTP id 11so625216wyi.0
        for <zotero-dev@googlegroups.com>; Wed, 02 Mar 2011 15:29:07 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=gamma;
        h=domainkey-signature:mime-version:sender:in-reply-to:references:date
         :x-google-sender-auth:message-id:subject:from:to:cc:content-type
         :content-transfer-encoding;
        bh=ZDuk7PpAG/FiAwVy7f6nSGsgr4XiEOj2jR+Bd+remY8=;
        b=vsh/qQZ5M1N/vekcSfNXXSTMdeniV4Mzo8R8zNvP2IUjYOp/hgBeAQ3YqT0iUS5u9S
         TFiAMthmLQCp/W+OFZg04lMYc0mTO7gWTpoFBOyyu2QXnSGMOS/SLsgfjjrOrem9rf9A
         t0HqxX93Z93aYxO7e3+yfKXikt2yWW8gOVSrY=
DomainKey-Signature: a=rsa-sha1; c=nofws;
        d=gmail.com; s=gamma;
        h=mime-version:sender:in-reply-to:references:date
         :x-google-sender-auth:message-id:subject:from:to:cc:content-type
         :content-transfer-encoding;
        b=Cubs2ChWgsXgLF+gTL+anCvw2SXLofBk6B4rMVh/uDoKAHzClsVsHWf1/0pPLbhG12
         fga0rxdwlUzQsBkJOJE8WDpajdvGZ7lfyyJ7PgD7j8t69rZHBc9Kh9qIK+2w5GZ6UxWh
         ylkOKnRo28OTKXzt8tyHULPTWqIhq8x2Aazs0=
MIME-Version: 1.0
Received: by 10.216.145.222 with SMTP id p72mr253490wej.65.1299108547479; Wed,
 02 Mar 2011 15:29:07 -0800 (PST)
Sender: pjke...@gmail.com
Received: by 10.216.253.201 with HTTP; Wed, 2 Mar 2011 15:29:07 -0800 (PST)
In-Reply-To: <4D6ECC03.2020...@zotero.org>
References: <8ee374b7-27d2-484e-95be-77ce4c3c9...@u3g2000vbe.googlegroups.com>
	<4D6D49EC.8030...@zotero.org>
	<AANLkTikb-pOHmKTH+iD=nvEHi8rcd0D5-1jy0=AUa...@mail.gmail.com>
	<4D6D558F.2000...@zotero.org>
	<AANLkTin2CidPRera_8CkgqN4-WiPvntH+usoRjDkk...@mail.gmail.com>
	<AANLkTinhVKcL1riX5ZthezCvXAWcv4BsMz=QXeRKy...@mail.gmail.com>
	<4D6DDD44.5050...@zotero.org>
	<AANLkTi=rUpOT2gbRUWMGofhwhty+H6dPV76fzMxGi...@mail.gmail.com>
	<6baf7453-287f-4c46-bbce-699e0cf2e...@a5g2000vbs.googlegroups.com>
	<4D6EC6D7.1060...@zotero.org>
	<4D6EC9A1.6040...@zotero.org>
	<4D6ECC03.2020...@zotero.org>
Date: Wed, 2 Mar 2011 17:29:07 -0600
Message-ID: <AANLkTinaAYHXPd4mcnG=dUs6ps8XQ3WU78TWLPmat...@mail.gmail.com>
Subject: Re: Some REST API questions
From: Peter Keane <pke...@mail.utexas.edu>
To: zotero-dev@googlegroups.com
Cc: Dan Stillman <dstill...@zotero.org>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

Just a suggestion....

Concerning RESTful practice, it's import to honor the HATEOAS
constraint (Hypermedia as the Engine of Application State), meaning
that with any representation, related representations of interest
should be actual hypertext links.  So Instead of parsing the
representation to find a group id and then constructing the proper URL
(that you know how to construct based on some documenation somewhere),
you might have, say, within a representation of a "user" the following
link:

<link rel=3D"http://zotero.org/relation/user_groups"
href=3D"http//zotero.org/user/johndoe/1234/groups">

Documentation for an API should only need to document:

-- what the resources of interest are (users, user groups, titles, etc.)
-- what standardized formats are used for representations (Atom.XHTML,
JSON -- in which case the actual structure of the JSON, noting how
user agent recognizes a hyperlink needs to be specified)
-- define the link rels used (preferably using those found in the IANA
link registry: http://www.iana.org/assignments/link-relations/link-relation=
s.xml
if/when applicable).

--peter

On Wed, Mar 2, 2011 at 5:00 PM, Dan Stillman <dstill...@zotero.org> wrote:
> On 3/2/11 5:50 PM, Dan Stillman wrote:
>>
>> On 3/2/11 5:38 PM, Dan Stillman wrote:
>>>
>>> On 3/2/11 5:28 PM, urschrei wrote:
>>>>
>>>> I personally think it's a great discussion to have, so no apologies
>>>> necessary. Re-railing somewhat to the original subject (questions): Am
>>>> I correct in saying that there's no API call to retrieve a set of
>>>> groups of which a user is a member? This means that API calls
>>>> requiring<groupid> =C2=A0must know the group ID in advance; there's no=
 way
>>>> to perform a 'higher level' or other initial call to return all public
>>>> groups, or all groups of which a user is a member.
>>>
>>> Group membership calls are not public, but there's been some demand for=
 a
>>> call to determine the libraries the current API key has access to, alon=
g
>>> with permissions for each library. So we'll likely be adding that.
>>
>> Addendum: Faolan reminds me that /groups with an API key returns the
>> groups that the key has access to (including public ones the user belong=
s to
>> even if the key doesn't have explicit permissions for it).
>
> Sorry, make that /users/<userID>/groups. I've added this call to the API
> doc.
>
> --
> You received this message because you are subscribed to the Google Groups
> "zotero-dev" group.
> To post to this group, send email to zotero-dev@googlegroups.com.
> To unsubscribe from this group, send email to
> zotero-dev+unsubscribe@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/zotero-dev?hl=3Den.
>
>