Danbooru
Login Posts Comments Notes Artists Tags Pools Wiki Forum More ยป
Search Changes Help | Posts (0) History
  • Help
guro
scat
furry -rating:g

Recent Changes (all)

  • darian (bittersweet bunny) (brown dust 2)
  • blade (young lady) (brown dust 2)
  • ventana (onsen practitioner) (brown dust 2)
  • ventana (brown dust)
  • suzune nia
  • gender dysphoria
  • ventana (snow white) (brown dust 2)
  • chien wu (azur lane)
  • chien wu (all-nighter masterpiece) (azur lane)
  • minase itsuki (vs janshi brand-new stars)
  • blade (onsen swordfighter) (brown dust 2)
  • zibai (genshin impact)
  • zenith (poolside guardian) (brown dust)
  • zenith (brown dust)
  • zenith (robin hood) (brown dust 2)
  • phalloplasty
  • sex reassignment surgery
  • amami yurina
  • eleaneer (shadow bunny) (brown dust 2)
  • clemenceau (splendid breeze) (azur lane)
  • clemenceau (azur lane)
  • eleaneer (brown dust 2)
  • eleaneer (b-rank idol) (brown dust 2)
  • liberta (brown dust 2)
  • ibuki meno

Options

  • Wiki History
  • Discussions
  • What Links Here

api:notes

Table of Contents
  • 01. Record field format
  • 02. Associated attributes
  • 03. Index
  • 04. Show
  • 05. Create
  • 06. Update
  • 07. Delete
  • 08. Revert
  • 09. Preview
  • 10. See also
  • 11. External links

This page has details for how to interact with note records through the API.


Record field format

NameTypeDetails
idinteger>0
post_idinteger>0
bodystring
xinteger>0
yinteger>0
widthinteger>0
heightinteger>0
is_activeboolean
versioninteger>0
created_attimestamp
updated_attimestamp

Associated attributes

The following is the list of relations that can be included in the API results (see Help:Common URL parameters for more info):

NameTypeNumberAvailabilityDetails
postpostsinglerequired

Index

Returns multiple note records.

HTTP MethodGET
Base URL/notes.json
Typeread request
DescriptionThe default order is ID descending.
Search attributes

Search parameters take the following format (see Help:Common URL parameters for more info):

search[FIELD]=VALUE

The following are the base fields along with their associated type. Check the syntax pages for all of the available variations.

  • Number syntax
    • id
    • x
    • y
    • width
    • height
    • version
    • created_at
    • updated_at
  • Text syntax
    • body
  • Boolean syntax
    • is_active
  • Post syntax
    • post
Search order

Using the search parameter order with one of the following values changes the order of the results.

  • custom - Help:Common URL parameters
    • In order to use this order, search[id] must also be set with a list of comma-separated IDs.

Show

Returns a single note record.

HTTP MethodGET
Base URL/notes/$id.json
Typeread request
Description$id is the note ID.

Note: This does a redirect to the post with that note when using the HTML interface, specifically highlighting that note when it gets there.


Create

Creates a single note record.

HTTP MethodPOST
Base URL/notes.json
Typewrite request
Create parameters

Note parameters take the following format (see Help:API Write Requests for more info):

note[FIELD]=VALUE
  • Required:
    • post_id - The post ID the note belongs to.
    • x - X coordinate of the note starting from the left of the image.
    • y - y coordinate of the note starting from the top of the image.
    • height
    • width
    • body
  • Optional
    • is_active - Whether the note is active or not (i.e. deleted).

Note: The note box must fit within the full-size dimensions of the image.


Update

Updates a single note record.

HTTP MethodPUT/PATCH
Base URL/notes/$id.json
Typewrite request
Description$id is the note ID.
Update parameters

Accepts the same parameters as the Create action, except for the post ID. All parameters are optional.


Delete

Deletes a single note record.

HTTP MethodDELETE
Base URL/notes/$id.json
Typewrite request
Description$id is the note ID.

Revert

Reverts a single note record to a prior version.

HTTP MethodPUT
Base URL/notes/$id/revert.json
Typewrite request
Description$id is the note ID.
Revert parameters
  • Required:
    • version_id - The note version ID to revert to.

Note: The version ID may be passed along as a URL parameter instead of in the body.


Preview

Returns the sanitized version of HTML that Danbooru uses for notes.

HTTP MethodPOST
Base URL/notes/preview.json
Typewrite request
DescriptionReturns a JSON object that has the same attributes as a note record, with the addition of a sanitized_body field.
Preview parameters
  • Required:
    • body - The HTML text to sanitize.

Note: The body variable may be passed along as a URL parameter instead of in the request body.


See also

  • API:Note versions
  • Help:Common URL Parameters
  • Help:API

External links

Controllerhttps://github.com/danbooru/danbooru/blob/master/app/controllers/notes_controller.rb
Modelhttps://github.com/danbooru/danbooru/blob/master/app/models/note.rb
Policyhttps://github.com/danbooru/danbooru/blob/master/app/policies/note_policy.rb
Terms / Privacy / Upgrade / Contact /