Difference between revisions of "API"
(→Users and Profiles) |
(→Users and Profiles) |
||
Line 21: | Line 21: | ||
== Users and Profiles == | == Users and Profiles == | ||
− | These routes | + | These routes are all about managing user accounts and profiles. Not all the routes are secure (require authentication). |
{| class="wikitable" | {| class="wikitable" | ||
Line 27: | Line 27: | ||
|Parameters | |Parameters | ||
|Description | |Description | ||
+ | |Need Token? | ||
|Status | |Status | ||
|- | |- | ||
Line 32: | Line 33: | ||
| | | | ||
|Returns the version of the API | |Returns the version of the API | ||
+ | |No | ||
|Live | |Live | ||
|- | |- | ||
Line 37: | Line 39: | ||
|email, password | |email, password | ||
|Validates the supplied credentials and returns an authentication token that should be used for all future requests | |Validates the supplied credentials and returns an authentication token that should be used for all future requests | ||
+ | |No | ||
|Live | |Live | ||
|- | |- | ||
Line 42: | Line 45: | ||
|activate_token | |activate_token | ||
|Activates a newly-registered user, enabling you to log in | |Activates a newly-registered user, enabling you to log in | ||
+ | |No | ||
|Live | |Live | ||
|- | |- | ||
Line 47: | Line 51: | ||
|name, email, password | |name, email, password | ||
|Register a new user account and trigger a validation email to the supplied email address | |Register a new user account and trigger a validation email to the supplied email address | ||
+ | |No | ||
|Live | |Live | ||
|- | |- | ||
Line 52: | Line 57: | ||
| | | | ||
|Returns a JSON object with the profile details of the authenticated user | |Returns a JSON object with the profile details of the authenticated user | ||
+ | |Yes | ||
|Live | |Live | ||
|- | |- | ||
Line 57: | Line 63: | ||
|id=User ID | |id=User ID | ||
|Returns the profile information for a different User ID. | |Returns the profile information for a different User ID. | ||
+ | |Yes | ||
|Live | |Live | ||
|- | |- | ||
Line 62: | Line 69: | ||
|bio | |bio | ||
|Make an update to the profile of the authenticated user by overwriting several fields. | |Make an update to the profile of the authenticated user by overwriting several fields. | ||
+ | |Yes | ||
|Live | |Live | ||
|} | |} |
Revision as of 11:29, 25 April 2016
This page deals with the new-format REST API being developed as part of SoFurry NEXT. For documentation on the current "v3" API, please see SoFurry_REST_APIs.
Contents
About the API
The api runs on lumen, is classic json/rest, at the domain name api.sofurrybeta.com. It should always be accessed over HTTPS.
Making a simple API request
GET request sample
Authentication
POST for login to create a session, get a token
API Routes
This table contains all the methods and URLs that the API currently supports. For more information on using a particular route, simply go through to that route's page.
Some routes have no parameters at all, and can be accessed simply by doing the HTTP request. Some routes require parameters as part of the URL - they will be denoted by curly braces, and are always mandatory. Some requests expect parameters to be sent in the body of a JSON request.
Users and Profiles
These routes are all about managing user accounts and profiles. Not all the routes are secure (require authentication).
Route | Parameters | Description | Need Token? | Status |
GET /
|
Returns the version of the API | No | Live | |
POST /login
|
email, password | Validates the supplied credentials and returns an authentication token that should be used for all future requests | No | Live |
POST /activate
|
activate_token | Activates a newly-registered user, enabling you to log in | No | Live |
POST /user
|
name, email, password | Register a new user account and trigger a validation email to the supplied email address | No | Live |
GET /user | Returns a JSON object with the profile details of the authenticated user | Yes | Live | |
GET /user/{id} | id=User ID | Returns the profile information for a different User ID. | Yes | Live |
PUT /user | bio | Make an update to the profile of the authenticated user by overwriting several fields. | Yes | Live |
Authenticated Routes
These routes all require authentication. Send in the authentication token using the `X-SoFurry-Token` header.
Route | Parameters | Description | Status |
Last updated at datetime