[3743] Adds support for user search based on login or email (#7334)

* [3743] Adds support for user search based on login or email

* Use query parameter instead

* Use macaron Query() instead
This commit is contained in:
Pavlos Daoglou
2017-01-31 06:25:55 +01:00
committed by Torkel Ödegaard
parent bd4eadf69c
commit 3e741315b4
3 changed files with 66 additions and 6 deletions
+34
View File
@@ -69,6 +69,40 @@ parent = "http_api"
"isGrafanaAdmin": true
}
## Get single user by Username(login) or Email
`GET /api/users/lookup`
**Parameter:** `loginOrEmail`
**Example Request using the email as option**:
GET /api/users/lookup?loginOrEmail=user@mygraf.com HTTP/1.1
Accept: application/json
Content-Type: application/json
Authorization: Bearer eyJrIjoiT0tTcG1pUlY2RnVKZTFVaDFsNFZXdE9ZWmNrMkZYbk
**Example Request using the username as option**:
GET /api/users/lookup?loginOrEmail=admin HTTP/1.1
Accept: application/json
Content-Type: application/json
Authorization: Bearer eyJrIjoiT0tTcG1pUlY2RnVKZTFVaDFsNFZXdE9ZWmNrMkZYbk
**Example Response**:
HTTP/1.1 200
Content-Type: application/json
{
"email": "user@mygraf.com"
"name": "admin",
"login": "admin",
"theme": "light",
"orgId": 1,
"isGrafanaAdmin": true
}
## User Update
`PUT /api/users/:id`