هل توجد طريقة للحصول على جميع رسائل البريد الإلكتروني للمستخدمين عبر API؟

لقد شاهدت هذا الرابط: Is there a way to get a user email adress from the API?

ومع ذلك، نحتاج إلى التحقق من خدمة مختلفة باستخدام واجهة برمجة تطبيقات Discourse، لمعرفة ما إذا كان عنوان بريد إلكتروني معين موجودًا على موقع Discourse. يمكننا البحث عن اسم المستخدم أو الاسم عبر /u/search/users.json، لكن يبدو أن هذه الطريقة لا تُرجع عنوان البريد الإلكتروني.

إذًا، هل يمكن البحث أو استعلام جميع عناوين البريد الإلكتروني للمقارنة؟

You can use the Data Explorer plugin to create a query and then hit the query API afterwards in a query like SELECT * FROM user_emails.

At per user there is also the https://meta.discourse.org/u/<username>/emails.json endpoint.

إعجاب واحد (1)

Yes the link included in my initial question is “Discourse Meta/emails.json” but is there a way to get all user emails? … I would rather use the API then implement a plugin that allows SQL queries if at all possible.

Our API endpoints are the ones consumed by the web app, since we log email queries on the webapp we don’t expose anywhere to bulk grab emails.

The only way, right now, is using the above mentioned Data Explorer based solution.

Just to be clear, we are using the API, via secret key, I understand that the front-end would not have the same rights, can the API not have access though?

To give more details, we are have an app and discourse, both on Auth0 SSO authorization, however if someone logs into our app we want to make sure they have an account Discourse (and direct them to that link). Maybe it’s not the best way to check if Discourse has registered that email if they come to our site first. That is a link to Discourse in the event that the email has not been registered

If you are using true Discourse SSO, you can query the existence of a user by their external unique ID passed in the SSO payload using GET https://example.com/u/by-external/<EXTERNAL_ID>

إعجابَين (2)