leafo / itchio-app-old

Desktop itch.io client
MIT License
45 stars 6 forks source link

List games from My purchases #6

Closed leafo closed 9 years ago

leafo commented 9 years ago

Need to fetch owned games from user's library with an API call that returns the games on this page: http://itch.io/my-purchases

leafo commented 9 years ago

An API call has been added.

It returns an owned_keys array. Each key object holds a game object similar to the my games API call. The key object should be deserialized and stored for later, it will be needed to fetch the available downloads.

This is currently an undocumented API call so we can still make changes to it as we see fit.

TODO: add pagination

GET /api/1/:api_key/my-owned-keys
{
    owned_keys: [
        {
            updated_at: "2014-12-11 08:26:01",
            downloads: 1,
            id: 61544,
            purchase_id: 66389,
            game_id: 15175,
            created_at: "2014-12-11 08:26:01",
            game: {
                p_android: false,
                id: 15175,
                p_osx: false,
                min_price: 600,
                created_at: "2014-12-07 15:33:43",
                published_at: "2014-12-10 05:39:09.432976",
                p_windows: false,
                url: "http://jackspinoza.itch.io/beeswing",
                title: "Beeswing",
                cover_url: "http://img.itch.io/aW1hZ2UvMTUxNzUvNTQyOTQucG5n/315x250%23/T5gfEj.png",
                short_text: "Discover a world of stories in a handcrafted game set in rural Scotland.",
                type: "default",
                p_linux: false,
                user: {
                    url: "http://jackspinoza.itch.io",
                    username: "jackspinoza",
                    id: 306
                }
            }
        },
leafo commented 9 years ago

Now shows purchases on main screen

abueide commented 2 years ago

@leafo is there somewhere where api endpoints like this are documented? i don't see it on here: https://itch.io/docs/api/serverside