API usage for site integration

(Marco Perone) #1

I am evaluating Discourse to create a forum for my website, and I would like to know if at the moment it is possible to do the following things through the Discourse API:

  1. add a user to a group
  2. retrieve user notifications
  3. change the user interface language

If these things are possible, can you give me some hint on how to do them?

(Paul Apostolos) #2

I have found that nearly everything I have wanted to do via the API was easy.

I typically take this approach.

  1. Go to the Web interface and look for the setting I am trying to retrieve or change.
  2. Open Fiddler2 or Chrome network tools so I can see all the requests and responses.
  3. Change or retrieve the setting or item.
  4. Review the request/response and replicate that with client code.

We do our integration with RestSharp (.NET REST and HTTP Client).

Here’s a Gist for how we do the add user to group part

(Jeff Atwood) #3

The language can only be set at the server for the entire site. There is no concept at this time of setting language for an individual user.

(Paul Apostolos) #4

@codinghorror what about this site setting?

(Sam Saffron) #7

Just to answer the op here, yes all 3 points are possible using our API if per user locale is enabled

(Sam Saffron) #8