From 77f13571233fbad04132f375bf596d74a2bc2e88 Mon Sep 17 00:00:00 2001 From: gerhard6380 Date: Mon, 7 Dec 2015 22:07:20 +0100 Subject: [PATCH 1/3] 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) From 1d3b61c3b92b6d840a2db39019febcc6e61e7af3 Mon Sep 17 00:00:00 2001 From: gerhard6380 Date: Mon, 7 Dec 2015 22:42:43 +0100 Subject: [PATCH 2/3] Update api.md changed from api/users/group_* to api/friendica/group_* --- doc/api.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/doc/api.md b/doc/api.md index 478ef6d2b9..aa02aac6f5 100644 --- a/doc/api.md +++ b/doc/api.md @@ -349,7 +349,7 @@ Friendica doesn't allow showing friends of other users. ## Implemented API calls (not compatible with other API’s) -### users/group_show +### friendica/group_show Return all or a specified group of the user with the containing contacts as array. #### Parameters @@ -362,7 +362,7 @@ Array of: * user: array of group members (return from api_get_user() function for each member) -### users/group_delete +### friendica/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 @@ -378,7 +378,7 @@ Array of: * wrong users: empty array -### users/group_create +### friendica/group_create Create the group with the posted array of contacts as members. #### Parameters * name: name of the group to be created @@ -398,7 +398,7 @@ Array of: * wrong users: array of users, which were not available in the contact table -### users/group_update +### friendica/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 From d02bd08bde6d0eea2fcc5e8df0854040b97d4d56 Mon Sep 17 00:00:00 2001 From: gerhard6380 Date: Mon, 14 Dec 2015 22:53:12 +0100 Subject: [PATCH 3/3] Update api.md --- doc/api.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/api.md b/doc/api.md index aa02aac6f5..391d6c9eb9 100644 --- a/doc/api.md +++ b/doc/api.md @@ -347,7 +347,7 @@ 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) +## Implemented API calls (not compatible with other APIs) ### friendica/group_show Return all or a specified group of the user with the containing contacts as array.