ObjectiveSubject / ccl

1 stars 0 forks source link

Make an appointment with a librarian module #81

Open kpettinga opened 6 years ago

kpettinga commented 6 years ago

From @gabrielo-cuc

So to clarify, this bit is a little different from the shortcode. On the http://libraryweb.wpengine.com/librarians/?sort=alpha page, each librarian has an appointment CTA, ie. "Make an Appointment with #### ####" So initially there was a placeholder for this link. So I updated it to go to lical's appointment page: https://claremont.libcal.com/appointments/?g=1372. Now each librarian has their own individual appointment module offered through LibCal. For example, if you go to Lydia's profile page http://libguides.libraries.claremont.edu/prf.php?account_id=63838 and click on "Schedule an appointment with Lydia", a custom appointment module will pop up.


@gabrielo-cuc thanks for clarifying here. Basically it sounds like you want to "deep link" directly to setting up an appointment with a specific librarian, rather than making a user drill down through the various groups in order to find who they're looking for.

I took a harder look at the scheduler widget and we can definitely do this by specifying the uid parameter in the scheduler code. The problem we're having is that we're not getting the required UID for each staff/librarian in the data returned from the LibGuides API.

If we can get that UID, then we will be able to construct our own scheduler widgets for individual staff/librarians. Any ideas how to get it?

(cc: @davekellam )

gabriel-ortiz commented 6 years ago

Oh boy i see what you mean.. So I had to do some research too, and I contacted SpringShare support for some clarification.. Here's what I got back:

Hi Gabriel, No, there is not a location that would show you who has MyScheduler enabled in LibCal that also has an account in LibGuides site. You would need to get the user ID's that LibCal uses and the ID's for LibGuides separately. There are APIs for accounts in LG -- https://claremont.libapps.com/libguides/api.php?action=1&resource=5&version=1.1 -- and for MyScheduler accounts -- https://claremont.libcal.com/admin_api.php?version=1.1&endpoint=mysched_users --that you could also use to pull both bits of data together.

So yea, the LibGuides API doesn't offer the ID for the MyScheduler -- Which is a portion of LibCal. Looks like there's an API that will return these ID associated with each user who has MyScheduler enabled ( https://api2.libcal.com/1.0/myscheduler/users?iid=333&key=5d229827532c5bdcaf959a18a203a39e ) I spoke with our librarian director - and every librarian has this feature available.

So what might need to happen is we get both ID's separately from each API call and then match the name and then add the MyScheduler ID to the staff post... Sorry I didn't realize how difficult this would be...

(cc: @davekellam )

kpettinga commented 6 years ago

@gabrielo-cuc thanks for digging into that. I understand what we need to do. I've reached out to @davekellam to see what the best way would be to bring that myScheduler user data in.