shotvibe / shotvibe-web

ShotVibe REST API webservice
1 stars 0 forks source link

In the API, Report "invited" status for each member if an album #26

Closed benny-shotvibe closed 11 years ago

benny-shotvibe commented 11 years ago

This is for the GET /albums/{aid}/ endpoint.

Right now, the members array that it returns looks like:

    "members": [
        {
            "id": 1791562667,
            "url": "https://api.shotvibe.com/users/1791562667/",
            "nickname": "testuser",
            "avatar_url": "https://static.shotvibe.com/frontend/img/ndt.png"
        },
        {
            "id": 1791562669,
            "url": "https://api.shotvibe.com/users/1791562669/",
            "nickname": "benny",
            "avatar_url": "https://static.shotvibe.com/frontend/img/ndt.png"
        }
    ]

What we need, is to add an additional field to each member object:

"invite_status": "joined"

The possible values are: sms_sent, joined

We should probably add a helper method to the User class that will return the correct value.

Here is how to calculate this value:

In the future we will add a few more possible values (such as an intermediate value, in the case where the user has viewed the invite page, but has not yet installed the app)