• FEATURES
  • PRICING
  • MARKETPLACE
  • CASE STUDIES
  • BLOG
  • REST_API_TOKEN Version 2 OS

    Trying to set a new password for a new USER using this URL format

    http[s]::/openspecimen/rest/ng/users/{userId}/password?token={token}

    the question is where do I get the TOKEN value or from where or how do I generate the token to pass it into the URL.

    Thanks

    Hi @Rolando_Ramirez,

    To set the password you first need to get password token. OpenSpecimen generates an email when a new user is registered/approved and sends it to the user’s email address, which contains the set password link along with the token. To ensure the email delivery you have to set a valid email address for the user.

    • Use the token sent in the email and set password using following curl command

      curl -X POST -H “Accept: Application/json” -H “Content-Type: application/json” http://***.org/openspecimen/rest/ng/users/reset-password -d ‘{“loginName”: "admin@admin.com", “newPassword”: “Login123”, “resetPasswordToken”: “e95bcf72-772c-47c3-844a-dad394807c48”}’

    ~Nitesh

    Can I do this with a local installation ? I used the API to set a gmail account for OpenSpecimen, with port port 587 and all, just like it works in my C# app - and when I use the forgot link - no email is sent - and it gives a successful message on the OS GUI - can i use GMAIL for this? or do I need a local smpt service ?

    Hi @Rolando_Ramirez,

    You can either use Gmail account or local SMTP service for sending emails from OpenSpecimen. Both are supported. For email configuration you need to set all the properties specified in email configuration. For email account which requires authentication the below properties should be set to true:

    1. starttls_enabled
    2. auth_enabled

    ~Nitesh

    Thank you so much - I got it working now.