Difference between revisions of "API:PUT /submission/:id/content"

From SoFurry
Jump to: navigation, search
(Response: Success)
(Response: Success)
 
(One intermediate revision by the same user not shown)
Line 38: Line 38:
 
   "created_at": "2016-04-25 13:23:41",
 
   "created_at": "2016-04-25 13:23:41",
 
   "updated_at": "2016-04-25 13:29:25",
 
   "updated_at": "2016-04-25 13:29:25",
   "url": "http:\/\/sfx-api-tetsudra.c9users.io/devgetcontent/70bee5de-a96e-9c45-fd7e-e6e92d3ee6cd.png"
+
   "url": "<nowiki>http://sfx-api-tetsudra.c9users.io/devgetcontent/70bee5de-a96e-9c45-fd7e-e6e92d3ee6cd.png</nowiki>"
 
  }
 
  }
  

Latest revision as of 13:35, 25 April 2016

This endpoint lets you push actual content into the submission.

This endpoint is under development, with the following underlying changes pending:

  • Subtype processing pipelines - different file types will be handled and stored differently by the API.
  • Versioning - Every PUT to this endpoint will serve the latest version, but prior versions can be stored and accessed
  • URL array:
    • Original URL - to refer to the original file
    • Processed URL - to point to a rendered/processed version of the content. For example: A large JPG resized down, or a markdown file parsed into HTML
    • Preview URL - A url to a small square image to be used when previewing the content

Resource URL

https://api.sofurrybeta.com/submission/{id}/content

Request

PUT /submission/{id}/content
X-SoFurry-Token: 1:3e9ed5866113d0a5b95b4798f8e7db9a
(binary stream)

The request body is just pure binary content - no fields or formats.

Response: Success

HTTP 200
{
  "id": 5,
  "user_id": "1",
  "title": "My awesome artwork",
  "type": "image",
  "description": "Some sample artwork",
  "guid": "f8a89ef6-34ac-a7a5-0c00-ad22165c46ba",
  "visible": "1",
  "reported": "0",
  "hold": "0",
  "rating": "clean",
  "created_at": "2016-04-25 13:23:41",
  "updated_at": "2016-04-25 13:29:25",
  "url": "http://sfx-api-tetsudra.c9users.io/devgetcontent/70bee5de-a96e-9c45-fd7e-e6e92d3ee6cd.png"
}

The result will be the submission object, along with a URL to view the submission.