Skip to content

Restful API for Apps or any other external access

SSilence edited this page Apr 7, 2013 · 10 revisions

selfoss offers an restful JSON API for applications. If you are a programmer of a mobile app, plugin or any other system which wants to access selfoss then this is your place.

Basics

You can access selfoss by using the same backend as selfoss user interface: The restful HTTP JSON API. There are a few urls where you can get information from selfoss and some for updating data. Assume you want all tags for rendering this in your own app. You have to make an HTTP GET call on the url /tags:

GET http://yourselfossurl.com/tags

The result is following JSON formatted response (in this example two tags "blog" and "deviantart" are available:

[{"tag":"blog","color":"#251f10","unread":"1"},
 {"tag":"deviantart","color":"#e78e5c","unread":"0"}]

Following docs shows you which calls are possible and which response you can expect.

Authentication

When you are using a login protected page, you have to add the parameter username and password in every request (as GET or POST parameter). The logical consequence is that you have to use https.

Login

For an initial login functionality in your app you can validate a username password combination:

GET http://yourselfossurl.com/login

Parameter

  • username the username which should be validated
  • password the password which should be validated

Response

{"success":true}
  • success true = correct login, false = wrong login data

Items/Articles

Clone this wiki locally