API with non-administrative permissions
Original title: Cannot access API from within site pages if not Administrator.
Hi,
I have written JavaScript/HTML in a WildApricot site page to display events as a compact list in a table.
If I login to an administrator account it all works fine, if I login to a non administrator account I get error 403 returned from a get Events API call.....
"Failed to load resource: the server responded with a status of 403 (Current token does not provide access to scope 'events_view'.)"
Code snippet is:
<script>
generateTable();
function generateTable()
{
var EventsList = getDataFromApi("https://xxxxx.wildapricot.org/sys/api/v2/accounts/xxxxxx/Events?$sort=StartDate asc&$filter=Tags in [training,cruising,racing,racing_crew] AND StartDate ge 2017-01-01");
The API documentation here
https://help.wildapricot.com/display/DOC/Authenticating+API+access+from+a+Wild+Apricot+site+page
Says
"Access to Wild Apricot data will be limited by the access permissions of the currently authenticated user. Consequently, the API cannot be accessed within public pages that do not require user authentication."
The page in question is not a public page and the user is logged in (but not as an administrator), why are these API calls resulting in Error 403?
Thanks
We published our APIs on swaggerhub.
API for non-administrative access
https://app.swaggerhub.com/apis/WildApricot/wild-apricot_api_for_non_administrative_access/1.0.0
-
Jessica Jones commented
I have a similar problem. I am building a tool where I want to show the users the memo/notes that I have added to their registration programmatically. The memo/note contains their personalized "join" link from Zoom. As an admin, this work fine for me but, non admins who are already logged in get the response "403 (Current token does not provide access to scope 'event_registrations_view'.)". This problem likely occurs because non-admins can only use /sys/api/publicview and this is not a public page. Any suggestions?
-
anon commented
Hi GB, non-admins will not be able to create new events as this is not allowed in the API for non-admins.
-
GB commented
Please, someone could explain me how to use API for non-admin in pages withing Wild Apricot websites?
I have done one example for admin (I used the Dmitry example), but do I reference the https://app.swaggerhub.com/apis/WildApricot/wild-apricot_api_for_non_administrative_access/1.0.0 on my organisation within Wild Apricot?Is there any sample or example how to do that?
For example, I would like to some users add new events using the API through Wild Apricot website...
-
One important note: you can access API from from your website javascript, but the user should be authenticated. Af you make API call from javascript when user is not authenticated (anonymous), then API will return an error.
The code provided in a topic will work for administrator only, since it makes a call to administrative API.
API for non-admins is located on different url and have slightly different syntax. Please refer to https://app.swaggerhub.com/apis/WildApricot/wild-apricot_api_for_non_administrative_access/1.0.0 for details.
-
Karen commented
Anon- I am trying to accomplish this same thing - a compact list of events published on the WA site. Would you mind sharing how you were able to achieve this? The code snippet wasn't enough for me. I tried support but was directed to use a partner instead. I'd like to try to figure it out on my own. Any help would be greatly appreciated. If you're a partner, maybe we can work something out. Let me know. I'm new to WA and didn't see a way to reach out to you directly. Thanks
-
Karl Hakkarainen commented
Allowing members to view and change registrations is good.
Our next big wave of registrations will come in December. -
anon commented
That does not help me as I am still waiting for a fix to my original post when I first raised this issue:
"I have written JavaScript/HTML in a WildApricot site page to display events as a compact list in a table."A member cannot do this as they have no access to the API if they are not an administrator.
-
Karl, what you're asking for is being handled in a different way - see https://forums.wildapricot.com/forums/308932-wishlist/suggestions/8825602-registrant-to-view-change-his-event-registrations
-
anon commented
I am still waiting for this feature as well!
-
Karl Hakkarainen commented
Do we have an updated ETA on this?
Our inability to provide our members with a list of events for which they've registered is causing some folks to recommend that we drop Wild Apricot and adopt another system. -
API for non-administrators is in the closed beta testing stage right now. If you'd like to participate in it, please, write to mobile.crew@wildapricot.com
We are expecting to publish it in the next major release, approximately in the end of July.
-
anon commented
Hi Again,
Is there any update on this functionality.
It is pretty important for some web pages if you want to be able to make any decent customisation.
I need to create a page for members that shows in a simple table all the events and who is registered on each event.
Thanks -
Did you have a chance to look at https://help.wildapricot.com/display/DOC/Authenticating+API+access+from+a+Wild+Apricot+site+page ?
-
Karl Hakkarainen commented
A me, too comment. I've been trying to create a page that shows event registrations. My script works fine for admins (full and view-only), but receives a 403 error "Current token does not provide access to scope 'event_registration_view'.
-
Steve Riegel commented
Just adding my voice for this. I hope this means contacts/me will work for authenticated non-admin users so I can get the numeric id# for current user, and then call contacts/id# to obtain FieldValues struct. Thanks.
-
Alex Sirota commented
Hi team, is there an update on this -- the FieldValues structure is not available in the me scope even though the docs for Contacts API v2 indicates FieldValues is returned in the sample JSON call. This is a critical limitation that I hope will be changed very soon. This is restricting us from finishing a project for a customer.
-
anon commented
Can you provide any idea as to when this will be available, will it be weeks or months for example?