Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Get logged in user information through API #71

Merged
merged 1 commit into from
Feb 2, 2017

Conversation

gibarsin
Copy link
Collaborator

@gibarsin gibarsin commented Feb 1, 2017

Summary

Get information about the logged in user via the authentication token given in the X-Auth-Header HTTTP Header. The API endpoint is accessed with a GET method through the following resource:

/api/v1/user

The information includes:

  • role (e.g. STUDENT | ADMIN)
  • docket (only in case that Role is STUDENT)
  • firstName
  • lastName
  • genre
  • birthday
  • email
  • dni
  • address (includes city, country, door, neighborhood, number, street)

Example

Answer when accessing with a STUDENT:

{
"address": {
"city": "Caba",
"country": "Argentina",
"door": "",
"neighborhood": "Puerto Madero",
"number": 39222222,
"street": "E. Madero"
},
"birthday": "1994-01-24",
"dni": 12345687,
"docket": 1,
"email": "",
"firstName": "Hola1111",
"genre": "M",
"lastName": "Como Estas123123",
"role": "STUDENT"
}

Answer when accesing with an ADMIN:

{
"address": {
"city": "CABA",
"country": "Argentina",
"neighborhood": "Puerto Madero",
"number": 399,
"street": "E. Madero"
},
"birthday": "1994-08-17",
"dni": 38457012,
"email": "mcomercio@bait.edu.ar",
"firstName": "Matias Nicolas",
"genre": "M",
"lastName": "Comercio Vazquez",
"role": "ADMIN"
}

Trello Card

https://trello.com/c/F0fmAIae/64-endpoint-para-devolver-datos-de-usuario-actual

Copy link
Collaborator

@MatiasMercado MatiasMercado left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Allez ist gut =)

- Add endpoint to obtain the info for the current user
@MatiasComercio MatiasComercio merged commit 77f5498 into development Feb 2, 2017
@MatiasComercio MatiasComercio deleted the userInfoEndpoint branch February 2, 2017 13:59
MatiasComercio pushed a commit that referenced this pull request Feb 5, 2017
- Add endpoint to obtain the info for the current user
- Get information about the logged in user via the authentication token given in the **X-Auth-Header** HTTTP Header. The API endpoint is accessed with a **GET** method through the following resource:

**/api/v1/user**

- The information includes:
  - role (e.g. STUDENT | ADMIN)
  - docket (only in case that Role is STUDENT)
  - firstName
  - lastName
  - genre
  - birthday
  - email
  - dni
  - address (includes city, country, door, neighborhood, number, street)

- Examples
  - Answer when accessing with a STUDENT:

> {
"address": {
"city": "Caba",
"country": "Argentina",
"door": "",
"neighborhood": "Puerto Madero",
"number": 39222222,
"street": "E. Madero"
},
"birthday": "1994-01-24",
"dni": 12345687,
"docket": 1,
"email": "",
"firstName": "Hola1111",
"genre": "M",
"lastName": "Como Estas123123",
"role": "STUDENT"
}

  - Answer when accesing with an ADMIN:

> {
"address": {
"city": "CABA",
"country": "Argentina",
"neighborhood": "Puerto Madero",
"number": 399,
"street": "E. Madero"
},
"birthday": "1994-08-17",
"dni": 38457012,
"email": "mcomercio@bait.edu.ar",
"firstName": "Matias Nicolas",
"genre": "M",
"lastName": "Comercio Vazquez",
"role": "ADMIN"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants