Change API documentation to contain new API call /api/friendica/profile/show

This commit is contained in:
gerhard6380 2016-09-23 19:26:44 +02:00
parent 4de12dacc7
commit afc7d316a7
2 changed files with 33 additions and 15 deletions

View file

@ -744,6 +744,38 @@ On success:
On error:
* different JSON returns {"result":"error","message":"searchstring not specified"}
---
### friendica/profile/show (GET; AUTH)
show data of all profiles or a single profile of the authenticated user
#### Parameters
* profile_id: id of the profile to be returned (optional, if omitted all profiles are returned by default)
#### Return values
On success: Array of:
* multi_profiles: true if user has activated multi_profiles
* global_dir: URL of the global directory set in server settings
* friendica_owner: user data of the authenticated user
* profiles: array of the profile data
On error:
HTTP 403 Forbidden: when no authentication provided
HTTP 400 Bad Request: if given profile_id is not in db or not assigned to authenticated user
General description of profile data in API returns:
* profile_id
* profile_name
* is_default: true if this is the public profile
* hide_friends: true if friends are hidden
* profile_photo
* profile_thumb
* publish: true if published on the server's local directory
* net_publish: true if published to global_dir
* description ... homepage: different data fields from 'profile' table in database
* users: array with the users allowed to view this profile (empty if is_default=true)
---
## Not Implemented API calls
The following API calls are implemented in GNU Social but not in Friendica: (incomplete)

View file

@ -2462,20 +2462,6 @@
'users' => null);
return $profile;
}
if ($type == "xml") {
$xml_activities = array();
foreach ($activities as $k => $v) {
// change xml element from "like" to "friendica:like"
$xml_activities["friendica:".$k] = $v;
// add user data into xml output
$k_user = 0;
foreach ($v as $user)
$xml_activities["friendica:".$k][$k_user++.":user"] = $user;
}
$activities = $xml_activities;
}
return $activities;
}
/**
@ -4004,7 +3990,7 @@
}
// return settings, authenticated user and profiles data
$result = array('multi_profiles' => $multi_profiles,
$result = array('multi_profiles' => $multi_profiles ? true : false,
'global_dir' => $directory,
'friendica_owner' => api_get_user($a, intval(api_user())),
'profiles' => $profiles);