Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ If you have any questions or concern, please [file an issue](https://github.com/
- [Releases](Repositories/Releases.md)
- [Webhooks](Repositories/Webhooks.md)
- [Users](Users)
- [Search](Users/Search.md)
- [Emails](Users/Emails.md)
- [Followers](Users/Followers.md)
- [Public Keys](Users/Public%20Keys.md)
Expand Down
48 changes: 0 additions & 48 deletions Users/README.md
Original file line number Diff line number Diff line change
@@ -1,53 +1,5 @@
# Users

## Search users

```
GET /users/search
```

> Request without providing basic authentication or access token will result empty `email` field for anti-spam purpose.

### Parameters

|Name|Type|Description|
|----|----|-----------|
|q|string|**Required** Keyword of username|
|limit|int|Limit number of search results. Default is **10**|

### Example

```
$ curl https://try.gogs.io/api/v1/users/search?q=u&limit=5
```

### Response

```
Status: 200 OK
```
```json
{
"data": [
{
"id": 1,
"username": "unknwon",
"full_name": "",
"email": "fake@local",
"avatar_url": "/avatars/1"
},
{
"id": 4,
"username": "user1",
"full_name": "",
"email": "[email protected]",
"avatar_url": "/avatars/4"
}
],
"ok": true
}
```

## Get a single user

```
Expand Down
48 changes: 48 additions & 0 deletions Users/Search.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# Search users

```
GET /users/search
```

> Request without providing basic authentication or access token will result empty `email` field for anti-spam purpose.

### Parameters

|Name|Type|Description|
|----|----|-----------|
|q|string|**Required** Keyword of username|
|field|string|What field to search on. Only allows `name` (default) and `email`|
|limit|int|Limit number of search results. Default is **10**|

### Example

```
$ curl https://try.gogs.io/api/v1/users/search?q=u&limit=5
```

### Response

```
Status: 200 OK
```
```json
{
"data": [
{
"id": 1,
"username": "unknwon",
"full_name": "",
"email": "fake@local",
"avatar_url": "/avatars/1"
},
{
"id": 4,
"username": "user1",
"full_name": "",
"email": "[email protected]",
"avatar_url": "/avatars/4"
}
],
"ok": true
}
```