appdotnet / api-spec

App.net API Documentation is on the web at https://developers.app.net. Source for these docs is in the new-docs branch here. Please use the issue tracker and submit pull requests! Help us build the real-time social service where users and developers come first, not advertisers.
https://developers.app.net
950 stars 98 forks source link

https://alpha-api.app.net/stream/0/posts/[post_id]/replies doesn't always include original post #248

Closed Haar closed 11 years ago

Haar commented 11 years ago

https://alpha-api.app.net/stream/0/posts/1971382/replies

Calling the above URL does not include a post with the original post id (1971382).

Returned IDs (at the time of writing) are as follow:

(1971566, 1971576, 1971592, 1971625, 1971663, 1971711, 1971793, 1971840, 1971872, 1971899, 1971922, 1971926, 1971933, 1971938, 1971945, 1971984, 1971992, 1972083, 1972121, 1972149)

mthurman commented 11 years ago

The replies endpoint is paginated like the other post endpoints. By default, it returns 20 at a time. You can request up to 200. Using the before_id/since_id and the data from the response envelope will allow you to page through all the replies.

Check out the general post parameters for more information.

$ curl -k -H 'Authorization: BEARER ...token...' -H "X-ADN-Migration-Overrides: response_envelope=1" "https://alpha-api.app.net/stream/0/posts/1971382/replies"

{
    "data": [
        ...posts...
    ],
    "meta": {
        "code": 200,
        "marker": {
            "name": "replies:1971382"
        },
        "max_id": 1972454,
        "min_id": 1971576,
        "more": true
    }
}