Submission Download JSON API

From SoFurry
Revision as of 15:14, 28 May 2012 by Phantomgraph (talk | contribs) (Downloading: Updating URL to ...)
Jump to: navigation, search

Downloading submissions from SoFurry is a two stage process: Listing and downloading. Downloads are pretty straightforward for images and music, all you need is the file URL which you get in a listing request. Downloading stories is done via a separate request.


Here is an example listing request:

Explanation of parameters:

 sort: 0 = sort by date
       1 = sort by title
       2 = sort by popularity
 contentType: -1 = all content
              0 = stories
              1 = art
              2 = music
              3 = journal
 viewSource: 0 = all
             1 = favorites (needs viewUserID parameter in request!)
             2 = watchlist (needs viewUserID parameter in request!)
             3 = folder (needs folderID parameter in request!)
             4 = groups (needs gid parameter with the group ID in request!)
             5 = search (needs search parameter with comma separated tags in request!)
             6 = commission (needs cid parameter with commission ID in request!)
             7 = user (needs viewUserID parameter in request!)
             8 = featured
             9 = highlights (needs viewUserID parameter in request!)
             10 = group watchlist (needs viewUserID parameter in request!)
             11 = combined watchlist (needs viewUserID parameter in request!)
 page: 0..n (available number of pages is returned with the response to this request)

Note: Personal data like user favorites and watchlist may be blocked for non-authorized requests. If your app is to be used by the user himself querying his own data, be sure to send proper OTP authentication credentials to gain access to this information. Access to group galleries may require OTP authentication as a user who is member of that group, depending on the group visibility setting.

The response will look like this:

     {"href":"\/page\/142819\/tab\/browse all",
      "name":"Psicosis Drain",
      "authorName":"Aitos Saibankan",
      "keywords":"Wolf, Masturbation, Magic, Demon, Mind Control, Dark, M\/M"},


To download a story, you have to issue a separate request:

12345 being the page id of the story you want to download. The response looks as follows:

{"id":"12345","success":true,"content":"Story content in html format"}