From 2fcd282e834349f90c8808bafb53e12205c84160 Mon Sep 17 00:00:00 2001 From: Hypolite Petovan Date: Sun, 23 Dec 2018 21:23:08 -0500 Subject: [PATCH] Add documentation for /msearch endpoint --- docs/Protocol.md | 48 +++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 47 insertions(+), 1 deletion(-) diff --git a/docs/Protocol.md b/docs/Protocol.md index cab20f3..a1e8cd5 100644 --- a/docs/Protocol.md +++ b/docs/Protocol.md @@ -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