0

I'm currently playing with the Stack Exchange API. My goal is to display a list of 5 last posts from a specific user.

I thought it would be easy, but well, I can't make it work...

Here's my try (client side, no auth) :

var apiURL = 'https://api.stackexchange.com/2.2/posts?order=desc&owner=enguerranws&site=stackoverflow';
    get(apiURL, getCB);

Where get() is is basic GET request and getCB a simple callback that should log the response.

This doesn't work, I get the last posts on SO from all users...

I looked into the API docs for couple of hours now, but I still don't know if it's possible and how to achieve it.

mplungjan
  • 169,008
  • 28
  • 173
  • 236
enguerranws
  • 8,087
  • 8
  • 49
  • 97

1 Answers1

1

You need to specify the user in the URL, not in the parameters:

https://api.stackexchange.com/2.2/users/2054977/posts?order=desc&site=stackoverflow&pagesize=5

Gerald Schneider
  • 17,416
  • 9
  • 60
  • 78