Web link with embedded user data
We are migrating our members to WA and I have a big issue. Our members are granted access to an external database as part of their membership to search legal information online. Members log into our portal and click on a link that has their own AccountID, First Name, Last Name and email address embedded. Is there a way to accomplish this in WA?
Here is an example of the code we use now on our existing ASP site to generate the individual links:
using System;
using System.Web.UI.WebControls;
public partial class membersonlysomedatabase : System.Web.UI.Page
{
protected string endurl;
protected void PageLoad(object sender, EventArgs e)
{
urlRedirect.Mode = LiteralMode.PassThrough;
endurl =
SomeDatabase.CreateURL(
Profile.UserName,
Profile.FirstName,
Profile.LastName,
Profile.Email,
"https://apps.somedatabase.com/PartnerBenefits/?"
);
urlRedirect.Text =
"<meta http-equiv=\"REFRESH\" content=\"2;" + endurl + "\" />";
}
}
What would be the best way to accomplish the same thing with our WildApricot portal?
Thank you!
At the end to January we are launching a feature, which allows JS code to access public API. You will be able to get from API information about current user and then build a link.
Here is
- information about initial feature request: https://forums.wildapricot.com/forums/309658-developers/suggestions/8828014-javascript-access-to-contact-member-event-data
- current version of API documentation https://help.wildapricot.com/display/DOC/API+Version+2 . It wil be updated when the feature is launched.
-
The issue is fixed, both GET and POST works. Demo code is here: http://houseofbamboo.wildapricot.org/JS-sample
-
Dmitry Smirnov commented
Hi Jaye,
There is an issue on our sde, we are investigating the problem.
-
Jaye Steinbrick commented
This sample code was working for us. For the past two days it gives the error "404 not found". Has something changed in the v2 API link?
-
Here http://houseofbamboo.wildapricot.org/JS-powered-page you can find a sample page. If you want to see how it works, you can apply for free membership.
-
Did you change '1' to your organization's account id?
Url should be changed to
/sys/api/v2/accounts/YOU-ACCOUNT-ID/contacts/me -
Jaye Steinbrick commented
This doesn't seem to work. I have followed the instructions carefully including "user authorise" an application. On an authenticated (member only) page within my site I have inserted the gadget "Custom HTML" with the jscript paisted exactly as listed in the documentation as follows:
<script>
$(document).ready(function(){
$.ajax(
{
url: "/sys/api/v2/accounts/1/contacts/me",
type: "GET",
dataType: "json",
cache: false,
async: true,
headers: { "clientId": "APPLICATION_CLIENT_ID" },
success: function (data, textStatus, jqXhr) {
alert("Current contact id:" + data.Id + ". Contact email:" + data.Email);},
error: function (jqXHR, textStatus, errorThrown) {
alert(textStatus + " (" + jqXHR.status + ") : " + errorThrown);}
});
});
</script>I replaced the text APPLICATION_CLIENT_ID with the text string listed in the "Client Id" field of the authorized application settings and nothing happens after I save the page! I should at least get an error box...but NOTHING. What am I missing? I've followed the directions step by step. Is this broken? I've spent two days on this, very frustrating.
-
I have updated link to related feature.
The feature release is planned on 25 Jan. Here is a service notice https://forums.wildapricot.com/forums/308923-service-notices/suggestions/11544699-version-5-7-2-update-on-january-25th-2016-at-3am
-
Jaye Steinbrick commented
When I try to access the first link you included I am redirected to https://wildapricot2.uservoice.com/admin/signin my account is not authorised to log into admin. Any idea when in July this JS code feature will be released?
-
Hi Jaye,
At the end to January we are launching a feature, which allows JS code to access public API. You will be able to get from API information about current user and then build a link.
Here is
* information about initial feature request: https://wildapricot2.uservoice.com/admin/forums/309658-developers/suggestions/8828014-javascript-access-to-contact-member-event-data
* current version of API documentation https://help.wildapricot.com/display/DOC/API+Version+2 . It wil be updated when the feature is launched.I hope this will help.