X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=doc%2Fapi.md;h=b759b4697c0dbd51721745f2102939bbca8deed0;hb=4d30f2b292ec0b77de13cae3c622df84f84aa54f;hp=7d6f440c58c0008ecbaf909048c194f1b09c52ff;hpb=dfa5183774e24fe2b1a355c9427372d4cd55ea70;p=friendica.git diff --git a/doc/api.md b/doc/api.md index 7d6f440c58..b759b4697c 100644 --- a/doc/api.md +++ b/doc/api.md @@ -1,5 +1,8 @@ Friendica API === + +* [Home](help) + 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 +107,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 +120,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 +132,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 +155,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) @@ -694,6 +719,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 @@ -718,7 +802,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