AnchalSingh
5 years agoQrew Member
Change user role for any user through APIs
Hi everyone,
I have a query related to changing user access to any app. I am trying revoke access for any user from the app through formula URL field. For that I am using API_ChangeUserRole, but prior to that I need to fetch user ID and user Role and for that I am using API_GetUserRole and API_GetUserInfo.
And I am putting below mentioned code in URL field.
But when I am trying to invoke the same, I am getting this error.
ā
------------------------------
Anchal Kumar Singh
------------------------------
I have a query related to changing user access to any app. I am trying revoke access for any user from the app through formula URL field. For that I am using API_ChangeUserRole, but prior to that I need to fetch user ID and user Role and for that I am using API_GetUserRole and API_GetUserInfo.
And I am putting below mentioned code in URL field.
var text getUserID = URLRoot() & "db/" & "main" & "?a=API_GetUserInfo" & "&email=" & [Email ID];
var text getUserRoleID = URLRoot() & "db/" & "XXXXXXXX" & "?a=API_GetUserRole" & "&userid="
& URLEncode($getUserID);
& URLEncode($getUserID);
var text changeUserRole = URLRoot() & "db/" & Dbid() & "?a=API_ChangeUserRole" & "&userid=" &
URLEncode($getUserID) & "&roleid=" & URLEncode($getUserRoleID) &
"&newRoleID=" & URLEncode(X);
"&newRoleID=" & URLEncode(X);
var text url = $getUserID & "&rdr=" & URLEncode($getUserRoleID)& URLEncode("&rdr="
& URLEncode($changeUserRole));
& URLEncode($changeUserRole));
$url
But when I am trying to invoke the same, I am getting this error.
<qdbapi>
<action>API_GetUserRole</action>
<errcode>21</errcode>
<errtext>Unknown user</errtext>
</qdbapi>
Would you please let me know what changes should I make in URL to get desirable result.
#Thanks in advance
Would you please let me know what changes should I make in URL to get desirable result.
#Thanks in advance
ā
------------------------------
Anchal Kumar Singh
------------------------------