User - danopia/deviantart-difi GitHub Wiki

getGiveMenu

Loads the dynamic Give Menu on a user's page.

Usage

  • When loading the Give menu on any page.
  • To see whether a user can be given certain badges (e.g. Llamas, Cakes, etc).

Params

  • username: string, the target profile (e.g. "BrenTayB")

Response

Returns a Dialog object, which resembles:

{"css":"",
 "downloads":[],
 "dwaitcalls":[],
 "pageData":[],
 "deps":[
   ["v6extra.css","http:\/\/st.deviantart.net\/css\/v6extra.css",32862160907,{"media":"Screen,Projection,TV"}],
   ["v6core.css","http:\/\/st.deviantart.net\/css\/v6core.css",89880295906,{"media":"Screen,Projection,TV"}],
   . . .
   ["drawplz_brushes_jc.js","http:\/\/st.deviantart.net\/css\/drawplz_brushes_jc.js",61771183451,null]],
 "title":null,
 "html":"    <div class=\"pager2\" style=\"display:none\"> . . . <\/div>\n    "}

Userscripts

This API can be used to determine whether if a target user is eligible to receive a llama badge from the current logged-in user, since llama badges can be given to a target user only once. You can replicate this behaviour with a POST request in userscripts.

For example, the One-click Llama Button script uses its own mechanism to check if the user has been already given a llama.

Another script called Amall uses the native [DiFi object] calls to achieve the same results.

Example

    DiFi.pushPost("User","getGiveMenu",[u],function (success, data) {
        if (success&&data.response.content.html.indexOf("Give a <span>Llama Badge")===-1)
            $(".amall-give[pruf="+u+"]").addClass('amall-already').removeClass('amall-working');
    });
    DiFi.send();

getFriendsMenu

Gets a list of your friends.

Usage

Whenever clicking on the "Friends" icon, either on:

  • The profile page
  • Composing a new Note
  • Sending group invitation to a Friend

Params

  • ???: number (e.g. 1)
  • page: number (e.g. 1)

Response

Returns an array containing an object for each friend. e.g.:

{
    "groupid": "0",
    "username": "dADroid",
    "realname": "The dADroid-bot account",
    "symbol": "~",
    "usericon": 6,
    "groupname": "",
    "lastvisit": "Online",
    "avatar": "https:\/\/a.deviantart.net\/avatars\/d\/a\/dadroid-bot.png?3"
}

usernameAvailable

Checks if a certain username does not already exist on the site.

Usage

  • At the new account registration page.

Params

  • username: string, the target username (e.g.. "spyed")

Response

Returns content with a boolean value: true if the username does not exist, false if the username is already taken.

grantNoAdsOffer

Removes ads from the site for a limited time (e.g. 24 hours).

This was discovered on June 18th, 2011 and last tested on January 15th, 2019. This method probably won't work anymore in the future.

Params

None

Response

  • On success, null
  • On fail, possible errors are:
    • error: User already has no ads
    • error: User has already claimed the offer

setStatus

Sets your user online status.

Usage

  • Called when you change your status in the UI, i.e. to online or offline.

Params

  • status: number.
    • 0: online
    • 1: invisible
    • 2: invisible, "even in private messages"

Response

Returns null on success, object with user-friendly 'error' key on error

setPublicBirthdayOptions

Set option to show birthday publicly

Usage

unknown

