احصل على المستخدم عبر البريد الإلكتروني

نقوم بإنشاء المستخدمين والمواضيع عبر واجهة برمجة التطبيقات (API). نحتاج إلى التحقق مما إذا كان مستخدم بالبريد الإلكتروني هذا قد تم إنشاؤه مسبقًا. إذا كان موجودًا، فإننا ننشئ موضوعًا من المستخدم الحالي.

لذا، أحتاج إلى استدعاء واجهة برمجة التطبيقات للحصول على اسم المستخدم عبر البريد الإلكتروني (إن وجد). كيف يمكنني القيام بذلك؟ لقد وجدت فقط الاستدعاء العكسي.

هناك رابط مذكور في عدة مواضيع قد يحتوي على الإجابة، لكنه غير صالح.
https://meta.discourse.org/t/api-best-way-to-get-user-details-by-email/20806/10

إعجابَين (2)

That is a bit of a privacy violation so don’t expect it to be easy.

Why? The admin of the forum can see search user by email via the web interface, what’s the difference if he does the same via API?

Sure if you use an admin api key that should work.

That’s exactly my question. There’s a “Get a single user by username” call in the API docs, but how do I get a single user by email?

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

Follow the method here since you are an admin and know how to look users up by email address, yes?

3 إعجابات

Got it, thank you!
Posting it here for anyone else who might need it.
[discourse_url]/admin/users/list/active.json?filter=[email_name]%40[email_domain]&show_emails=false&order=&ascending=&page=1

12 إعجابًا

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.