From 77f13571233fbad04132f375bf596d74a2bc2e88 Mon Sep 17 00:00:00 2001 From: gerhard6380 Date: Mon, 7 Dec 2015 22:07:20 +0100 Subject: [PATCH] Update api.md add documentation for new API calls for Managing groups --- doc/api.md | 73 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 73 insertions(+) diff --git a/doc/api.md b/doc/api.md index 147c8b7513..478ef6d2b9 100644 --- a/doc/api.md +++ b/doc/api.md @@ -346,6 +346,79 @@ Friendica doesn't allow showing followers of other users. Friendica doesn't allow showing friends of other users. + +## Implemented API calls (not compatible with other API’s) + +### users/group_show +Return all or a specified group of the user with the containing contacts as array. + +#### Parameters +* gid: optional, if not given, API returns all groups of the user + +#### Return values +Array of: +* name: name of the group +* gid: id of the group +* user: array of group members (return from api_get_user() function for each member) + + +### users/group_delete +delete the specified group of contacts; API call need to include the correct gid AND name of the group to be deleted. + +### Parameters +* gid: id of the group to be deleted +* name: name of the group to be deleted + +#### Return values +Array of: +* success: true if successfully deleted +* gid: gid of the deleted group +* name: name of the deleted group +* status: „deleted“ if successfully deleted +* wrong users: empty array + + +### users/group_create +Create the group with the posted array of contacts as members. +#### Parameters +* name: name of the group to be created + +#### POST data +JSON data as Array like the result of „users/group_show“: +* gid +* name +* array of users + +#### Return values +Array of: +* success: true if successfully created or reactivated +* gid: gid of the created group +* name: name of the created group +* status: „missing user“ | „reactivated“ | „ok“ +* wrong users: array of users, which were not available in the contact table + + +### users/group_update +Update the group with the posted array of contacts as members (post all members of the group to the call; function will remove members not posted). +#### Parameters +* gid: id of the group to be changed +* name: name of the group to be changed + +#### POST data +JSON data as array like the result of „users/group_show“: +* gid +* name +* array of users + +#### Return values +Array of: +* success: true if successfully updated +* gid: gid of the changed group +* name: name of the changed group +* status: „missing user“ | „ok“ +* wrong users: array of users, which were not available in the contact table + + ## Not Implemented API calls The following API calls are implemented in GNU Social but not in Friendica: (incomplete)