enguerranws
enguerranws

Reputation: 8233

Stack Exchange API : get post list from user

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.

Upvotes: 0

Views: 202

Answers (1)

Gerald Schneider
Gerald Schneider

Reputation: 17797

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

Upvotes: 1

Related Questions