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)

  • hino rei
  • philippe (pokemon)
  • blotter art
  • love live! hasu no sora jogakuin school idol club bloom garden party
  • hop (pokemon)
  • firenze (stella sora)
  • kokoromo memory
  • letty (ogami kazuki)
  • jellied eel
  • fish (food)
  • list of stella sora characters
  • sherlock (stella sora)
  • miria (isekai meikyuu de harem wo)
  • ahoge
  • sanada touru
  • halo ahoge
  • cross ahoge
  • rokudu sariel
  • mihono bourbon (umamusume)
  • neo universe (umamusume)
  • vivlos (umamusume)
  • dr. coyle
  • admire vega (umamusume)
  • agnes tachyon (umamusume)
  • mihono bourbon (uma stars) (umamusume)

Options

  • Wiki History
  • Discussions
  • What Links Here

api:comments

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

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

01 Record field format


NameTypeDetails
idinteger>0
post_idinteger>0
bodystring
scoreinteger
is_deletedboolean
is_stickyboolean
do_not_bump_postboolean
creator_idinteger>0
updater_idinteger>0
created_attimestamp
updated_attimestamp

02 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
creatorusersinglerequired
updaterusersinglerequired
postpostsinglerequired

03 Index


Returns multiple comment records.

HTTP MethodGET
Base URL/comments.json
Typeread request
DescriptionThe default order is ID descending.

Note: group_by as a parameter must be set to comment, or else posts will be returned instead (e.g. group_by=comment).

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
    • score
    • created_at
    • updated_at
  • Text syntax
    • body
  • Boolean syntax
    • is_deleted
    • is_sticky
    • do_not_bump_post
  • Post syntax
    • post
  • User syntax
    • creator
    • updater
Special search parameters

The following are additional search fields.

  • is_edited - Whether a comment was edited 5 or more minutes it was created. (see Help:Boolean Syntax)
Search order

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

  • id_asc - ID ascending.
  • created_at - Created at descending.
  • created_at_desc - Created at descending.
  • created_at_asc - Created at ascending.
  • post_id - Post ID descending.
  • post_id_desc - Post ID descending.
  • score - Post ID descending.
  • score_desc - Post ID descending.
  • score_asc - Post ID ascending.
  • updated_at - Updated at descending.
  • updated_at_desc - Updated at descending.
  • updated_at_asc - Updated at ascending.
  • custom - Ordered by search[id]. (See Help:Common URL parameters for more info)

04 Show


Returns a single comment record.

HTTP MethodGET
Base URL/comments/$id.json
Typeread request
Description$id is the comment ID.

05 Create


Creates a single comment record.

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

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

comment[FIELD]=VALUE
  • Required:
    • post_id
    • body
  • Optional
    • do_not_bump_post
    • is_sticky (Moderator+)

06 Update


Updates a single comment record.

HTTP MethodPUT/PATCH
Base URL/comments/$id.json
Typewrite request
Description$id is the comment ID.
Update parameters
  • Optional:
    • body
    • is_deleted
    • is_sticky (Moderator+)

07 Destroy


Deletes a single comment record.

HTTP MethodDELETE
Base URL/comments/$id.json
Typewrite request
Description$id is the comment ID.

Note: This action can also be accomplished using Update by setting is_deleted to true.

08 Undelete


Undeletes a single comment record.

HTTP MethodPOST
Base URL/comments/$id/undelete.json
Typewrite request
Description$id is the comment ID.

Note: This action can also be accomplished using Update by setting is_deleted to false.

09 See also


  • Help:Common URL Parameters
  • Help:API

10 External links


Controllerhttps://github.com/danbooru/danbooru/blob/master/app/controllers/comments_controller.rb
Modelhttps://github.com/danbooru/danbooru/blob/master/app/models/comment.rb
Policyhttps://github.com/danbooru/danbooru/blob/master/app/policies/comment_policy.rb
Terms / Privacy / Upgrade / Contact /