Difference between revisions of "API"
(→About the API) |
(→About the API) |
||
Line 3: | Line 3: | ||
= About the API = | = About the API = | ||
− | The SoFurry API is a stateless REST API, designed to work purely with JSON. For the nerdy, the underlying framework is | + | The SoFurry API is a stateless REST API, designed to work purely with JSON. For the nerdy, the underlying framework is [http://lumen.laravel.com/| Lumen 5.2] |
While the API is in development, along with the rest of SoFurry, the base URL will be http://api.sofurrybeta.com - once it changes over to production, the base URL will be https://api.sofurry.com | While the API is in development, along with the rest of SoFurry, the base URL will be http://api.sofurrybeta.com - once it changes over to production, the base URL will be https://api.sofurry.com |
Revision as of 13:44, 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 SoFurry API is a stateless REST API, designed to work purely with JSON. For the nerdy, the underlying framework is Lumen 5.2
While the API is in development, along with the rest of SoFurry, the base URL will be http://api.sofurrybeta.com - once it changes over to production, the base URL will be https://api.sofurry.com
To get started using the API, you won't need much - just some HTTP basics, and the ability to read and write JSON.
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 |
Submissions
These routes are all about creating and managing individual submissions.
To do: Search submissions
Route | Parameters | Description | Need Token? | Status |
POST /submission
|
title, type, rating, description, visible | Create a new Submission record. It won't be shared until it has been populated with some content | Yes | Live |
GET /submission/{id}
|
id=Submission ID | Retrieve a Submission JSON object. | Yes | Live |
PUT /submission/{id}/content
|
id=Submission ID, (binary stream) | Store a binary content stream against a submission. By default, populating a submission for the first time will publish it to your watchers, and the global gallery. | Yes | Live |
Forum
Methods for interacting on forums, still in development
Galleries
A Gallery is a collection of artwork. By default, there is a global SoFurry Gallery into which all content is published.
As a user, a gallery is created for you as soon as you upload your first piece of content. Galleries can also be created to curate content, and are created to support RP Universes.
RP Universes
An RP Universe is built around a collection of roleplay posts, supplemented by artwork. These methods are for creating new universes, inviting characters to participate, the actual participation, and linking relevant content into the Universe.
Character System
The Character system allows users to create roleplaying characters, which can be used to interact across the site.
Journals
Methods for creating and updating journal entries
Private Messages
Methods for listing, reading and sending Private Messages
Chatrooms
List and get connection info for chatrooms. The actual rooms will be joined using a different method.