Difference between revisions of "Submission Download JSON API"

From SoFurry
Jump to: navigation, search
m (Downloading: Updating URL to chat.sofurry.com ...)
 
(One intermediate revision by the same user not shown)
Line 1: Line 1:
 +
 +
{| style="width: 100%; background: #FF6600; margin: 1.2em 0 6px 0; border: 1px solid #ddd;"
 +
| style="width: 100%; color: #000;" |
 +
{| style="width: 100%; border: none; background: none;margin: 0.7em 0 0 0;"
 +
| style="width: 100%; text-align: center; white-space: nowrap; color: #000;" |
 +
NOTE: The API is currently being updated. This information is subject to change fundamentally shortly. In particular, this part of the API will change completely, so we advise to wait for the OAuth and API rollout.
 +
|}
 +
|}
 +
 
Downloading submissions from SoFurry is a two stage process: Listing and downloading.
 
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.
 
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.
Line 21: Line 30:
 
    
 
    
 
   viewSource: 0 = all
 
   viewSource: 0 = all
               1 = favorites (needs '''viewUserID''' parameter in request!)
+
               1 = favorites (needs '''authorid''' parameter in request!)
               2 = watchlist (needs '''viewUserID''' parameter in request!)
+
               2 = watchlist (needs '''authorid''' parameter in request!)
 
               3 = folder (needs '''folderID''' parameter in request!)
 
               3 = folder (needs '''folderID''' parameter in request!)
 
               4 = groups (needs '''gid''' parameter with the group ID in request!)
 
               4 = groups (needs '''gid''' parameter with the group ID in request!)
 
               5 = search (needs '''search''' parameter with comma separated tags in request!)
 
               5 = search (needs '''search''' parameter with comma separated tags in request!)
 
               6 = commission (needs '''cid''' parameter with commission ID in request!)
 
               6 = commission (needs '''cid''' parameter with commission ID in request!)
               7 = user (needs '''viewUserID''' parameter in request!)
+
               7 = user (needs '''authorid''' parameter in request!)
 
               8 = featured
 
               8 = featured
               9 = highlights (needs '''viewUserID''' parameter in request!)
+
               9 = highlights (needs '''authorid''' parameter in request!)
               10 = group watchlist (needs '''viewUserID''' parameter in request!)
+
               10 = group watchlist (needs '''authorid''' parameter in request!)
               11 = combined watchlist (needs '''viewUserID''' parameter in request!)
+
               11 = combined watchlist (needs '''authorid''' parameter in request!)
 
    
 
    
 
   page: 0..n (available number of pages is returned with the response to this request)
 
   page: 0..n (available number of pages is returned with the response to this request)

Latest revision as of 15:20, 14 November 2015

NOTE: The API is currently being updated. This information is subject to change fundamentally shortly. In particular, this part of the API will change completely, so we advise to wait for the OAuth and API rollout.

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.

Listing

Here is an example listing request:

 http://chat.sofurry.com/ajaxfetch.php?f=browse&sort=0&contentType=-1&viewSource=0&page=0

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 authorid parameter in request!)
             2 = watchlist (needs authorid 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 authorid parameter in request!)
             8 = featured
             9 = highlights (needs authorid parameter in request!)
             10 = group watchlist (needs authorid parameter in request!)
             11 = combined watchlist (needs authorid 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:

 {"success":"true","currentpage":"0","totalpages":233,"messageType":3,"pagecontents":[
   {"currentpage":0,"totalpages":233,"messageType":3,"items":[
     {"href":"\/page\/142819\/tab\/browse all",
      "pid":"142819",
      "name":"Psicosis Drain",
      "authorName":"Aitos Saibankan",
      "authorId":"30791",
      "thumb":"\/art\/thumbnails\/aitos-saibankan\/aitos-saibankan_psicosis-drain.jpg",
      "contentType":"1",
      "date":"1-May-2010",
      "width":40,"height":55,
      "contentLevel":"1",
      "keywords":"Wolf, Masturbation, Magic, Demon, Mind Control, Dark, M\/M"},
     {"href":...
      ...
     }
   ]}
 ]}

Downloading

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

 http://chat.sofurry.com/ajaxfetch.php?f=getpagecontent&pid=12345

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"}