Hello Ken,

Unfortunately, I think your average patron won’t have access through PCRUD even 
to their own data.  You get empty payloads in PCRUD if you make a requests you 
don’t have permission to view.

You can use the user API instead, as it has a method to retrieve the fleshed 
user with an exception to allow any user to view their own data.  Something 
like:

https://ulysses.calvin.edu/osrf-gateway-v1?service=open-ils.actor&method=open-ils.actor.user.fleshed.retrieve&param=%22AUTHTOKEN%22&param=USER_ID

Sincerely,
Dan


Daniel Wells
Library Programmer/Analyst
Hekman Library, Calvin College
616.526.7133

From: Open-ils-dev [mailto:[email protected]] On 
Behalf Of Ken Cox
Sent: Wednesday, January 20, 2016 8:22 PM
To: Evergreen Development Discussion List 
<[email protected]>
Subject: Re: [OPEN-ILS-DEV] Library card number via OSRF gateway?

Thank you for the quick responses.  But I am missing something important about 
calling these methods through the gateway.

I seem to have both the user ID and the card ID in the response from 
open-ils.auth.session.retrieve.  But when I try calling 
open-ils.pcrud.search.ac<http://open-ils.pcrud.search.ac> with either 
{"id":cardID} or {"usr":userID} I get an empty payload in response.

Can you spot what I am doing wrong?

Here are the redacted URLs I tried:

https://catalog.cwmars.org/osrf-gateway-v1?service=open-ils.auth&method=open-ils.auth.session.retrieve&param=%22authtoken%22
  ->  "usrname": "coxken", ... "id": 409071, ... "card": 1344653

https://catalog.cwmars.org/osrf-gateway-v1?service=open-ils.pcrud&method=open-ils.pcrud.search.ac&param=%22authtoken%22&param=%7B%22id%22:1344653%7D
  -> {"payload":[],"status":200}

https://catalog.cwmars.org/osrf-gateway-v1?service=open-ils.pcrud&method=open-ils.pcrud.search.ac&param=%22authtoken%22&param=%7B%22usr%22:409071%7D

  -> {"payload":[],"status":200}


On Wed, Jan 20, 2016 at 10:44 AM, Bill Erickson 
<[email protected]<mailto:[email protected]>> wrote:

On Wed, Jan 20, 2016 at 10:23 AM, Bill Erickson 
<[email protected]<mailto:[email protected]>> wrote:

On Wed, Jan 20, 2016 at 10:18 AM, Thomas Berezansky 
<[email protected]<mailto:[email protected]>> wrote:
As a note, I believe that PCRUD search will also return all non-primary and 
non-active cards.

Indeed that's true when fleshing the "cards" (virtual) field on the user.  When 
fleshing "card", you get the primary/active card.

Oh, right...  If you search for cards by user ID, then it will return all 
cards, active or otherwise for the user.  (I was thinking about fleshing cards 
on the user).  Thanks for pointing that out, Thomas.  Apologies for the 
misleading response.

-b





--
-Ken

Reply via email to