Skip to content

Mike Leroux

My feedback

1 result found

  1. 1 vote

    We're glad you're here

    Please sign in to leave feedback

    Signed in as (Sign out)

    We’ll send you updates on this idea

    1 comment  ·  Developers » How to  ·  Admin →
    How important is this to you?

    We're glad you're here

    Please sign in to leave feedback

    Signed in as (Sign out)
    An error occurred while saving the comment
    Mike Leroux commented  · 

    Hey there! I'm afraid user Id is not readily contained on the public side. In order to obtain the userId, you would need to incorporate a call to our members API endpoint '/sys/api/publicview/v1/accounts/<yourAccountId>/contacts/me'. Response from this endpoint contains information about the user, such as email, userId (which is what you are looking for), name, and other basic information.

    We have an example ajax call here: https://gethelp.wildapricot.com/en/articles/1705-working-with-api-from-javascript. You would of course need to replace in the code where it says '58293' with your account ID, and where it says "APPLICATION_CLIENT_ID" with a valid client Id from your authorized applications.

    For example:
    $.ajax({
    url: "/sys/api/v2/accounts/<yourAccountId>/contacts/me",
    type: "GET",
    dataType: "json",
    cache: false,
    async: true,
    headers: { "clientId": "APPLICATION_CLIENT_ID" },
    success: function (data, textStatus, jqXhr) {
    alert("Current contact user Id:" + data.Id);},
    error: function (jqXHR, textStatus, errorThrown) {
    alert(textStatus + " (" + jqXHR.status + ") : " + errorThrown);}
    });

    This code could be inserted into a Custom HTML gadget, see https://gethelp.wildapricot.com/en/articles/408, and you could modify it further so that it changes the contents of a content gadget or something similar, instead of simply throwing an alert.

    Since this does dive a bit into our API, I would suggest taking a look at some our documentation:
    https://gethelp.wildapricot.com/en/articles/180-authorizing-external-applications
    https://gethelp.wildapricot.com/en/articles/1610-contacts-member-api-call.

    I hope that helps.

Feedback and Knowledge Base