From f132e27bc9f436b44659a41a0634b51b111256f4 Mon Sep 17 00:00:00 2001 From: Michael Date: Fri, 5 May 2017 20:36:56 +0000 Subject: [PATCH 1/2] Twidere reported error 501 when accessing a profile --- include/api.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/include/api.php b/include/api.php index 97c09c20a..f68c1bb9e 100644 --- a/include/api.php +++ b/include/api.php @@ -525,6 +525,15 @@ $called_api = null; } } + if (is_null($user) && x($_GET, 'profileurl')) { + $user = dbesc(normalise_link($_GET['profileurl'])); + $nick = $user; + $extra_query = "AND `contact`.`nurl` = '%s' "; + if (api_user() !== false) { + $extra_query .= "AND `contact`.`uid`=".intval(api_user()); + } + } + if (is_null($user) AND ($a->argc > (count($called_api) - 1)) AND (count($called_api) > 0)) { $argid = count($called_api); list($user, $null) = explode(".", $a->argv[$argid]); @@ -1400,6 +1409,7 @@ $called_api = null; /// @TODO move to top of file or somewhere better api_register_func('api/users/show','api_users_show'); + api_register_func('api/externalprofile/show','api_users_show'); function api_users_search($type) { From da75dbac5838df779c513e11ce66e589427c1882 Mon Sep 17 00:00:00 2001 From: Michael Date: Fri, 5 May 2017 20:45:11 +0000 Subject: [PATCH 2/2] added documention --- doc/api.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/doc/api.md b/doc/api.md index b759b4697..2cafecac1 100644 --- a/doc/api.md +++ b/doc/api.md @@ -172,6 +172,11 @@ On error: HTTP 400 BadRequest * on friendica_verbose=true: different JSON returns {"result":"error","message":"xyz"} +--- +### externalprofile/show (*) +#### Parameters +* profileurl: profile url + --- ### favorites (*; AUTH) #### Parameters