Add documentation for /msearch endpoint

This commit is contained in:
Hypolite Petovan 2018-12-23 21:23:08 -05:00
parent 8db05cfa7c
commit 2fcd282e83
1 changed files with 47 additions and 1 deletions

View File

@ -8,8 +8,9 @@ Accept: application/json
```
Parameters:
- `account_type`: An arbitrary account type string. Currently supported are `all`, `people` and `forum`. Default is `all`.
- `q`: The search query.
- `account_type` (optional): An arbitrary account type string. Currently supported are `all`, `people` and `forum`. Default is `all`.
- `page` (optional): The page number, default is 1.
Returns a JSON structure containing a paginated list profiles matching the search query and the optional account type.
@ -43,6 +44,51 @@ Example:
}
```
### Legacy interest match search
```
POST /msearch
Content-Type: application/x-www-form-urlencoded
Accept: application/json
```
Parameters:
- `s`: The search query, a list of tags separated by spaces or commas is expected.
- `p` (optional): The page number, default is 1.
- `n` (optional): The number of items per page, default is 80.
Returns a JSON structure containing a paginated list profiles matching the search query and the optional account type.
Example:
```json
{
"query": "videogame gaming boardgame politics philosophy development programming php",
"page": 1,
"itemsperpage": 80,
"count": 93,
"profiles": [
{
"id": "2259",
"name": "Hyp🌧lite Pe☂ov🍃n (he/him)",
"username": "hypolite",
"addr": "hypolite@friendica.mrpetovan.com",
"account_type": "People",
"pdesc": "Subpar geek, french/english, science, games, feminism, jokes and anything in between. Avatar by @DearMsDear@mastodon.art",
"locality": "Brooklyn",
"region": "New York",
"country": "USA",
"profile_url": "https://friendica.mrpetovan.com/profile/hypolite",
"dfrn_request": "https://friendica.mrpetovan.com/dfrn_request/hypolite",
"photo": "https://friendica.mrpetovan.com/photo/27330388315ae4ed2b03e3c116980490-4.jpg?ts=1541567135",
"tags": "videogame gaming boardgame politics philosophy development programming php",
"last_activity": "2018-45"
},
...
]
}
```
## Profile submission