diff --git a/doc/api.md b/doc/api.md index 08fca74fa4..07813b6a77 100644 --- a/doc/api.md +++ b/doc/api.md @@ -634,6 +634,73 @@ Friendica doesn't allow showing the friends of other users. * trim_user * contributor_details +--- + +### Return values for statuses/* api calls + +Returned status object is conform to GNU Social/Twitter api. + +Friendica adds some addictional fields: + +- owner: a user object, it's the owner of the item. +- private: boolean, true if the item is marked as private +- activities: map with activities related to the item. Every activity is a list of user objects. + +This properties are prefixed with "friendica_" in JSON responses and namespaced under "http://friendi.ca/schema/api/1/" in XML responses + +JSON: + +```json +[ + { + // ... + 'friendica_owner' : { + // user object + }, + 'friendica_private' : true, + 'friendica_activities': { + 'like': [ + { + // user object + }, + // ... + ], + 'dislike': [], + 'attendyes': [], + 'attendno': [], + 'attendmaybe': [] + } + }, + // ... +] +``` + +XML: + +```xml + + + + + true + + + + + + + + + + + + + + + +``` + + --- ### statusnet/config (*) diff --git a/include/api.php b/include/api.php index 7450d650eb..f40674b894 100644 --- a/include/api.php +++ b/include/api.php @@ -2888,6 +2888,7 @@ function api_format_items($r, $user_info, $filter_user = false, $type = "json") 'favorited' => $item['starred'] ? true : false, 'user' => $status_user , 'friendica_owner' => $owner_user, + 'friendica_private' => $item['private'] == 1, //'entities' => NULL, 'statusnet_html' => $converted["html"], 'statusnet_conversation_id' => $item['parent'],