Skip to main content
Question

API_GetUserInfo

  • May 15, 2024 7:03 PM UTC
  • 0 replies
  • 287 views

Forum|alt.badge.img+5

Hello,

The purpose of my pipeline is to dynamically add a user via API calls. The user who submits the request to add a "new" user has to input the "new" users email address. I understand that I then need to use that email address within the API_GetUserInfo to check if the user's email exists on any realm within Quickbase. If it does, then I should use the @id response data and insert it into API_AddUserToRole -> API_SendInvitation. If it doesn't exist, then I should use API_ProvisionUser -> API_SendInvitation.

My issue is that if a user is not found within the API_GetUserInfo, it throws an error: "Quickbase reported an error: 2 : Invalid input : The user with the specified email address or username does not exist."

I have tried adding an if statement to avoid the error and simply continue on:

{% if b.json.qdbapi.user['@id'] != "" %}
true
{% endif %}

However, it still throws the error if the user is not found. Is there any way to prevent this error from occurring?

Thank you.

This topic has been closed for replies.

Forum|alt.badge.img+5

I should also mention, when it throws an error from the API_GetUserInfo the pipeline stops, it does not continue with the if statement 


Forum|alt.badge.img+6
  • Quickbase Staff
  • May 16, 2024 3:16 AM UTC

You could use the Get Users API, which doesn't stop processing if a user doesn't exist.

The request body can have one or more email addresses, and you'll need to use Jinja to convert the body to JSON:

If the user doesn't exist, it returns an empty "users" array:

Hope that helps!