MediaWiki API result

This is the HTML representation of the JSON format. HTML is good for debugging, but is unsuitable for application use.

Specify the format parameter to change the output format. To see the non-HTML representation of the JSON format, set format=json.

See the complete documentation, or the API help for more information.

{
    "batchcomplete": "",
    "query": {
        "pages": {
            "585": {
                "pageid": 585,
                "ns": 0,
                "title": "API",
                "revisions": [
                    {
                        "user": "Tetsudra",
                        "timestamp": "2016-05-15T14:25:23Z",
                        "comment": "/* Authentication */",
                        "contentformat": "text/x-wiki",
                        "contentmodel": "wikitext",
                        "*": "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]].\n\n= About the API =\n\nThe 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]\n\nWhile 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\n\nTo get started using the API, you won't need much - just some HTTP basics, and the ability to read and write JSON.\n\n= Making a simple API request =\n\nHere's how you might write some PHP to make an authenticated request to the API - for example, retrieving a submission.\n\n <code class=\"php\">// We're doing: GET /submission/5\n $ch = curl_init(\"<nowiki>http://api.sofurrybeta.com/submission/5</nowiki>\");\n \n // GET, POST, PUT, DELETE are all used in some form or another\n curl_setopt($ch, CURLOPT_CUSTOMREQUEST, \"GET\");\n \n // Add our authentication token, and ensure the request is sent\n // with the correct content type (which is just good practice)\n curl_setopt($ch, CURLOPT_HTTPHEADER, [\n     'Content-Type: application/json', \n     'X-SoFurry-Token: 1:cbe30d2d960b4b5eb65ababdf79eb6b1'\n ]);\n \n // We need to see the resulting content\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);\n \n // Run the request\n $json = curl_exec($ch);\n \n // Check the HTTP code we got back from the server\n $http_code = curl_getinfo($ch, CURLINFO_HTTP_CODE);\n \n if ($http_code == 200)\n {\n   // Our request was successful!\n   \n   // Decode the JSON into a usable object\n   $submission = json_decode($json);\n   \n   // And do something with it\n   echo $submission->title; // \"My awesome artwork\"\n   \n }\n else\n {\n   // Something went wrong! we'll have an error message here.\n   // If $http_code is 422, it usually means you sent something incorrectly\n   // HTTP 404 means you're looking for a resource you either can't see, or that doesn't exist\n   // HTTP 500 means there's a temporary server issue\n }\n </code>\n\nIf you're unable to access the API over HTTPS, and you're using PHP, you might not have a CA bundle installed. See http://php.net/manual/en/function.curl-setopt.php#110457 for a solution to that.\n\n= Authentication =\n\nTo login to SoFurry, you'd POST your username and password to an endpoint, then use the token it issues in future requests. Here's how you might log in using PHP:\n\n <code class=\"php\">// Logging into SoFurry\n $ch = curl_init(\"<nowiki>http://api.sofurry.com/login</nowiki>\");\n curl_setopt($ch, CURLOPT_CUSTOMREQUEST, \"POST\");\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);\n curl_setopt($ch, CURLOPT_POSTFIELDS, '{ \"username\": \"tetsudra\", \"password\": \"ableist1353\" }');\n curl_setopt($ch, CURLOPT_HTTPHEADER, [\n     'Content-Type: application/json'\n ]);\n \n $json = curl_exec($ch);\n $login = json_decode($json);\n \n if ($login->result)\n     $token = $login->token;</code>\n\nNow that you've got your $token, you can use it to authenticate future requests, by adding it with the X-SoFurry-Token header.\n\n <code class=\"php\">// Retrieving the user you're logged in as\n $ch = curl_init(\"<nowiki>http://api.sofurry.com/user</nowiki>\");\n curl_setopt($ch, CURLOPT_CUSTOMREQUEST, \"GET\");\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);\n curl_setopt($ch, CURLOPT_HTTPHEADER, [\n     'Content-Type: application/json',\n     'X-SoFurry-Token: 1:e99568fcbfde573385e1fff301e5e41b'\n ]);\n \n $json = curl_exec($ch);\n $user = json_decode($json);\n \n echo $user->email; // drgn@tetsudra.com</code>\n\nYou'll need to be authenticated in order to almost anything of value on SoFurry.\n\n''Note'' Logging in will invalidate all previous tokens!\n\n= API Routes =\n\nThis 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.\n\nSome 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.\n\n== Users and Profiles ==\n\nThese routes are all about managing user accounts and profiles. Not all the routes are secure (require authentication).\n\n{| class=\"wikitable\"\n|Route\n|Parameters\n|Description\n|Need Token?\n|Status\n|-\n|<code>[[API:GET /|GET /]]</code>\n|\n|Returns the version of the API\n|No\n|Live\n|-\n|<code>[[API:POST /login|POST /login]]</code>\n|email, password\n|Validates the supplied credentials and returns an authentication token that should be used for all future requests\n|No\n|Live\n|-\n|<code>[[API:POST /activate|POST /activate]]</code>\n|activate_token\n|Activates a newly-registered user, enabling you to log in\n|No\n|Live\n|-\n|<code>[[API:POST /user|POST /user]]</code>\n|name, email, password\n|Register a new user account and trigger a validation email to the supplied email address\n|No\n|Live\n|-\n|<code>[[API:GET /user|GET /user]]</code>\n|\n|Returns a JSON object with the profile details of the authenticated user\n|Yes\n|Live\n|-\n|<code>[[API:GET /user/:id|GET /user/{id}]]</code>\n|id=User ID\n|Returns the profile information for a different User ID.\n|Yes\n|Live\n|-\n|<code>[[API:PUT /user|PUT /user]]</code>\n|bio\n|Make an update to the profile of the authenticated user by overwriting several fields.\n|Yes\n|Live\n|}\n\n== Submissions ==\n\nThese routes are all about creating and managing individual submissions.\n\nTo do: Search submissions\n\n{| class=\"wikitable\"\n|Route\n|Parameters\n|Description\n|Need Token?\n|Status\n|-\n|<code>[[API:POST /submission|POST /submission]]</code>\n|title, type, rating, description, visible\n|Create a new Submission record. It won't be shared until it has been populated with some content\n|Yes\n|Live\n|-\n|<code>[[API:GET /submission/:id|GET /submission/{id}]]</code>\n|id=Submission ID\n|Retrieve a Submission JSON object.\n|Yes\n|Live\n|-\n|<code>[[API:PUT /submission/:id/content|PUT /submission/{id}/content]]</code>\n|id=Submission ID, (binary stream)\n|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.\n|Yes\n|Live\n|}\n\n== Forum ==\n\nMethods for interacting on forums, still in development\n\n== Galleries ==\n\nA Gallery is a collection of artwork. By default, there is a global SoFurry Gallery into which all content is published.\n\nAs 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.\n\n== RP Universes ==\n\nAn 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.\n\n== Character System ==\n\nThe Character system allows users to create roleplaying characters, which can be used to interact across the site.\n\n== Journals ==\n\nMethods for creating and updating journal entries\n\n== Private Messages ==\n\nMethods for listing, reading and sending Private Messages\n\n== Chatrooms ==\n\nList and get connection info for chatrooms. The actual rooms will be joined using a different method.\n\n[[Category:API]]"
                    }
                ]
            },
            "1": {
                "pageid": 1,
                "ns": 0,
                "title": "Main Page",
                "revisions": [
                    {
                        "user": "SDSlayer",
                        "timestamp": "2017-08-26T06:52:06Z",
                        "comment": "Added EV help link",
                        "contentformat": "text/x-wiki",
                        "contentmodel": "wikitext",
                        "*": "'''All forms of creativity are equally valuable.'''\n'''We believe in keeping an open mind.'''\n'''We save the fruits of creativity for posterity.'''\n\nThese are our [[Core Values]] in a nutshell, and we are all SoFurry!\n\n{| width=100% valign=top |\n| width=50% valign=top |\n__NOTOC__\n== Policy & Administration ==\n* [[Core Values]]\n* [[Acceptable Use Policy]]\n* [[Chat Rules]]\n* [[Privacy Policy]]\n* [[The SoFurry Team]]\n* [[The SoFurry Staff Pledge]]\n* [[DMCA Information]]\n\n== Help and Support ==\n* [[FAQ_2.0|FAQ]]\n* [[Old_FAQ|The old FAQ]]\n* [[Report Process]]\n* [http://www.sofurry.com/report Your Support Tickets]\n* [[Email_Validation|Verifying your email]]\n\n== User Manuals ==\n* [[Introduction to SoFurry]]\n* [[Groups|Introduction to Groups]]\n* [[Chat Guide]]\n* [[Using the forums]]\n* [[Chat commands]]\n* [[BBCodes on SoFurry]]\n* [[Uploading content]]\n* [[Your Banner on SoFurry]]\n\n== SoFurry on other sites ==\n* [http://twitter.com/sofurrynews Twitter]\n\n| valign=top |\n== Help SoFurry ==\n* [[Show Your Support]]\n* [[Donate]]\n* [[Advertising on SoFurry]]\n\n\n== Apps, Services & Toys ==\n* [[SoFurry Apps for PC and Mobile Phones]]\n* [[SF_Gaming|Gaming Services]]\n* [[Site Banner Archive]]\n\n== Advertisers ==\n* [http://www.sofurry.com/advert Manage your ads]\n\n== Developers ==\n* [[Intro to the JSON interface]]\n* [[How to use OTP authentication]]\n* [[SoFurry 2.0 API]]\n* [[Submission Upload JSON API]]\n* [[Submission Download JSON API]]\n\n|}"
                    }
                ]
            }
        }
    }
}