3 <!-- markdownlint-disable MD010 MD013 MD024 -->
7 Friendica offers multiple API endpoints to interface with third-party applications:
9 - [Twitter](help/API-Twitter)
10 - [Mastodon](help/API-Mastodon)
11 - [Friendica-specific](help/API-Friendica)
12 - [GNU Social](help/API-GNU-Social)
18 API endpoints can restrict the HTTP method used to request them.
19 Using an invalid method results in HTTP error 405 "Method Not Allowed".
23 Friendica supports basic HTTP Auth and OAuth 1 to authenticate the user to the APIs.
25 OAuth settings can be added by the user in web UI under [/settings/oauth/](/settings/oauth/).
29 When an error occurs in API call, an HTTP error code is returned, with an error message
32 * 400 Bad Request: if parameters are missing or items can't be found
33 * 403 Forbidden: if the authenticated user is missing
34 * 405 Method Not Allowed: if API was called with an invalid method, eg. GET when API require POST
35 * 501 Not Implemented: if the requested API doesn't exist
36 * 500 Internal Server Error: on other error conditions
44 "error": "Specific error message",
45 "request": "API path requested",
46 "code": "HTTP error code"
54 <error>Specific error message</error>
55 <request>API path requested</request>
56 <code>HTTP error code</code>
65 /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"
70 The [RSStoFriendika](https://github.com/pafcu/RSStoFriendika) code can be used as an example of how to use the API with python.
71 The lines for posting are located at [line 21](https://github.com/pafcu/RSStoFriendika/blob/master/RSStoFriendika.py#L21) and following.
73 def tweet(server, message, group_allow=None):
74 url = server + '/api/statuses/update'
75 urllib2.urlopen(url, urllib.urlencode({'status': message,'group_allow[]':group_allow}, doseq=True))
77 There is also a [module for python 3](https://bitbucket.org/tobiasd/python-friendica) for using the API.