How to pass the values for core_auth_confirm_user

How to pass the values for core_auth_confirm_user

by T K -
Number of replies: 8

We are using moodle 3.4 webservices, while all the other webservice functions we have figured out the parameters to pass to the API request, there is core_auth_confirm_user that keeps giving error.

Based on the API documents I parsed the following request: 

Meteoruser is an existing user in the DB, and the API token & secret are verified correct. Is my format not right?

ss

Average of ratings: -
In reply to T K

Re: How to pass the values for core_auth_confirm_user

by Andreas Grabs -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers Picture of Translators

Hi Karishma,

unfortunately, I do not know your tool, from which the screenshot comes. I have attached a small example that works in an PHP environment. Please check it. Maybe it helps.

Best regards
Andreas

Average of ratings: Useful (2)
In reply to Andreas Grabs

Re: How to pass the values for core_auth_confirm_user

by T K -

Thanks so much, I will try this script.

BTW i am using Postman tool, would you know how to run this API endpoint via postman?

In reply to T K

Re: How to pass the values for core_auth_confirm_user

by Mihir J -
Hi Karishma

From the error in the screenshot, it looks like, there is an issue with the parameter that you are passing.
Can you post the complete url here with dummy username and secret, that way it will be easier to tell which parameter is having issue

thanks!
Mihir
In reply to Mihir J

Re: How to pass the values for core_auth_confirm_user

by T K -

I really think I am missing the correct parameters. Where is the secret password stored for this API?

In reply to T K

Re: How to pass the values for core_auth_confirm_user

by Steven Duncan-Brown -

Hello, maybe not an issue now but in case anyone else is looking for this answer...

The secret is created on user creation and stored in the user database table (in a field called secret). This secret would normally be part of a users confirmation email.

So for dev purposes, you would need to either get the secret from the email or directly from the database (I don't think they are displayed in the admin anywhere, but I could be wrong)