Is it possible to automatically create a login user via the
We tried to mimic the person form auto user creation by adding the following snippet to the JSON payload sent to the
The hope was that it would, since it seems to be the case with the xlsx form, automatically create a SMS login user.
Unfortunately, it did not yield the same result. Is there perhaps something we’re missing?
It would be advantageous not to make an additional request and create the login info ourselves by using the create-many-users and login-by-sms.
Can you please share the reasons for not using the users api: API to interact with CHT Applications | Community Health Toolkit
You can use this to create the associated person and/or place or associate with existing person/place. Enabling login-by-sms just requires changing a field in the user definition.
I would definitely recommend using the dedicated API instead of relying on an implementation detail.
I totally missed that the
/api/v2/users api can be used for person creation as well, not just linking.
Thank you for pointing that out!
That combined with the
'token_login': True, satisfies the requirement.