Skip to content
GitLab
Next
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • GitLab GitLab
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 44,761
    • Issues 44,761
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
    • Requirements
  • Merge requests 1,329
    • Merge requests 1,329
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
    • Test Cases
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Container Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Metrics
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Code review
    • Insights
    • Issue
    • Repository
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • GitLab.orgGitLab.org
  • GitLabGitLab
  • Issues
  • #25077
Closed
Open
Issue created Nov 06, 2018 by Jim@former-jthavisouk

Admin API : "GET /users/:id/emails" is inconsistent w/ documentation

Summary

Admin API : "GET /users/:id/emails" is inconsistent with documentation.

Per documentation,

Get a list of a specified user’s emails. Available only for admin

  • When getting aa email list from @asaba 's ID (2165775), it returns no emails.
  • When getting an email list from @thavisouk 's ID (1877050), it returned a list missing his primary account.

Steps to reproduce

Get Antony's account emails

URL="https://gitlab.com/api/v4/users/2165775/emails"
#GET /users/:id/emails
curl $METHOD  -H 'Content-Type: application/json' \
        -H 'PRIVATE-TOKEN: '$API_KEY \
		$URL 

Get Jim's account emails

URL="https://gitlab.com/api/v4/users/1877050/emails"
#GET /users/:id/emails
curl $METHOD  -H 'Content-Type: application/json' \
        -H 'PRIVATE-TOKEN: '$API_KEY \
		$URL 

What is the current bug behavior?

Not all emails associated with account are listed

What is the expected correct behavior?

List all emails associated with account. Going into the admin console, it will display more emails beyond what is listed through Admin API.

Relevant logs and/or screenshots

Results from asaba ID, only has 1 primary and public address

[]

Results from Jim's ID

[
  {
    "id": 234302,
    "email": "jim@example.com"
  },
  {
    "id": 234311,
    "email": "jim.thavisouk@owasp.org"
  }
]

Output of checks

  • This bug happens on GitLab.com

Workaround

Additionally get the user's primary email the GET /users/:id API (https://docs.gitlab.com/ee/api/users.html#for-admin)

Results of GitLab environment info

  • Using: Gitlab.com

Possible fixes

  • (If you can, link to the line of code that might be responsible for the problem)
  • Not sure

See #25077 (comment 215533967) where the naive fix to just include user.email was deemed not tenable

Edited Jun 30, 2020 by Thong Kuah
Assignee
Assign to
Time tracking