4

I'm looking at how the Stack Exchange API could be useful in my site. Is it fair to say I am in read-only mode when I search for results? What is some envisioned use-case scenarios for this?

I imagined a use case for my site. Is it possible for me to take a given ID (say OpenID) and see if they are a user of your site? I'd like to give users with high reputation extra access on my site.

What do you think?

makerofthings7
  • 303
  • 1
  • 7

2 Answers2

2

A possible strategy for maintaining a verified association might look something like this:

  1. Gather a reference account from the user, similar to http://soapi.info/findusers.aspx, and upon user selection.
  2. Gather and verify an email address from your user.
    • make it clear that this email address should be the primary email address with which they sign into stackxxxx
  3. compare the email_hash of the selected User to the MD5 hash of the verified email address (lower cased) and if a match occurs, create the association on your site.

You now have a verified association. You can then use the association_id, if any, of the reference user to get any other accounts the user may have in the stack exchange network.

NOTE: you will soon see an example of this in the samples for Soapi.CS and Soapi.JS2

Sky Sanders
  • 12,068
  • 3
  • 31
  • 60
  • I can't wait to see a sample! – makerofthings7 Aug 26 '10 at 21:48
  • @maker and all - a very good first step to implementing this the other way around, e.g. getting an email address and working up, relying on the API only when you come up short locally, is maintaining a local database of user information. A sample implementation is here: http://stackapps.com/questions/1542/how-do-i-find-a-user-based-upon-email-hash. The rest of the implementation is straight forward and will be posted here by tomorrow. – Sky Sanders Sep 06 '10 at 02:36
  • @maker - please contact me @ sky.sanders@gmail.com – Sky Sanders Sep 07 '10 at 19:43
1

The current version of the API is read-only.

There is no notion of user authentication, accordingly you cannot tell if a user (of your [app]) has an account on a site.

The envisioned use cases are all data-centric, not user centric. Some subsequent version of the API (presumably, the next one) will include write-access, and with it user authentication.

Kevin Montrose
  • 18,660
  • 6
  • 34
  • 62