X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=doc%2Fapi.md;h=bf1507adba7527bb20e62d7b71a92369212e46d1;hb=afc7d316a72fe3d50d1fdd6cf099a3f375c493a9;hp=c020f403ff2eacdf81138d98ef8ada61ba999b18;hpb=a283691149fa9224be8b7ba8edc4dcdef88c3612;p=friendica.git diff --git a/doc/api.md b/doc/api.md index c020f403ff..bf1507adba 100644 --- a/doc/api.md +++ b/doc/api.md @@ -1,6 +1,6 @@ Friendica API === -The Friendica API aims to be compatible to the [GNU Social API](http://skilledtests.com/wiki/Twitter-compatible_API) and the [Twitter API](https://dev.twitter.com/rest/public). +The Friendica API aims to be compatible to the [GNU Social API](http://wiki.gnusocial.de/gnusocial:api) and the [Twitter API](https://dev.twitter.com/rest/public). Please refer to the linked documentation for further information. @@ -104,6 +104,7 @@ Unofficial Twitter command. It shows all direct answers (excluding the original * max_id: maximum id * getText: Defines the format of the status field. Can be "html" or "plain" * include_entities: "true" shows entities for pictures and links (Default: false) +* friendica_verbose: "true" enables different error returns (default: "false") #### Unsupported parameters * skip_status @@ -116,6 +117,7 @@ Unofficial Twitter command. It shows all direct answers (excluding the original * since_id: minimal id * max_id: maximum id * getText: Defines the format of the status field. Can be "html" or "plain" +* friendica_verbose: "true" enables different error returns (default: "false") --- ### direct_messages/conversation (*; AUTH) @@ -127,6 +129,18 @@ Shows all direct messages of a conversation * max_id: maximum id * getText: Defines the format of the status field. Can be "html" or "plain" * uri: URI of the conversation +* friendica_verbose: "true" enables different error returns (default: "false") + +--- +### direct_messages/sent (*; AUTH) +#### Parameters +* count: Items per page (default: 20) +* page: page number +* since_id: minimal id +* max_id: maximum id +* getText: Defines the format of the status field. Can be "html" or "plain" +* include_entities: "true" shows entities for pictures and links (Default: false) +* friendica_verbose: "true" enables different error returns (default: "false") --- ### direct_messages/new (POST,PUT; AUTH) @@ -138,14 +152,22 @@ Shows all direct messages of a conversation * title: Title of the direct message --- -### direct_messages/sent (*; AUTH) +### direct_messages/destroy (POST,DELETE; AUTH) #### Parameters -* count: Items per page (default: 20) -* page: page number -* since_id: minimal id -* max_id: maximum id -* getText: Defines the format of the status field. Can be "html" or "plain" -* include_entities: "true" shows entities for pictures and links (Default: false) +* id: id of the message to be deleted +* include_entities: optional, currently not yet implemented +* friendica_parenturi: optional, can be used for increased safety to delete only intended messages +* friendica_verbose: "true" enables different error returns (default: "false") + +#### Return values + +On success: +* JSON return as defined for Twitter API not yet implemented +* on friendica_verbose=true: JSON return {"result":"ok","message":"message deleted"} + +On error: +HTTP 400 BadRequest +* on friendica_verbose=true: different JSON returns {"result":"error","message":"xyz"} --- ### favorites (*; AUTH) @@ -388,6 +410,18 @@ Friendica doesn't allow showing friends of other users. --- ### statusnet/config (*) +--- +### statusnet/conversation (*; AUTH) +It shows all direct answers (excluding the original post) to a given id. + +#### Parameter +* id: id of the post +* count: Items per page (default: 20) +* page: page number +* since_id: minimal id +* max_id: maximum id +* include_entities: "true" shows entities for pictures and links (Default: false) + --- ### statusnet/version (*) @@ -682,6 +716,65 @@ xml ``` +--- +### friendica/direct_messages_setseen (GET; AUTH) +#### Parameters +* id: id of the message to be updated as seen + +#### Return values + +On success: +* JSON return {"result":"ok","message":"message set to seen"} + +On error: +* different JSON returns {"result":"error","message":"xyz"} + +--- +### friendica/direct_messages_search (GET; AUTH) +#### Parameters +* searchstring: string for which the API call should search as '%searchstring%' in field 'body' of all messages of the authenticated user (caption ignored) + +#### Return values +Returns only tested with JSON, XML might work as well. + +On success: +* JSON return {"success":"true","search_results": array of found messages} +* JSOn return {"success":"false","search_results":"nothing found"} + +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 @@ -706,7 +799,6 @@ The following API calls from the Twitter API aren't implemented neither in Frien * statuses/lookup * direct_messages/show * search/tweets -* direct_messages/destroy * friendships/no_retweets/ids * friendships/incoming * friendships/outgoing