03-04-2020 10:30 AM
I have a python script basic function is to pull down user data, see if they enrolled and help the helpdesk enroll the user via SMS if they had problems.
My issue is I have a user who is in the system and part of group - they never enrolled just sitting idle. when I search up the user name via API I get empty data back because the user isnt enrolled? but works fine for any enrolled user.
there is a email in the dashboard web-ui but when I pull it via API there is no data returned?
is there some other API command I need to set to a username before I can enroll them? if I use the web-ui and add a phone to the account I can use my script no issues.
Solved! Go to Solution.
03-04-2020 01:17 PM
I think I found my issue was when I was assigning data from JSON into an array I was calling the email wrong…
everything seems to be ok now thanks for feedback it helped me in the right direction.
03-04-2020 12:33 PM
Hey there, when you describe your API use case are you conflating “enrollment” with “activation”? Admin API’s enroll user endpoint can only email an enrollment link, not send one via SMS.
The activate phone endpoint sends the activation info to a specified phone attached to an enrolled user. A user who isn’t fully “enrolled” has no phone, so there is no phone number available to be returned as an SMS destination by the API on user GET.
Maybe in this workflow you should actually look for users returned by the API with an email but no phone attached, and use /admin/v1/users/enroll
to email them an enrollment link?
03-04-2020 01:17 PM
I think I found my issue was when I was assigning data from JSON into an array I was calling the email wrong…
everything seems to be ok now thanks for feedback it helped me in the right direction.
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide