Gallections - danopia/deviantart-difi GitHub Wiki
This method is used to create, remove and otherwise manipulate the contents of user gallections (i.e. "gallery collections" or "favourite collections")
Here's a list of known folder types:
Name | Value | Constant |
---|---|---|
undefined | 0 |
MYSTERY |
Deviation Page | 1 |
RESOURCE_DEVIATION |
User Gallery | 20 |
RESOURCE_GALLERIES |
Favourite Collections | 21 |
RESOURCE_FAVCOLLECTIONS |
For more resource types, refer to Resource Types.
Creates a new gallection (e.g. add a folder in your gallery or favourites.)
NOTE: If a folder with the same name already exists, a number (e.g. 2) is appended to the end of new folder name.
- When adding a deviation to a new collection with the +favourite drop-down button
- When clicking the ➕ button in the collections drop header
-
userid
: number -
gallerytype
: number (e.g. 20 for Gallery and 21 for Favourites) -
name
: string (e.g. "test dir")
-
On success, returns the new collection data, e.g.:
-
gallectionid
: number (e.g. 78397318) -
name
: string (e.g. "test dir") -
url
: string (e.g.https://username.deviantart.com/favourites/78397318/test-dir
)
-
-
On error:
-
error
: "No gallections of the supplied resource type () are supported." -
error
: "Not authorized"
-
REMOVED
– This call seems to have been removed and not used anymore.
Appears to create a "Featured" gallery for the current user if he doesn't have one already?
The actual purpose is kinda unknown.
See also Aggregations::get_galleries_initial
(both methods are typically called together)
- Pretty sure we found this when initiating a drag-and-drop action.
-
deviantid
(?): number -
gallerytype
(?): number (20 or 21)
NOTE: It seems to take the current user as a param, but you wouldn't be able to create galleries for other users.
The second param appears to indicate a Favorites gallery.
Returns the new/existing gallery ID in galleryid
. Used to also return a list of deviations, but that is apparently no more.
REMOVED
– This call seems to have been removed and not used anymore.
Appears to return the gallery id of each item in a users gallery.
-
deviantid
: number -
gallerytype
: number (20 or 21)
Returns an array of id
s for each item in a users gallery
Removes a "resource" (i.e. Deviation) from a Gallection folder.
This method can be used to remove a Deviation from either a gallery or favourites folder.
- When removing a certain deviation from a favourite collection
-
userid
: number, the folder owner's userid -
gallerytype
: number (e.g. 20 for Gallery and 21 for Favourites) -
galleryid
: number, the destination folder id -
resourcetype
: number (e.g. 1 for a Deviation) -
resourceid
: number (e.g.deviationid
when the resource type is 1)
Returns null on success
Puts a "resource" (such as a Deviation) into a Gallection folder (e.g. Favourites)
- Drag-and-drop actions between folders.
- Re-ordering deviations in a collection.
- Copying deviations using the context menu.
-
userid
: number, the folder owner's userid -
foldertype
: number (20 for Gallery, 21 for Favorites) -
folderid
: int (e.g. 42231485) -
resourcetype
: number, i.e. (e.g. 1 forRESOURCE_DEVIATION
) -
resourceid
: number, i.e.deviationid
(e.g. 196838222) -
position
: number, i.e. the resource position in the folder (starting from0
) (e.g. 0 or 20)
NOTE: rid
stands for resourceid
, and is often found in the collect_rid
attribute of HTML elements.
It usually is a two-element array, such that rid = [resourcetype, resourceid]
e.g. rid[0]
should be 1 for Deviations, and rid[1]
refers to a deviation id.
The following request is called when a user adds a deviation to a favourite gallection:
"Gallections","add_resource",["{userid}","{foldertype}","{gallectionid}","1","{deviationid}","0"]
Couple of notes:
- Here,
{foldertype}
is 21 for favourites - The third to last number (1) indicates that we are adding a deviation
- The last number (0) means that the deviation is added to the top of favourite folder
Return true on success.
Moves a "resource" such as a Deviation into another Gallection folder (e.g. favourites)
- Drag-and-drop actions between folders.
- Moving deviations using the context menu.
-
userid
: number, the folder owner's userid -
foldertype
: number (20 for Gallery, 21 for Favorites) -
source_folderid
: number, the source folder id -
destination_folderid
: number, the destination folder id -
resourcetype
: number (e.g. 1 forRESOURCE_DEVIATION
) -
resourceid
: number, i.e.deviation_id
for Deviations (e.g. 196838222) -
position
: number, i.e. the resource position in the new folder (starting from0
) (e.g. 0 or 20)
Return true on success.
Returns a list of user's all collections you can move something into
- When moving Faves from one folder to another using "Move to" from context menu
-
userid
: number, the folder owner's userid -
foldertype
: number, (e.g. 20 for Gallery, 21 for Favorites) -
folderid
: number, presumably the parent folder id
- On success, an array containing an object for each folder
-
attributes
: number -
collectionid
: int -
galleryid
: int -
is_root_folder
: boolean (e.g. false) -
name
: string (e.g. "Featured") -
parentid
: number, e.g. null -
position
: number, e.g. 0 -
resource_typeid
: number, e.g. 21 for favourites -
title
: string (e.g. "Featured") -
cover_deviationid
: number -
behavior
: object containing boolean propertiesarrange_folders
arrange_resources
blue_buttons
contribute
contribute_deviations
create_folder
delete
delete_folder
drop_resources
edit_button
edit_folder
log
options_button
recommend
recommend_deviations
rename
view
view_folder
-
Renames a gallection (e.g. a folder in your gallery or favourites.)
- When renaming a folder using the context menu.
-
userid
: number, the folder owner's user id. -
typeid
: number (e.g. 20 for Gallery, 21 for Favourites) -
setid
: number i.e.folder_id
-
name
: string, the new folder name
Returns null on success.
Returns the list of gallections (i.e. gallery and favourite collections) for a user.
- When drag-and-dropping a deviation into a favourite folder in the slide menu
-
userid
: number
- On success, an array containing user gallections,
e.g.:
[ {...}, {...}, {...} ]
.
"galleryid": <id>,
"type": 21,
"position": 0,
"parentid": null,
"title": "Featured",
"url": "https:\/\/www.deviantart.com\/<username>\/favourites\/<id>\/Featured",
"approx_total": 143,
"attributes": "0",
"behavior": {
"create_folder": true,
"delete_folder": true,
"edit_folder": true,
"view_folder": true,
"contribute_deviations": true,
"recommend_deviations": true,
"delete": true,
"view": true,
"log": true,
"options_button": true,
"arrange_folders": true,
"edit_button": true,
"blue_buttons": true,
"drop_resources": true,
"arrange_resources": true,
"rename": true,
"contribute": true,
"recommend": true
},
"ids": [
[1, <id>, 0],
[1, <id>, 0],
[1, <id>, 0]
],
"top_resources": [
[1, <id>, ". . . ."],
[1, <id>, ". . . ."],
[1, <id>, ". . . ."]
]
- On error:
-
error
: "Not a valid user"
-
Turns watch settings for a folder on or off.
- When watching a user's collections (e.g. gallery or favourites).
-
userid
: number, the folder owner's user id. (e.g. "11555439") -
typeid
: number (e.g. 20 for Gallery, 21 for Favourites) -
collectionid
: number, i.e. the gallery to watch (e.g. "50016531") -
is_watched
: boolean (true means watch, false means unwatch)
Returns null on success
Moves a gallection folder into another folder
- When moving a gallery folder using the context menu
-
userid
: number, the folder owner's user id. -
typeid
: number (e.g. 20 for Gallery, 21 for Favourites) -
folder_id
: number, i.e. the selected folder which will be moved -
destination_id
: number, i.e. the target destination
Returns the destination's folder id on success.
Removes a gallection (e.g. delete a folder in your gallery or favourites.)
- When removing a favourite folder
-
userid
: string -
foldertype
: number (20 for Gallery, 21 for Favorites) -
folderid
: number
Returns null on success.
This method will reposition a gallection folder.
- When drag-and-dropping a gallery folder to re-order it.
-
userid
: number -
foldertype
: number (e.g.20
is for gallery and21
is for favourites) -
folderid
: int (e.g. 42231485) -
position
: number, i.e. the folder's new position in the gallection (starting from0
) (e.g. 0 or 20)
Returns null on success.
This method returns a user's list of gallections (such as favourite folders).
- Called when hovering the mouse on the add to favourite button of a deviation to display possible destination favourite folders.
-
userid
: number -
foldertype
: number (e.g.20
is for gallery and21
is for favourites)
An array containing an object for each gallection.
attributes: "0",
gallectionid: "<id>",
parentid: null,
position: 0,
title: "Featured"
undocumented
Purpose unknown.
- string
- id
- id
- string