paulschneider / b247-api

0 stars 0 forks source link

Endpoint-User-Profile needs a GET #68

Closed benvium closed 10 years ago

benvium commented 10 years ago

Just noticed that there's no way to get the user's profile information. We can get firstName lastName via login, but unless I'm missing something we can't get the facebook, twitter, postcode, age group.

paulschneider commented 10 years ago

The user profile is sent back to you when a user logs in IF they have completed the profile previously. If no profile exists then we don't return anything.

User registration is basic. The brief of the project requires profile completion when the user first logs into the system. An interstitial page that forces the user to provide this information, I believe.

The response for an authenticated user with a user profile looks similar to:


{
    "success": {
        "message": "Accepted.",
        "statusCode": 202,
        "method": "POST",
        "endpoint": "v1/login",
        "time": 1407844958,
        "data": {
            "user": {
                "id": 1,
                "accessKey": "75ECA3613786226",
                "firstName": "David",
                "lastName": "Scholes",
                "email": "paul.schneider@yepyep.co.uk",
                "profile": {
                    "ageGroup": 4,
                    "nickName": "Schneidey",
                    "facebook": "paul.schneider",
                    "twitter": "pjschneidey",
                    "postCode": "CF61 2UA"
                }
            }
        }
    },
    "source": [
        {
            "platform": "OS X",
            "browser": "Chrome"
        }
    ]
}

I'll update the API docs to include this example.

benvium commented 10 years ago

ok. thanks. Will let Pablo know about this addition

On 12 Aug 2014, at 13:06, Paul Schneider notifications@github.com wrote:

The user profile is sent back to you when a user logs in IF they have completed the profile previously. If no profile exists then we don't return anything.

User registration is basic. The brief of the project requires profile completion when the user first logs into the system. An interstitial page that forces the user to provide this information, I believe.

The response for an authenticated user with a user profile looks similar to:

{ "success": { "message": "Accepted.", "statusCode": 202, "method": "POST", "endpoint": "v1/login", "time": 1407844958, "data": { "user": { "id": 1, "accessKey": "75ECA3613786226", "firstName": "David", "lastName": "Scholes", "email": "paul.schneider@yepyep.co.uk", "profile": { "ageGroup": 4, "nickName": "Schneidey", "facebook": "paul.schneider", "twitter": "pjschneidey", "postCode": "CF61 2UA" } } } }, "source": [ { "platform": "OS X", "browser": "Chrome" } ] } I'll update the API docs to include this example.

— Reply to this email directly or view it on GitHub.

benvium commented 10 years ago

Pablo has raised an issue that suggests we do need this GET.

paulschneider commented 10 years ago

Okay. leave this one with me. Shouldn't take too long.

benvium commented 10 years ago

Just FYI: I've been writing up the app startup process and GETing the user profile is also an essential part of this. Covers situation where app is started with a stored accessToken, BUT the user hasn't filled in their Profile data.

paulschneider commented 10 years ago

This is now in place on cycle and staging.