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
  • 155,085
  • 27
  • 166
  • 222
enguerranws
  • 7,667
  • 8
  • 46
  • 87

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,002
  • 9
  • 57
  • 77