[OPEN-ILS-DEV] Library card number via OSRF gateway?
Ken Cox
kenstir at gmail.com
Thu Jan 21 20:28:06 EST 2016
Aha! Thanks very much, Dan, you unlocked the mystery.
With method=open-ils.actor.user.fleshed.retrieve I can see my card number
(and my old inactive card number). With the pcrud methods (
open-ils.pcrud.search.ac, open-ils.pcrud.retrieve.ac), I get an empty
payload.
And thank you Jason and Thomas and Bill.
Regards,
Ken
On Thu, Jan 21, 2016 at 10:12 AM, Dan Wells <dbw2 at calvin.edu> wrote:
> 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¶m=%22AUTHTOKEN%22¶m=USER_ID
>
>
>
> Sincerely,
>
> Dan
>
>
>
>
>
> Daniel Wells
>
> Library Programmer/Analyst
>
> Hekman Library, Calvin College
>
> 616.526.7133
>
>
>
> *From:* Open-ils-dev [mailto:
> open-ils-dev-bounces at list.georgialibraries.org] *On Behalf Of *Ken Cox
> *Sent:* Wednesday, January 20, 2016 8:22 PM
> *To:* Evergreen Development Discussion List <
> open-ils-dev at list.georgialibraries.org>
> *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 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¶m=%22
> *authtoken*%22
>
> -> "usrname": "coxken", ... "id": 409071, ... "card": 1344653
>
>
>
>
> https://catalog.cwmars.org/osrf-gateway-v1?service=open-ils.pcrud&method=open-ils.pcrud.search.ac¶m=%22
> *authtoken*%22¶m=%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¶m=%22
> *authtoken*%22¶m=%7B%22usr%22:409071%7D
>
>
>
> -> {"payload":[],"status":200}
>
>
>
>
>
> On Wed, Jan 20, 2016 at 10:44 AM, Bill Erickson <berickxx at gmail.com>
> wrote:
>
>
>
> On Wed, Jan 20, 2016 at 10:23 AM, Bill Erickson <berickxx at gmail.com>
> wrote:
>
>
>
> On Wed, Jan 20, 2016 at 10:18 AM, Thomas Berezansky <tsbere at mvlc.org>
> 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
>
--
-Ken
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://libmail.georgialibraries.org/pipermail/open-ils-dev/attachments/20160121/b6b428f9/attachment.html>
More information about the Open-ils-dev
mailing list