Forum Discussion
hi iftomkins
not too sure about the exact context
but one thing noticed was your first REST call URL:
.../profiles/name/ideas_terms_accepted/...
and your 2nd REST call to retrieve URL was this:
.../profiles/name/profile.ideas_terms_accepted/...
should it be just .../profiles/ideas_terms_accepted/... (without the "profile.") in the 2nd REST call?
Thanks JasonL . The profile.field format I had copied from another rest API call in our code, not sure why it worked there but not here. What did end up working is a combination of 1) your suggestion for formatting the URL, and 2) changing the 2nd call from rest() to restadmin().
Here's the working code:
<#assign response = restadmin("/users/id/${user.id}/profiles/name/ideas_terms_accepted/set?value=unchecked")/>
<#assign terms_accepted = restadmin("/users/id/${user.id}/profiles/name/ideas_terms_accepted").value>
alert('${user.id}');
alert('${terms_accepted}');
Also, a note on checkbox fields, the values that work seem to be checked/unchecked, not true/false.
Related Content
- 10 months ago
- 10 months ago
- 10 months ago