Forum Discussion

preetiverma1's avatar
preetiverma1
Qrew Member
5 years ago

Workflow with API_ProvisionUser Api

Hi ,

I am creating one approval workflow for  access the documentation needs to raise access request.
 
Step 1: created on formula URL  button  when users click on button its redirect to the new form which has first name, last name and email address.


 Step 2 : users need  to fill the form for access then i am trying to add the formula API API_Provision where  api need to first name last name and email address for  granting the user access.


Problem : how can i get the data like first name , last name and email  how can i use same  data  in API_Provision User API 
table db is bqe2rwz78

and application DB is bqdvwxbeh 

how can i URLRoot() & "db/" & Dbid() &"?a=API_ProvisionUser&email="&[Record ID#]&"&dfid=16" 
how can i pull the data of first name ,last name and email address from the https://pverma.quickbase.com/db/bqe2rwz78?a=er&preview=1&dfid=16  form and then use that data in my API_ProvisionUser

Please help .

Thanks 




------------------------------
preeti verma
------------------------------

1 Reply

  • AustinK's avatar
    AustinK
    Qrew Commander
    If you have to do it via the URL then follow the guide in the API reference, it gives almost the exact URL you need to use and then you just replace the names and role id inside it with your fields. I think this might work for you but it will probably need the app token or user token added in too. You can hard code the role id or not, I chose not to.

    URLRoot() & "db/" & Dbid() &"?a=API_ProvisionUser"&"
    &email=" & URLEncode([Email]) &
    "&roleid=" & [Role ID] &
    "&fname="& URLEncode([First name])&
    "&lname=" & URLEncode([Last name])

    https://help.quickbase.com/api-guide/provisionuser.html

    Have you tried doing this with a webhook? That sounds like exactly what you want. Instead of following the instructions for doing it via the URL follow the instructions for doing it with a webhook with XML. You would want the webhook to trigger when a new record is added and you may also want to add other criteria there if you need to be sure the email is a specific domain or something like that.

    You will need to include the first and last name fields as well as their email to do this similar to the example below but with your field names used instead. Also be sure to update your role id in here too so it is the role you want them to be added as.

    <qdbapi>
    <ticket>auth_ticket</ticket>
    <apptoken>app_token</apptoken>
    <roleid>11</roleid>
    <email>[Email]</email>
    <fname>[First name]</fname>
    <lname>[Last name]</lname>
    </qdbapi>