1 Implemented API calls
\r
3 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).
\r
5 Please refer to the linked documentation for further information.
\r
7 ## Implemented API calls
\r
10 #### Unsupported parameters
\r
11 * cursor: Not implemented in GNU Social
\r
12 * trim_user: Not implemented in GNU Social
\r
13 * contributor_details: Not implemented in GNU Social
\r
14 * place_id: Not implemented in GNU Social
\r
15 * display_coordinates: Not implemented in GNU Social
\r
16 * include_rts: To-Do
\r
17 * include_my_retweet: Retweets in Friendica are implemented in a different way
\r
19 #### Different behaviour
\r
20 * screen_name: The nick name in friendica is only unique in each network but not for all networks. The users are searched in the following priority: Friendica, StatusNet/GNU Social, Diaspora, pump.io, Twitter. If no contact was found by this way, then the first contact is taken.
\r
21 * include_entities: Default is "false". If set to "true" then the plain text is formatted so that links are having descriptions.
\r
24 * cid: Contact id of the user (important for "contact_allow" and "contact_deny")
\r
25 * network: network of the user
\r
27 ### account/rate_limit_status
\r
29 ### account/verify_credentials
\r
31 * skip_status: Don't show the "status" field. (Default: false)
\r
32 * include_entities: "true" shows entities for pictures and links (Default: false)
\r
34 ### conversation/show
\r
35 Unofficial Twitter command. It shows all direct answers (excluding the original post) to a given id.
\r
38 * id: id of the post
\r
39 * count: Items per page (default: 20)
\r
41 * since_id: minimal id
\r
42 * max_id: maximum id
\r
43 * include_entities: "true" shows entities for pictures and links (Default: false)
\r
45 #### Unsupported parameters
\r
48 * contributor_details
\r
52 * count: Items per page (default: 20)
\r
54 * since_id: minimal id
\r
55 * max_id: maximum id
\r
56 * getText: Defines the format of the status field. Can be "html" or "plain"
\r
57 * include_entities: "true" shows entities for pictures and links (Default: false)
\r
59 #### Unsupported parameters
\r
62 ### direct_messages/all
\r
64 * count: Items per page (default: 20)
\r
66 * since_id: minimal id
\r
67 * max_id: maximum id
\r
68 * getText: Defines the format of the status field. Can be "html" or "plain"
\r
70 ### direct_messages/conversation
\r
71 Shows all direct messages of a conversation
\r
73 * count: Items per page (default: 20)
\r
75 * since_id: minimal id
\r
76 * max_id: maximum id
\r
77 * getText: Defines the format of the status field. Can be "html" or "plain"
\r
78 * uri: URI of the conversation
\r
80 ### direct_messages/new
\r
82 * user_id: id of the user
\r
83 * screen_name: screen name (for technical reasons, this value is not unique!)
\r
85 * replyto: ID of the replied direct message
\r
86 * title: Title of the direct message
\r
88 ### direct_messages/sent
\r
90 * count: Items per page (default: 20)
\r
92 * since_id: minimal id
\r
93 * max_id: maximum id
\r
94 * getText: Defines the format of the status field. Can be "html" or "plain"
\r
95 * include_entities: "true" shows entities for pictures and links (Default: false)
\r
99 * count: Items per page (default: 20)
\r
100 * page: page number
\r
101 * since_id: minimal id
\r
102 * max_id: maximum id
\r
103 * include_entities: "true" shows entities for pictures and links (Default: false)
\r
105 #### Unsupported parameters
\r
109 Favorites aren't displayed to other users, so "user_id" and "screen_name". So setting this value will result in an empty array.
\r
111 ### favorites/create
\r
114 * include_entities: "true" shows entities for pictures and links (Default: false)
\r
116 ### favorites/destroy
\r
119 * include_entities: "true" shows entities for pictures and links (Default: false)
\r
123 * stringify_ids: Should the id numbers be sent as text (true) or number (false)? (default: false)
\r
125 #### Unsupported parameters
\r
130 Friendica doesn't allow showing followers of other users.
\r
132 ### friendica/photo
\r
134 * photo_id: Resource id of a photo.
\r
136 Returns data of a picture with the given resource.
\r
138 ### friendica/photos/list
\r
140 Returns a list of all photo resources of the logged in user.
\r
144 * stringify_ids: Should the id numbers be sent as text (true) or number (false)? (default: false)
\r
146 #### Unsupported parameters
\r
151 Friendica doesn't allow showing friends of other users.
\r
157 * media: image data
\r
159 ### oauth/request_token
\r
163 #### Unsupported parameters
\r
164 * x_auth_access_type
\r
166 ### oauth/access_token
\r
170 #### Unsupported parameters
\r
175 ### statuses/destroy
\r
177 * id: message number
\r
178 * include_entities: "true" shows entities for pictures and links (Default: false)
\r
180 #### Unsupported parameters
\r
183 ### statuses/followers
\r
184 * include_entities: "true" shows entities for pictures and links (Default: false)
\r
186 ### statuses/friends
\r
187 * include_entities: "true" shows entities for pictures and links (Default: false)
\r
189 ### statuses/friends_timeline
\r
191 * count: Items per page (default: 20)
\r
192 * page: page number
\r
193 * since_id: minimal id
\r
194 * max_id: maximum id
\r
195 * exclude_replies: don't show replies (default: false)
\r
196 * conversation_id: Shows all statuses of a given conversation.
\r
197 * include_entities: "true" shows entities for pictures and links (Default: false)
\r
199 #### Unsupported parameters
\r
202 * contributor_details
\r
204 ### statuses/home_timeline
\r
206 * count: Items per page (default: 20)
\r
207 * page: page number
\r
208 * since_id: minimal id
\r
209 * max_id: maximum id
\r
210 * exclude_replies: don't show replies (default: false)
\r
211 * conversation_id: Shows all statuses of a given conversation.
\r
212 * include_entities: "true" shows entities for pictures and links (Default: false)
\r
214 #### Unsupported parameters
\r
217 * contributor_details
\r
219 ### statuses/mentions
\r
221 * count: Items per page (default: 20)
\r
222 * page: page number
\r
223 * since_id: minimal id
\r
224 * max_id: maximum id
\r
225 * include_entities: "true" shows entities for pictures and links (Default: false)
\r
227 #### Unsupported parameters
\r
230 * contributor_details
\r
232 ### statuses/public_timeline
\r
234 * count: Items per page (default: 20)
\r
235 * page: page number
\r
236 * since_id: minimal id
\r
237 * max_id: maximum id
\r
238 * exclude_replies: don't show replies (default: false)
\r
239 * conversation_id: Shows all statuses of a given conversation.
\r
240 * include_entities: "true" shows entities for pictures and links (Default: false)
\r
242 #### Unsupported parameters
\r
245 ### statuses/replies
\r
247 * count: Items per page (default: 20)
\r
248 * page: page number
\r
249 * since_id: minimal id
\r
250 * max_id: maximum id
\r
251 * include_entities: "true" shows entities for pictures and links (Default: false)
\r
253 #### Unsupported parameters
\r
256 * contributor_details
\r
258 ### statuses/retweet
\r
260 * id: message number
\r
261 * include_entities: "true" shows entities for pictures and links (Default: false)
\r
263 #### Unsupported parameters
\r
268 * id: message number
\r
269 * conversation: if set to "1" show all messages of the conversation with the given id
\r
270 * include_entities: "true" shows entities for pictures and links (Default: false)
\r
272 #### Unsupported parameters
\r
273 * include_my_retweet
\r
276 ### statuses/update, statuses/update_with_media
\r
278 * title: Title of the status
\r
279 * status: Status in text format
\r
280 * htmlstatus: Status in HTML format
\r
281 * in_reply_to_status_id
\r
284 * media: image data
\r
285 * source: Application name
\r
291 * include_entities: "true" shows entities for pictures and links (Default: false)
\r
292 * media_ids: (By now only a single value, no array)
\r
294 #### Unsupported parameters
\r
297 * display_coordinates
\r
299 ### statuses/user_timeline
\r
301 * user_id: id of the user
\r
302 * screen_name: screen name (for technical reasons, this value is not unique!)
\r
303 * count: Items per page (default: 20)
\r
304 * page: page number
\r
305 * since_id: minimal id
\r
306 * max_id: maximum id
\r
307 * exclude_replies: don't show replies (default: false)
\r
308 * conversation_id: Shows all statuses of a given conversation.
\r
309 * include_entities: "true" shows entities for pictures and links (Default: false)
\r
311 #### Unsupported parameters
\r
314 * contributor_details
\r
316 ### statusnet/config
\r
318 ### statusnet/version
\r
320 #### Unsupported parameters
\r
325 Friendica doesn't allow showing followers of other users.
\r
329 * q: name of the user
\r
331 #### Unsupported parameters
\r
338 * user_id: id of the user
\r
339 * screen_name: screen name (for technical reasons, this value is not unique!)
\r
340 * include_entities: "true" shows entities for pictures and links (Default: false)
\r
342 #### Unsupported parameters
\r
347 Friendica doesn't allow showing friends of other users.
\r
350 ## Implemented API calls (not compatible with other APIs)
\r
352 ### friendica/group_show
\r
353 Return all or a specified group of the user with the containing contacts as array.
\r
356 * gid: optional, if not given, API returns all groups of the user
\r
360 * name: name of the group
\r
361 * gid: id of the group
\r
362 * user: array of group members (return from api_get_user() function for each member)
\r
365 ### friendica/group_delete
\r
366 delete the specified group of contacts; API call need to include the correct gid AND name of the group to be deleted.
\r
369 * gid: id of the group to be deleted
\r
370 * name: name of the group to be deleted
\r
374 * success: true if successfully deleted
\r
375 * gid: gid of the deleted group
\r
376 * name: name of the deleted group
\r
377 * status: „deleted“ if successfully deleted
\r
378 * wrong users: empty array
\r
381 ### friendica/group_create
\r
382 Create the group with the posted array of contacts as members.
\r
384 * name: name of the group to be created
\r
387 JSON data as Array like the result of „users/group_show“:
\r
394 * success: true if successfully created or reactivated
\r
395 * gid: gid of the created group
\r
396 * name: name of the created group
\r
397 * status: „missing user“ | „reactivated“ | „ok“
\r
398 * wrong users: array of users, which were not available in the contact table
\r
401 ### friendica/group_update
\r
402 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).
\r
404 * gid: id of the group to be changed
\r
405 * name: name of the group to be changed
\r
408 JSON data as array like the result of „users/group_show“:
\r
415 * success: true if successfully updated
\r
416 * gid: gid of the changed group
\r
417 * name: name of the changed group
\r
418 * status: „missing user“ | „ok“
\r
419 * wrong users: array of users, which were not available in the contact table
\r
422 ## Not Implemented API calls
\r
423 The following API calls are implemented in GNU Social but not in Friendica: (incomplete)
\r
425 * statuses/retweets_of_me
\r
426 * friendships/create
\r
427 * friendships/destroy
\r
428 * friendships/exists
\r
430 * account/update_profile_background_image
\r
431 * account/update_profile_image
\r
435 The following API calls from the Twitter API aren't implemented neither in Friendica nor in GNU Social:
\r
437 * statuses/mentions_timeline
\r
438 * statuses/retweets/:id
\r
440 * statuses/retweeters/ids
\r
442 * direct_messages/show
\r
444 * direct_messages/destroy
\r
445 * friendships/no_retweets/ids
\r
446 * friendships/incoming
\r
447 * friendships/outgoing
\r
448 * friendships/update
\r
450 * friendships/lookup
\r
452 * account/update_delivery_device
\r
453 * account/update_profile
\r
454 * account/update_profile_background_image
\r
455 * account/update_profile_image
\r
461 * account/remove_profile_banner
\r
462 * account/update_profile_banner
\r
463 * users/profile_banner
\r
464 * mutes/users/create
\r
465 * mutes/users/destroy
\r
468 * users/suggestions/:slug
\r
469 * users/suggestions
\r
470 * users/suggestions/:slug/members
\r
474 * lists/members/destroy
\r
475 * lists/memberships
\r
476 * lists/subscribers
\r
477 * lists/subscribers/create
\r
478 * lists/subscribers/show
\r
479 * lists/subscribers/destroy
\r
480 * lists/members/create_all
\r
481 * lists/members/show
\r
483 * lists/members/create
\r
488 * lists/subscriptions
\r
489 * lists/members/destroy_all
\r
491 * saved_searches/list
\r
492 * saved_searches/show/:id
\r
493 * saved_searches/create
\r
494 * saved_searches/destroy/:id
\r
496 * geo/reverse_geocode
\r
501 * help/configuration
\r
506 * users/report_spam
\r
510 Betamax has documentated some example API usage from a [bash script](https://en.wikipedia.org/wiki/Bash_(Unix_shell) employing [curl](https://en.wikipedia.org/wiki/CURL) (see [his posting](https://betamax65.de/display/betamax65/43539)).
\r
512 /usr/bin/curl -u USER:PASS https://YOUR.FRIENDICA.TLD/api/statuses/update.xml -d source="some source id" -d status="the status you want to post"
\r
515 The [RSStoFriedika](https://github.com/pafcu/RSStoFriendika) code can be used as an example of how to use the API with python. The lines for posting are located at [line 21](https://github.com/pafcu/RSStoFriendika/blob/master/RSStoFriendika.py#L21) and following.
\r
517 def tweet(server, message, group_allow=None):
\r
518 url = server + '/api/statuses/update'
\r
519 urllib2.urlopen(url, urllib.urlencode({'status': message,'group_allow[]':group_allow}, doseq=True))
\r
521 There is also a [module for python 3](https://bitbucket.org/tobiasd/python-friendica) for using the API.
\r