Params

  • user_id: number
  • dob_public: number (0 = don't show, 1 = month and day, 2 = show full age/birthday)
  • dob: date of birth in year-month-day format

Response

undocumented

getStatus

Get your current status (Online/Invisible).

Params

None

Response

  • 0 = Online
  • 1 = Invisible

setDetails

Sets details on welcome page

Params

  • user_id: number
  • type_id: number (related to things like "Software Developer")
  • country_id: number (country id on welcome page)

Response

undocumented

signupGuideDone

When signup guide is done

Params

  • done: number (1)

resetAvatar

Resets avatar?

Usage

unknown

Params

  • user_id: number

Response

  • On success, undocumented
  • On fail, possible errors are:
    • error: No such gruser

setAvatar

Sets avatar?

Usage

  • When adding a new avatar.

Params

  • user_id: number (e.g.: "37591934")
  • deck_id: number (i.e. 572832117)
  • position_x: number (e.g.: "0")
  • position_y: number (e.g.: "0")
  • position_dx: number (e.g.: "50")

Response

  • avatar_url: string, a link to the new user avatart image. e.g.: https://a.deviantart.net/avatars/d/a/dadroid-bot.gif?2

What is deckId?

This number could be acquired by uploading the file as deck_file field to this URL:

https://www.deviantart.com/global/deckpost.php?nowrap=1

After uploading the file, you'll get a reponse like this:

{
    "deckId": "572832117",
    "status": "1",
    "name_long": "my_avatar.gif",
    "is_displayable": true,
    "is_video": false,
    "is_printable": false,
    "is_text": false,
    "file_type_str": "gif",
    "file_size_str": "13 KB",
    "width": "50",
    "height": "50",
    "preview_url": "https:\/\/tmp00.deviantart.net\/d03f\/t\/2018\/355\/0\/2\/022fda7b923d2ddbda129dfd1fcd7a40.gif",
    "thumb_url": "https:\/\/tmp00.deviantart.net\/d03f\/t\/2018\/355\/0\/2\/022fda7b923d2ddbda129dfd1fcd7a40.gif",
    "name_short": "my_avatar.gif",
    "suggested_size": 0,
    "text_preview": null,
    "sizeArray": ["Original Size (50 &times; 50 pixels)"],
    "frames": [],
    "attributes": "516",
    "attributes2": "0",
    "validate_token": "39e6e6b892571677d905",
    "validate_key": "1545385039"
}

You can then use deckId (e.g. "572832117") to set your avatar.

avatarChangeStatus

Unknown

Related to User::setAvatar.

Params

  • unknown: id
  • unknown: id

Response

undocumented

block

Adds the username to the blocked users list.

Usage

  • When the "Block User" option on a comment is selected.

Params

  • username: The selected username to be blocked.

Response

Returns null on success.

unblock

Removes the username from the blocked users list.

Params

  • username: The selected username to be blocked.

Response

Returns null on success.

unblockDeviation

undocumented

Usage

unknown

Params

  • deviationid

Response

undocumented

pauseDownloadAd

Purpose Unknown

Usage

  • When an advert has finished downloading?

Params

None

Response

Returned null in the wild.

getDetailsByUsername

Returns formatted user name and a link to the avatar.

Usage

  • Seen in combination with the auto-complete.

Params

  • userget: array containing usernames

Response

An associative object, e.g.:

{
    "spyed": {
        "username": "spyed",
        "link": "<span class=\"username-with-symbol u\"><a class=\"u admin username\" href=\"https://spyed.deviantart.com/\">spyed</a><span class=\"user-symbol admin\" data-quicktip-text=\"DeviantArt Staff\" data-show-tooltip=\"1\" data-gruser-type=\"admin\"></span></span>",
        "avatar": "https://a.deviantart.net/avatars/s/p/spyed.gif"
    }
}

getSymbolsModal

Returns HTML with a list and explanation of all membership levels, with your own membership level at the end

Usage

Params

None

Response

Returns a Dialog object.

setBrowseSidebarState

Usage

Hides/shows left sidebar on http://www.deviantart.com/browse/all/

Params

  • closed: boolean

verifyMe

Checks if the user has verified their email address

Usage

  • Seen on the VerifyModal.

Params

None

Response

Returns true if the user is verified. Otherwise, returns false.

getVerifyModal

Returns the VerifyModal and the verify ribbon bar.

Params

None

Response

  • On success, returns a [Dialog]-like object.
  • On error: error: "Verification is unnecessary"

openAgeGate

Age validation when viewing a mature Deviation as an unregistered user.

Params

  • year?
  • month?
  • day?
  • deviationid

closeAgeGate

undocumented

Params

None

Response

Returned false in the wild.

getAgeGateModal

undocumented

Params

None

Response

Returned false in the wild.

getMentorSuggestion

Purpose unknown

Usage

undocumented

Params

  • newbie_username: string

Response

Returned false in the wild.

recordMentoringAction

undocumented

Params

  • newbie_username: string

Response

undocumented

whoami

Returns very basic user information (username, symbol, usericon, usericonurl, is_test_group)

Usage

  • For the commission widget?

Params

None

Response

  • username: string, e.g. "danopia"
  • symbol: string, e.g. ""
  • usericon: string, full address to user avatar
  • usericonurl: string, full address to user avatar
  • is_test_group: boolean, e.g. TRUE

price

For the commission widget?

Params

  • float
  • boolean
  • boolean
  • [string]

Response

setDefaultUnits

Changes the default units of a user between metric and imperial.

Usage

unknown

Params

  • unitid: number (e.g. 0 for metric, 1 for imperial)

Response

Returns null on success.

setDefaultCurrency

Changes a user's default currency.

Usage

unknown

Params

  • currency: int

Response

undocumented

email_is_current

undocumented

Params

None

Response

Returned null.

adCatch

REMOVED Doesn't seem to work any more.

Params

  • type
  • content
  • desc
  • url i.e. window.location.href

damntoken

undocumented

Params

Response

  • On success, undocumented
  • On fail:
    • error: This DiFi call is only available through OAuth2

getAvatarByUsername

Returns address to the user avatar.

Usage

  • Encountered when trying to find a Deviant for the "Give one, get one" action in the Notifications.

Params

  • username: string

Response

  • On success, returns the complete URL for the user avatar.
  • On fail:
    • error: User does not exist.

joinModalCanceled

undocumented

Params

None

openAgeGate2

undocumented

Params

  • year
  • month
  • day
  • unknown

pauseMobileAdhesionAd

Purpose unknown

Usage

undocumented

Params

None

Response

undocumented

join_overlay_event

Seems to be related to the overhead in the mobile

Usage

undocumented

Params

  • ???: string (e.g. show or cancel)

Response

undocumented

⚠️ **GitHub.com Fallback** ⚠️