Miyuu's Image Board

api:comments

Table of Contents
  • 1. Record field format
  • 2. Associated attributes
  • 3. Nomenclature
  • 4. Index
  • 5. Show
  • 6. Create
  • 7. Update
  • 8. Delete
  • 9. Undelete
  • 10. See also
  • 11. External links
  • The following includes the details of how to interface with the comment records through the API.

    Record field format

    [table]

    [thead]

    [tr]

    [th]Name[/th]

    [th]Type[/th]

    [th]Details[/th]

    [/tr]

    [/thead]

    [tbody]

    [tr]

    [td]

    id
    [/td]

    [td]integer[/td]

    [td]>0[/td]

    [/tr]

    [tr]

    [td]
    post_id
    [/td]

    [td]integer[/td]

    [td]>0[/td]

    [/tr]

    [tr]

    [td]
    body
    [/td]

    [td]string[/td]

    [td][/td]

    [/tr]

    [tr]

    [td]
    score
    [/td]

    [td]integer[/td]

    [td][/td]

    [/tr]

    [tr]

    [td]
    is_deleted
    [/td]

    [td]boolean[/td]

    [td][/td]

    [/tr]

    [tr]

    [td]
    is_sticky
    [/td]

    [td]boolean[/td]

    [td][/td]

    [/tr]

    [tr]

    [td]
    do_not_bump_post
    [/td]

    [td]boolean[/td]

    [td][/td]

    [/tr]

    [tr]

    [td]
    creator_id
    [/td]

    [td]integer[/td]

    [td]>0[/td]

    [/tr]

    [tr]

    [td]
    updater_id
    [/td]

    [td]integer[/td]

    [td]>0[/td]

    [/tr]

    [tr]

    [td]
    created_at
    [/td]

    [td]timestamp[/td]

    [td][/td]

    [/tr]

    [tr]

    [td]
    updated_at
    [/td]

    [td]timestamp[/td]

    [td][/td]

    [/tr]

    [tr]

    [td]
    creator_ip_addr
    [/td]

    [td]inet[/td]

    [td]Limited to Moderator+[/td]

    [/tr]

    [tr]

    [td]
    updater_ip_addr
    [/td]

    [td]inet[/td]

    [td]Limited to Moderator+[/td]

    [/tr]

    [/tbody]

    [/table]

    Associated attributes

    [table]

    [thead]

    [tr]

    [th]Name[/th]

    [th]Type[/th]

    [th]Number[/th]

    [th]Availability[/th]

    [th]Details[/th]

    [/tr]

    [/thead]

    [tbody]

    [tr]

    [td]

    creator
    [/td]

    [td]user[/td]

    [td]single[/td]

    [td]required[/td]

    [td][/td]

    [/tr]

    [tr]

    [td]
    updater
    [/td]

    [td]user[/td]

    [td]single[/td]

    [td]required[/td]

    [td][/td]

    [/tr]

    [tr]

    [td]
    post
    [/td]

    [td]post[/td]

    [td]single[/td]

    [td]required[/td]

    [td][/td]

    [/tr]

    [/tbody]

    [/table]

    Nomenclature

    • Plural form: "comments"
      • Used in the URL pathname
    • Singular form: "comment"
    • Versions: none

    Index

    [table]

    [tbody]

    [tr]

    [td]HTTP Method[/td]

    [td]GET[/td]

    [/tr]

    [tr]

    [td]Base URL[/td]

    [td]

    /comments.json
    [/td]

    [/tr]

    [tr]

    [td]Type[/td]

    [td]read request[/td]

    [/tr]

    [tr]

    [td]Description[/td]

    [td]The default order is ID descending.[/td]

    [/tr]

    [/tbody]

    [/table]


    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

    All of the following are standard attributes with all of their available formats and qualifiers.

    Special search parameters

    • body_matches
      - Case-insensitive wildcard searching on the body text field.
    • order
      - Sets the order of results.
      • post_id
        - Orders by post ID.
      • score
        - Orders by comment score.
      • updated_at
        - Orders by updated_at timestamp.

    Show

    [table]

    [tbody]

    [tr]

    [td]HTTP Method[/td]

    [td]GET[/td]

    [/tr]

    [tr]

    [td]Base URL[/td]

    [td]

    /comments/$id.json
    [/td]

    [/tr]

    [tr]

    [td]Type[/td]

    [td]read request[/td]

    [/tr]

    [tr]

    [td]Description[/td]

    [td]
    $id
    is the comment ID.[/td]

    [/tr]

    [/tbody]

    [/table]

    Create

    [table]

    [tbody]

    [tr]

    [td]HTTP Method[/td]

    [td]POST[/td]

    [/tr]

    [tr]

    [td]Base URL[/td]

    [td]

    /comments.json
    [/td]

    [/tr]

    [tr]

    [td]Type[/td]

    [td]write request[/td]

    [/tr]

    [/tbody]

    [/table]

    Create parameters

    • Required:
      • post_id
      • body
    • Optional
      • do_not_bump_post

    Restricted to Moderator+

    • Optional
      • is_sticky

    Update

    [table]

    [tbody]

    [tr]

    [td]HTTP Method[/td]

    [td]PUT/PATCH[/td]

    [/tr]

    [tr]

    [td]Base URL[/td]

    [td]

    /comments/$id.json
    [/td]

    [/tr]

    [tr]

    [td]Type[/td]

    [td]write request[/td]

    [/tr]

    [tr]

    [td]Description[/td]

    [td]
    $id
    is the comment ID.[/td]

    [/tr]

    [/tbody]

    [/table]

    Update parameters

    • Optional:
      • body
      • is_deleted

    Restricted to Moderator+

    • Optional
      • is_sticky

    Delete

    [table]

    [tbody]

    [tr]

    [td]HTTP Method[/td]

    [td]DELETE[/td]

    [/tr]

    [tr]

    [td]Base URL[/td]

    [td]

    /comments/$id.json
    [/td]

    [/tr]

    [tr]

    [td]Type[/td]

    [td]write request[/td]

    [/tr]

    [tr]

    [td]Description[/td]

    [td]
    $id
    is the comment ID.[/td]

    [/tr]

    [/tbody]

    [/table]


    Note: This action can also be accomplished using the "update comment action":[#dtext-update] by setting

    is_deleted
    to true.

    Undelete

    [table]

    [tbody]

    [tr]

    [td]HTTP Method[/td]

    [td]POST[/td]

    [/tr]

    [tr]

    [td]Base URL[/td]

    [td]

    /comments/$id/undelete.json
    [/td]

    [/tr]

    [tr]

    [td]Type[/td]

    [td]write request[/td]

    [/tr]

    [tr]

    [td]Description[/td]

    [td]
    $id
    is the comment ID.[/td]

    [/tr]

    [/tbody]

    [/table]


    Note: This action can also be accomplished using the "update comment action":[#dtext-update] by setting

    is_deleted
    to false.

    See also

    [table]

    [tbody]

    [tr]

    [td]Controller[/td]

    [td][/td]

    [td][/td]

    [/tr]

    [tr]

    [td]Model[/td]

    [td][/td]

    [/tr]

    [tr]

    [td]Policy[/td]

    [td][/td]

    [/tr]

    [/tbody]

    [/table]