Hi team, need help! Do we have any API exposed for...
# ask-a-descoper
a
Hi team, need help! Do we have any API exposed for resending invites to users? Currently, for creating and sending invites, we are using the endpoint:
https://api.descope.com/v1/mgmt/user/create
. We also need support for passing
templateId
and
templateOptions
in the same way as the above endpoint.
r
you should use the same api endpoint, it will re-send the invite
a
okay but isn't there any other end point available just to send it, we don't want that this to be used for sending invite again , as in the case user is not present and on descope it will create user and send invite , but we are also having user on our side , so if any of user uses this end point to send re invite mail , they will bypass us and create new user on descope directly , one way is to have validate on our side if the user present or not, other way is use you send re invite api that your ui internally uses.
i
@Ashutosh Shah If you use the
create
API request again for a user in an
invited
state, i.e. they have already been created but not yet signed into Descope, then the user will only receive another invite. They will not be duplicated or anything of that sort. The "Resend Invitation" button uses the same API.
a
okay got , is there any way to track if the user is in
invited
state , is the status in UserResponse gives me that?
r
Which sdk or api call are you asking about?
for example in the load user it's reflected https://docs.descope.com/api/management/users/load-user but not sure what call are you asking about the UserResponse
in the FE, the react/next sdk has the useUser hook that has the UserResponse object inside of it, are you talking about this one?
a
in java sdk , package com.descope.model.user.response;
Copy code
descopeUserService.loadByUserId
a
thanks! @Reuven Zabirov @Itai Hanski
🙌 1
cc:- @Arun Kumar G